Crate brontes_inspect
source ·Expand description
The brontes_inspect
crate is designed to efficiently detect and analyze
a block. Emphasizing modularity and ease of use, this crate provides a
robust foundation for developing custom inspectors, streamlining the process
of complex transaction & block analysis.
§Inspector
Inspector
is a trait defining a method inspect_block
. This method takes
a BlockTree
and Metadata
as input and returns a vector of tuples, each
containing a BundleHeader
and a BundleData
.
#[async_trait::async_trait]
pub trait Inspector: Send + Sync {
type Result: Send + Sync;
async fn inspect_block(
&self,
tree: Arc<BlockTree<Action>>,
metadata: Arc<Metadata>,
) -> Self::Result;
}
§Individual Inspectors
The brontes_inspect
crate provides several individual inspectors, each
designed to detect a specific type of MEV strategy. These inspectors are
defined in their respective modules:
Each inspector implements the Inspector
trait and provides its own
implementation of the inspect_block
method.
§Composer
The Composer
is a special type of inspector that combines the results of
individual inspectors to identify more complex MEV strategies. It takes an
array of individual inspectors and a BlockTree
and Metadata
as input,
running each inspector on the block and collecting their results.
pub struct Composer<'a, const N: usize> {
inspectors_execution: InspectorFut<'a>,
pre_processing: BlockPreprocessing,
}
The Composer
uses to define a filter that
orders results from individual inspectors. This ensures that lower-level
actions are composed before higher-level actions, which could affect the
composition.
Re-exports§
pub use mev_inspectors::*;
Modules§
- The
composer
module inbrontes-inspect
specializes in analyzing and processing MEV data. Its primary functions include composing complex MEV types from simpler ones and deduplicating overlapping MEV occurrences. - The
DiscoveryInspector
module inbrontes-inspect
specializes in identifying potential MEV transactions. It does this by looking for transactions that are x standard deviations above the average priority fee (where x is the std_dev_threshold paramater, set to 2 by default), or have a coinbase transfer, or are private transactions based on the indexed mempool transactions we have in our metadata database (s/o chainbound). - This module provides testing utilities and fixtures for the
brontes-inspect
crate. It includes support for setting up test scenarios, running inspectors with specific configurations, and validating the outcomes against expected results.
Macros§
- Defines precedence rules among different MEV types for the purpose of deduplication.
- Defines rules for composing multiple child MEV types into a single, complex parent MEV type.
Structs§
- An iterator over the variants of Inspectors