Trait reth_evm::execute::BlockExecutorProvider
source · pub trait BlockExecutorProvider:
Send
+ Sync
+ Clone
+ Unpin
+ 'static {
type Executor<DB: Database<Error: Into<ProviderError> + Display>>: for<'a> Executor<DB, Input<'a> = BlockExecutionInput<'a, BlockWithSenders>, Output = BlockExecutionOutput<Receipt>, Error = BlockExecutionError>;
type BatchExecutor<DB: Database<Error: Into<ProviderError> + Display>>: for<'a> BatchExecutor<DB, Input<'a> = BlockExecutionInput<'a, BlockWithSenders>, Output = ExecutionOutcome, Error = BlockExecutionError>;
// Required methods
fn executor<DB>(&self, db: DB) -> Self::Executor<DB>
where DB: Database<Error: Into<ProviderError> + Display>;
fn batch_executor<DB>(&self, db: DB) -> Self::BatchExecutor<DB>
where DB: Database<Error: Into<ProviderError> + Display>;
}
Expand description
A type that can create a new executor for block execution.
Required Associated Types§
sourcetype Executor<DB: Database<Error: Into<ProviderError> + Display>>: for<'a> Executor<DB, Input<'a> = BlockExecutionInput<'a, BlockWithSenders>, Output = BlockExecutionOutput<Receipt>, Error = BlockExecutionError>
type Executor<DB: Database<Error: Into<ProviderError> + Display>>: for<'a> Executor<DB, Input<'a> = BlockExecutionInput<'a, BlockWithSenders>, Output = BlockExecutionOutput<Receipt>, Error = BlockExecutionError>
An executor that can execute a single block given a database.
§Verification
The on Executor::execute
the executor is expected to validate the execution output of
the input, this includes:
- Cumulative gas used must match the input’s gas used.
- Receipts must match the input’s receipts root.
It is not expected to validate the state trie root, this must be done by the caller using the returned state.
sourcetype BatchExecutor<DB: Database<Error: Into<ProviderError> + Display>>: for<'a> BatchExecutor<DB, Input<'a> = BlockExecutionInput<'a, BlockWithSenders>, Output = ExecutionOutcome, Error = BlockExecutionError>
type BatchExecutor<DB: Database<Error: Into<ProviderError> + Display>>: for<'a> BatchExecutor<DB, Input<'a> = BlockExecutionInput<'a, BlockWithSenders>, Output = ExecutionOutcome, Error = BlockExecutionError>
An executor that can execute a batch of blocks given a database.
Required Methods§
sourcefn executor<DB>(&self, db: DB) -> Self::Executor<DB>
fn executor<DB>(&self, db: DB) -> Self::Executor<DB>
Creates a new executor for single block execution.
This is used to execute a single block and get the changed state.
sourcefn batch_executor<DB>(&self, db: DB) -> Self::BatchExecutor<DB>
fn batch_executor<DB>(&self, db: DB) -> Self::BatchExecutor<DB>
Creates a new batch executor with the given database and pruning modes.
Batch executor is used to execute multiple blocks in sequence and keep track of the state during historical sync which involves executing multiple blocks in sequence.
Object Safety§
Implementors§
source§impl BlockExecutorProvider for NoopBlockExecutorProvider
impl BlockExecutorProvider for NoopBlockExecutorProvider
type Executor<DB: Database<Error: Into<ProviderError> + Display>> = NoopBlockExecutorProvider
type BatchExecutor<DB: Database<Error: Into<ProviderError> + Display>> = NoopBlockExecutorProvider
source§impl BlockExecutorProvider for MockExecutorProvider
Available on crate feature test-utils
only.
impl BlockExecutorProvider for MockExecutorProvider
test-utils
only.