pub trait ConfigureEvm:
Clone
+ Debug
+ Send
+ Sync
+ Unpin {
type Primitives: NodePrimitives;
type Error: Error + Send + Sync + 'static;
type NextBlockEnvCtx: Debug + Clone;
type BlockExecutorFactory: BlockExecutorFactory<Transaction = <Self::Primitives as NodePrimitives>::SignedTx, Receipt = <Self::Primitives as NodePrimitives>::Receipt>
where <Self::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes: EvmTypes,
<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes as EvmTypesHost>::Tx: for<'a> FromTxWithEncoded<<Self::Primitives as NodePrimitives>::SignedTx> + for<'a> TransactionEnvMut;
type BlockAssembler: BlockAssembler<Self::BlockExecutorFactory, Block = <Self::Primitives as NodePrimitives>::Block>;
Show 24 methods
// Required methods
fn block_executor_factory(&self) -> &Self::BlockExecutorFactory;
fn block_assembler(&self) -> &Self::BlockAssembler;
fn evm_env(
&self,
header: &<Self::Primitives as NodePrimitives>::BlockHeader,
) -> Result<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv, Self::Error>;
fn next_evm_env(
&self,
parent: &<Self::Primitives as NodePrimitives>::BlockHeader,
attributes: &Self::NextBlockEnvCtx,
) -> Result<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv, Self::Error>;
fn context_for_block<'a>(
&self,
block: &'a SealedBlock<<Self::Primitives as NodePrimitives>::Block>,
) -> Result<<Self::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>, Self::Error>
where Self: 'a;
fn context_for_next_block(
&self,
parent: &SealedHeader<<Self::Primitives as NodePrimitives>::BlockHeader>,
attributes: Self::NextBlockEnvCtx,
) -> Result<<Self::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'_>, Self::Error>;
// Provided methods
fn tx_env(
&self,
transaction: impl IntoTxEnv<Recovered<<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes as EvmTypesHost>::Tx>>,
) -> Recovered<<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes as EvmTypesHost>::Tx> { ... }
fn evm_factory(
&self,
) -> &<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory { ... }
fn with_jit_support_enabled(self, _enabled: bool) -> Self
where Self: Sized { ... }
fn with_jit_support(self) -> Self
where Self: Sized { ... }
fn evm_with_precompile_cache<'a, DB>(
&self,
db: DB,
evm_env: <Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
_cache_map: PrecompileCacheMap<<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes as EvmTypesHost>::SpecId>,
_metrics_enabled: bool,
) -> <Self::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>
where DB: Database + 'a { ... }
fn jit_backend(&self) -> Option<&dyn JitBackend> { ... }
fn executor<DB>(
&self,
db: DB,
) -> impl Executor<DB, Primitives = Self::Primitives, Error = BlockExecutionError>
where DB: Database { ... }
fn batch_executor<DB>(
&self,
db: DB,
) -> impl Executor<DB, Primitives = Self::Primitives, Error = BlockExecutionError>
where DB: Database { ... }
fn executor_for_block<'a, DB>(
&'a self,
db: DB,
block: &'a SealedBlock<<Self::Primitives as NodePrimitives>::Block>,
) -> Result<<Self::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>, Self::Error>
where Self: 'a,
DB: Database + 'a { ... }
fn evm_with_env<'a, DB>(
&self,
db: DB,
evm_env: <Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
) -> <Self::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>
where DB: Database + 'a { ... }
fn evm_for_block<'a, DB>(
&self,
db: DB,
header: &<Self::Primitives as NodePrimitives>::BlockHeader,
) -> Result<<Self::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>, Self::Error>
where DB: Database + 'a { ... }
fn create_block_builder<'a>(
&'a self,
evm: <Self::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>,
evm_env: <Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
parent: &'a SealedHeader<<Self::Primitives as NodePrimitives>::BlockHeader>,
ctx: <Self::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
) -> impl BlockBuilder<Primitives = Self::Primitives, Executor = <Self::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>>
where Self: 'a { ... }
fn create_block_builder_with<'a, E>(
&'a self,
evm: <Self::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>,
evm_env: <Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
parent: &'a SealedHeader<<Self::Primitives as NodePrimitives>::BlockHeader>,
ctx: <Self::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
f: impl FnOnce(<Self::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>) -> E,
) -> impl BlockBuilder<Primitives = Self::Primitives, Executor = E>
where Self: 'a,
E: BlockExecutor<Evm = <Self::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>, Transaction = <Self::Primitives as NodePrimitives>::SignedTx, Receipt = <Self::Primitives as NodePrimitives>::Receipt> { ... }
fn builder_for_next_block<'a, DB>(
&'a self,
db: DB,
parent: &'a SealedHeader<<Self::Primitives as NodePrimitives>::BlockHeader>,
attributes: Self::NextBlockEnvCtx,
) -> Result<impl BlockBuilder<Primitives = Self::Primitives, Executor = <Self::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>>, Self::Error>
where Self: 'a,
DB: Database + 'a { ... }
fn pre_block_state_changes<'a, DB>(
&'a self,
db: DB,
evm_env: <Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
ctx: <Self::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
) -> Result<BundleState, Box<dyn Error + Sync + Send>>
where Self: 'a,
DB: DynDatabase + 'a { ... }
fn reuses_prewarm_results(&self) -> bool { ... }
fn prewarm_tx_result<'a>(
&self,
tx: &<Self::Primitives as NodePrimitives>::SignedTx,
result: TxResultWithState<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes>,
) -> Option<<<Self::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a> as BlockExecutor>::TransactionResultWithState>
where Self: 'a { ... }
fn speculative_next_evm_env(
&self,
parent: &SealedHeader<<Self::Primitives as NodePrimitives>::BlockHeader>,
beneficiary: Address,
) -> Option<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv> { ... }
}Expand description
Traits and helper types used to abstract over EVM methods and types. A complete configuration of EVM for Reth.
This trait encapsulates complete configuration required for transaction execution and block execution/building, providing a unified interface for EVM operations.
§Architecture Overview
The EVM abstraction consists of the following layers:
-
Evm(created byBlockExecutorFactory::evm_with_env): The core EVM implementation responsible for executing individual transactions and producing outputs including state changes, logs, gas usage, etc. The factory that configures it isBlockExecutorFactory::EvmFactory. -
BlockExecutor(created byBlockExecutorFactory::create_executor): A higher-level component that operates on top ofEvmto execute entire blocks. This involves:- Executing all transactions in sequence
- Building receipts from transaction outputs
- Applying block rewards to the beneficiary
- Executing system calls (e.g., EIP-4788 beacon root updates)
- Managing state changes and bundle accumulation
-
BlockAssembler: Responsible for assembling valid blocks from executed transactions. It takes the output fromBlockExecutoralong with execution context and produces a complete block ready for inclusion in the chain.
§Usage Patterns
The abstraction supports two primary use cases:
§1. Executing Externally Provided Blocks (e.g., during sync)
use reth_evm::ConfigureEvm;
// Execute a received block
let mut executor = evm_config.executor(state_db);
let output = executor.execute(&block)?;
// Access the execution results
println!("Gas used: {}", output.result.gas_used);
println!("Receipts: {:?}", output.result.receipts);§2. Building New Blocks (e.g., payload building)
Payload building is slightly different as it doesn’t have the block’s header yet, but rather attributes for the block’s environment, such as timestamp, fee recipient, and randomness value. The block’s header will be the outcome of the block building process.
use reth_evm::{ConfigureEvm, NextBlockEnvAttributes};
// Create attributes for the next block
let attributes = NextBlockEnvAttributes {
timestamp: current_time + 12,
suggested_fee_recipient: beneficiary_address,
prev_randao: randomness_value,
gas_limit: 30_000_000,
withdrawals: Some(withdrawals),
parent_beacon_block_root: Some(beacon_root),
extra_data: Bytes::new(),
slot_number: None,
};
// Build a new block on top of parent
let mut builder = evm_config.builder_for_next_block(
state_db,
&parent_header,
attributes
)?;
// Apply pre-execution changes (e.g., beacon root update)
builder.apply_pre_execution_changes()?;
// Execute transactions
for tx in pending_transactions {
match builder.execute_transaction(tx) {
Ok(gas_output) => {
println!("Transaction executed, gas used: {}", gas_output.tx_gas_used());
}
Err(e) => {
println!("Transaction failed: {:?}", e);
}
}
}
// Finish block building and get the outcome (block)
let outcome = builder.finish(state_provider, None)?;
let block = outcome.block;§Key Components
§NextBlockEnvCtx
Contains attributes needed to configure the next block that cannot be derived from the parent block alone. This includes data typically provided by the consensus layer:
timestamp: Block timestampsuggested_fee_recipient: Beneficiary addressprev_randao: Randomness valuegas_limit: Block gas limitwithdrawals: Consensus layer withdrawalsparent_beacon_block_root: EIP-4788 beacon root
§BlockAssembler
Takes the execution output and produces a complete block. It receives:
- Transaction execution results (receipts, gas used)
- Final state root after all executions
- Bundle state with all changes
- Execution context and environment
The assembler is responsible for:
- Setting the correct block header fields
- Including executed transactions
- Setting gas used and receipts root
- Applying any chain-specific rules
Required Associated Types§
Sourcetype Primitives: NodePrimitives
type Primitives: NodePrimitives
The primitives type used by the EVM.
Sourcetype Error: Error + Send + Sync + 'static
type Error: Error + Send + Sync + 'static
The error type that is returned by Self::next_evm_env.
Sourcetype NextBlockEnvCtx: Debug + Clone
type NextBlockEnvCtx: Debug + Clone
Context required for configuring next block environment.
Contains values that can’t be derived from the parent block.
Sourcetype BlockExecutorFactory: BlockExecutorFactory<Transaction = <Self::Primitives as NodePrimitives>::SignedTx, Receipt = <Self::Primitives as NodePrimitives>::Receipt>
where
<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes: EvmTypes,
<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes as EvmTypesHost>::Tx: for<'a> FromTxWithEncoded<<Self::Primitives as NodePrimitives>::SignedTx> + for<'a> TransactionEnvMut
type BlockExecutorFactory: BlockExecutorFactory<Transaction = <Self::Primitives as NodePrimitives>::SignedTx, Receipt = <Self::Primitives as NodePrimitives>::Receipt> where <Self::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes: EvmTypes, <<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes as EvmTypesHost>::Tx: for<'a> FromTxWithEncoded<<Self::Primitives as NodePrimitives>::SignedTx> + for<'a> TransactionEnvMut
Configured BlockExecutorFactory, contains the EVM factory internally.
Sourcetype BlockAssembler: BlockAssembler<Self::BlockExecutorFactory, Block = <Self::Primitives as NodePrimitives>::Block>
Available on crate feature std only.
type BlockAssembler: BlockAssembler<Self::BlockExecutorFactory, Block = <Self::Primitives as NodePrimitives>::Block>
std only.A type that knows how to build a block.
Required Methods§
Sourcefn block_executor_factory(&self) -> &Self::BlockExecutorFactory
Available on crate feature std only.
fn block_executor_factory(&self) -> &Self::BlockExecutorFactory
std only.Returns reference to the configured BlockExecutorFactory.
Sourcefn block_assembler(&self) -> &Self::BlockAssembler
Available on crate feature std only.
fn block_assembler(&self) -> &Self::BlockAssembler
std only.Returns reference to the configured BlockAssembler.
Sourcefn evm_env(
&self,
header: &<Self::Primitives as NodePrimitives>::BlockHeader,
) -> Result<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv, Self::Error>
fn evm_env( &self, header: &<Self::Primitives as NodePrimitives>::BlockHeader, ) -> Result<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv, Self::Error>
Creates a new EvmEnv for the given header.
Sourcefn next_evm_env(
&self,
parent: &<Self::Primitives as NodePrimitives>::BlockHeader,
attributes: &Self::NextBlockEnvCtx,
) -> Result<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv, Self::Error>
fn next_evm_env( &self, parent: &<Self::Primitives as NodePrimitives>::BlockHeader, attributes: &Self::NextBlockEnvCtx, ) -> Result<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv, Self::Error>
Returns the configured EvmEnv for parent + 1 block.
This is intended for usage in block building after the merge and requires additional attributes that can’t be derived from the parent block: attributes that are determined by the CL, such as the timestamp, suggested fee recipient, and randomness value.
§Example
let evm_env = evm_config.next_evm_env(&parent_header, &attributes)?;
// evm_env now contains:
// - Correct spec ID based on timestamp and block number
// - Block environment with next block's parameters
// - Configuration like chain ID and blob parametersSourcefn context_for_block<'a>(
&self,
block: &'a SealedBlock<<Self::Primitives as NodePrimitives>::Block>,
) -> Result<<Self::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>, Self::Error>where
Self: 'a,
fn context_for_block<'a>(
&self,
block: &'a SealedBlock<<Self::Primitives as NodePrimitives>::Block>,
) -> Result<<Self::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>, Self::Error>where
Self: 'a,
Returns the configured BlockExecutorFactory::ExecutionCtx for a given block.
Sourcefn context_for_next_block(
&self,
parent: &SealedHeader<<Self::Primitives as NodePrimitives>::BlockHeader>,
attributes: Self::NextBlockEnvCtx,
) -> Result<<Self::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'_>, Self::Error>
fn context_for_next_block( &self, parent: &SealedHeader<<Self::Primitives as NodePrimitives>::BlockHeader>, attributes: Self::NextBlockEnvCtx, ) -> Result<<Self::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'_>, Self::Error>
Returns the configured BlockExecutorFactory::ExecutionCtx for parent + 1
block.
Provided Methods§
Sourcefn tx_env(
&self,
transaction: impl IntoTxEnv<Recovered<<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes as EvmTypesHost>::Tx>>,
) -> Recovered<<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes as EvmTypesHost>::Tx>
fn tx_env( &self, transaction: impl IntoTxEnv<Recovered<<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes as EvmTypesHost>::Tx>>, ) -> Recovered<<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes as EvmTypesHost>::Tx>
Returns a transaction environment from a transaction.
Sourcefn evm_factory(
&self,
) -> &<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory
Available on crate feature std only.
fn evm_factory( &self, ) -> &<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory
std only.Provides a reference to the configured EVM factory state.
Sourcefn with_jit_support_enabled(self, _enabled: bool) -> Selfwhere
Self: Sized,
fn with_jit_support_enabled(self, _enabled: bool) -> Selfwhere
Self: Sized,
Returns a config with JIT support enabled for subsequently created EVMs, if supported.
This is one of three gates required before an EVM can execute JIT-compiled code: the binary
must be built with the jit feature, runtime compilation must be enabled by --jit or the
reth_jit RPC method, and this local support flag must be enabled for the config that
creates the EVM.
Sourcefn with_jit_support(self) -> Selfwhere
Self: Sized,
fn with_jit_support(self) -> Selfwhere
Self: Sized,
Returns a config with local JIT support enabled for subsequently created EVMs, if supported.
Sourcefn evm_with_precompile_cache<'a, DB>(
&self,
db: DB,
evm_env: <Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
_cache_map: PrecompileCacheMap<<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes as EvmTypesHost>::SpecId>,
_metrics_enabled: bool,
) -> <Self::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>where
DB: Database + 'a,
Available on crate feature std only.
fn evm_with_precompile_cache<'a, DB>(
&self,
db: DB,
evm_env: <Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
_cache_map: PrecompileCacheMap<<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes as EvmTypesHost>::SpecId>,
_metrics_enabled: bool,
) -> <Self::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>where
DB: Database + 'a,
std only.Creates an EVM whose precompile results are cached in cache_map.
Only the engine calls this, for the EVMs it executes and prewarms blocks with. Configs that
do not support precompile caching create an uncached EVM. metrics_enabled selects whether
the cache records hit, miss, and size metrics.
Sourcefn jit_backend(&self) -> Option<&dyn JitBackend>
fn jit_backend(&self) -> Option<&dyn JitBackend>
Returns the JIT backend, if supported.
Sourcefn executor<DB>(
&self,
db: DB,
) -> impl Executor<DB, Primitives = Self::Primitives, Error = BlockExecutionError>where
DB: Database,
fn executor<DB>(
&self,
db: DB,
) -> impl Executor<DB, Primitives = Self::Primitives, Error = BlockExecutionError>where
DB: Database,
Returns a new Executor for executing blocks.
The executor processes complete blocks including:
- All transactions in order
- Block rewards and fees
- Block level system calls
- State transitions
§Example
// Create an executor
let mut executor = evm_config.executor(state_db);
// Execute a single block
let output = executor.execute(&block)?;
// Execute multiple blocks
let batch_output = executor.execute_batch(&blocks)?;Sourcefn batch_executor<DB>(
&self,
db: DB,
) -> impl Executor<DB, Primitives = Self::Primitives, Error = BlockExecutionError>where
DB: Database,
fn batch_executor<DB>(
&self,
db: DB,
) -> impl Executor<DB, Primitives = Self::Primitives, Error = BlockExecutionError>where
DB: Database,
Returns a new BasicBlockExecutor.
Sourcefn executor_for_block<'a, DB>(
&'a self,
db: DB,
block: &'a SealedBlock<<Self::Primitives as NodePrimitives>::Block>,
) -> Result<<Self::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>, Self::Error>where
Self: 'a,
DB: Database + 'a,
Available on crate feature std only.
fn executor_for_block<'a, DB>(
&'a self,
db: DB,
block: &'a SealedBlock<<Self::Primitives as NodePrimitives>::Block>,
) -> Result<<Self::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>, Self::Error>where
Self: 'a,
DB: Database + 'a,
std only.Creates a block executor for the given block.
Sourcefn evm_with_env<'a, DB>(
&self,
db: DB,
evm_env: <Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
) -> <Self::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>where
DB: Database + 'a,
Available on crate feature std only.
fn evm_with_env<'a, DB>(
&self,
db: DB,
evm_env: <Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
) -> <Self::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>where
DB: Database + 'a,
std only.Creates an EVM instance for single-transaction execution with the configured environment.
Sourcefn evm_for_block<'a, DB>(
&self,
db: DB,
header: &<Self::Primitives as NodePrimitives>::BlockHeader,
) -> Result<<Self::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>, Self::Error>where
DB: Database + 'a,
Available on crate feature std only.
fn evm_for_block<'a, DB>(
&self,
db: DB,
header: &<Self::Primitives as NodePrimitives>::BlockHeader,
) -> Result<<Self::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>, Self::Error>where
DB: Database + 'a,
std only.Creates an EVM instance for the given block.
Sourcefn create_block_builder<'a>(
&'a self,
evm: <Self::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>,
evm_env: <Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
parent: &'a SealedHeader<<Self::Primitives as NodePrimitives>::BlockHeader>,
ctx: <Self::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
) -> impl BlockBuilder<Primitives = Self::Primitives, Executor = <Self::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>>where
Self: 'a,
Available on crate feature std only.
fn create_block_builder<'a>(
&'a self,
evm: <Self::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>,
evm_env: <Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
parent: &'a SealedHeader<<Self::Primitives as NodePrimitives>::BlockHeader>,
ctx: <Self::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
) -> impl BlockBuilder<Primitives = Self::Primitives, Executor = <Self::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>>where
Self: 'a,
std only.Creates a BlockBuilder. Should be used when building a new block.
Block builder wraps an inner BlockExecutor and has a similar interface. Builder
collects all of the executed transactions, and once BlockBuilder::finish is called, it
invokes the configured BlockAssembler to create a block.
§Example
// Create a builder with specific EVM configuration
let evm = evm_config.evm_with_env(state_db, evm_env.clone());
let ctx = evm_config.context_for_next_block(&parent, attributes);
let builder = evm_config.create_block_builder(evm, evm_env, &parent, ctx);Sourcefn create_block_builder_with<'a, E>(
&'a self,
evm: <Self::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>,
evm_env: <Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
parent: &'a SealedHeader<<Self::Primitives as NodePrimitives>::BlockHeader>,
ctx: <Self::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
f: impl FnOnce(<Self::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>) -> E,
) -> impl BlockBuilder<Primitives = Self::Primitives, Executor = E>where
Self: 'a,
E: BlockExecutor<Evm = <Self::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>, Transaction = <Self::Primitives as NodePrimitives>::SignedTx, Receipt = <Self::Primitives as NodePrimitives>::Receipt>,
Available on crate feature std only.
fn create_block_builder_with<'a, E>(
&'a self,
evm: <Self::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>,
evm_env: <Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
parent: &'a SealedHeader<<Self::Primitives as NodePrimitives>::BlockHeader>,
ctx: <Self::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
f: impl FnOnce(<Self::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>) -> E,
) -> impl BlockBuilder<Primitives = Self::Primitives, Executor = E>where
Self: 'a,
E: BlockExecutor<Evm = <Self::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>, Transaction = <Self::Primitives as NodePrimitives>::SignedTx, Receipt = <Self::Primitives as NodePrimitives>::Receipt>,
std only.Creates a BlockBuilder like ConfigureEvm::create_block_builder, with a customized
executor.
Sourcefn builder_for_next_block<'a, DB>(
&'a self,
db: DB,
parent: &'a SealedHeader<<Self::Primitives as NodePrimitives>::BlockHeader>,
attributes: Self::NextBlockEnvCtx,
) -> Result<impl BlockBuilder<Primitives = Self::Primitives, Executor = <Self::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>>, Self::Error>where
Self: 'a,
DB: Database + 'a,
Available on crate feature std only.
fn builder_for_next_block<'a, DB>(
&'a self,
db: DB,
parent: &'a SealedHeader<<Self::Primitives as NodePrimitives>::BlockHeader>,
attributes: Self::NextBlockEnvCtx,
) -> Result<impl BlockBuilder<Primitives = Self::Primitives, Executor = <Self::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>>, Self::Error>where
Self: 'a,
DB: Database + 'a,
std only.Creates a BlockBuilder for building of a new block. This is a helper to invoke
ConfigureEvm::create_block_builder.
This is the primary method for building new blocks. It combines:
- Creating the EVM environment for the next block
- Setting up the execution context from attributes
- Initializing the block builder with proper configuration
§Example
// Build a block with specific attributes
let mut builder = evm_config.builder_for_next_block(
state_db,
&parent_header,
attributes
)?;
// Execute system calls (e.g., beacon root update)
builder.apply_pre_execution_changes()?;
// Execute transactions
for tx in transactions {
builder.execute_transaction(tx)?;
}
// Complete block building
let outcome = builder.finish(state_provider, None)?;Sourcefn pre_block_state_changes<'a, DB>(
&'a self,
db: DB,
evm_env: <Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
ctx: <Self::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
) -> Result<BundleState, Box<dyn Error + Sync + Send>>where
Self: 'a,
DB: DynDatabase + 'a,
Available on crate feature std only.
fn pre_block_state_changes<'a, DB>(
&'a self,
db: DB,
evm_env: <Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
ctx: <Self::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
) -> Result<BundleState, Box<dyn Error + Sync + Send>>where
Self: 'a,
DB: DynDatabase + 'a,
std only.Applies block-level state changes required before transaction execution using the configured block executor.
Sourcefn reuses_prewarm_results(&self) -> bool
fn reuses_prewarm_results(&self) -> bool
Returns whether engine validation may commit transaction results from speculative prewarm execution instead of executing the transactions again.
Return true only if all of these hold, see also Self::prewarm_tx_result:
- the block executor executes a transaction by checking that its gas limit, capped by the
transaction gas limit cap, fits into the block gas limit minus the last receipt’s
cumulative gas used, and then running
Evm::transactwith the transaction environment; Evm::transactperforms the standard caller nonce and balance validation; speculative results additionally reject the largest nonce before reuse;- EVMs created by this configuration with JIT support disabled call inspector hooks for every executed instruction;
- execution depends only on recorded database reads and the transaction and block environments reproduced during prewarming, with no unrecorded external state.
Sourcefn prewarm_tx_result<'a>(
&self,
tx: &<Self::Primitives as NodePrimitives>::SignedTx,
result: TxResultWithState<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes>,
) -> Option<<<Self::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a> as BlockExecutor>::TransactionResultWithState>where
Self: 'a,
Available on crate feature std only.
fn prewarm_tx_result<'a>(
&self,
tx: &<Self::Primitives as NodePrimitives>::SignedTx,
result: TxResultWithState<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes>,
) -> Option<<<Self::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a> as BlockExecutor>::TransactionResultWithState>where
Self: 'a,
std only.Wraps a speculative prewarm execution result of tx into the result consumed by
BlockExecutor::commit_transaction.
Only called if Self::reuses_prewarm_results returns true.
Returning None rejects and consumes this speculative result; the engine executes the
transaction normally instead.
Sourcefn speculative_next_evm_env(
&self,
parent: &SealedHeader<<Self::Primitives as NodePrimitives>::BlockHeader>,
beneficiary: Address,
) -> Option<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv>
fn speculative_next_evm_env( &self, parent: &SealedHeader<<Self::Primitives as NodePrimitives>::BlockHeader>, beneficiary: Address, ) -> Option<<Self::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv>
Returns the predicted environment of the block after parent with beneficiary, in which
engine validation speculatively executes pool transactions before the block arrives.
Validation reuses such results only for blocks whose environment matches the predicted
one, apart from the beneficiary, timestamp, prevrandao and gas limit, which the
transactions must not have observed. Only called if Self::reuses_prewarm_results
returns true. Returns None if the environment cannot be predicted, which disables
recording pool transaction results. Custom block environment extensions must remain
identical to canonical execution; the engine compares only standard environment fields.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<'b, T> ConfigureEvm for &'b T
impl<'b, T> ConfigureEvm for &'b T
type Primitives = <T as ConfigureEvm>::Primitives
type Error = <T as ConfigureEvm>::Error
type NextBlockEnvCtx = <T as ConfigureEvm>::NextBlockEnvCtx
type BlockExecutorFactory = <T as ConfigureEvm>::BlockExecutorFactory
Source§type BlockAssembler = <T as ConfigureEvm>::BlockAssembler
type BlockAssembler = <T as ConfigureEvm>::BlockAssembler
std only.Source§fn block_executor_factory(
&self,
) -> &<&'b T as ConfigureEvm>::BlockExecutorFactory
fn block_executor_factory( &self, ) -> &<&'b T as ConfigureEvm>::BlockExecutorFactory
std only.Source§fn block_assembler(&self) -> &<&'b T as ConfigureEvm>::BlockAssembler
fn block_assembler(&self) -> &<&'b T as ConfigureEvm>::BlockAssembler
std only.fn evm_env( &self, header: &<<&'b T as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader, ) -> Result<<<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv, <&'b T as ConfigureEvm>::Error>
fn next_evm_env( &self, parent: &<<&'b T as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader, attributes: &<&'b T as ConfigureEvm>::NextBlockEnvCtx, ) -> Result<<<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv, <&'b T as ConfigureEvm>::Error>
fn context_for_block<'a>(
&self,
block: &'a SealedBlock<<<&'b T as ConfigureEvm>::Primitives as NodePrimitives>::Block>,
) -> Result<<<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>, <&'b T as ConfigureEvm>::Error>where
&'b T: 'a,
fn context_for_next_block( &self, parent: &SealedHeader<<<&'b T as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader>, attributes: <&'b T as ConfigureEvm>::NextBlockEnvCtx, ) -> Result<<<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'_>, <&'b T as ConfigureEvm>::Error>
fn tx_env( &self, transaction: impl IntoTxEnv<Recovered<<<<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes as EvmTypesHost>::Tx>>, ) -> Recovered<<<<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes as EvmTypesHost>::Tx>
Source§fn evm_factory(
&self,
) -> &<<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory
fn evm_factory( &self, ) -> &<<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory
std only.Source§fn evm_with_precompile_cache<'a, DB>(
&self,
db: DB,
evm_env: <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
_cache_map: PrecompileCacheMap<<<<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes as EvmTypesHost>::SpecId>,
_metrics_enabled: bool,
) -> <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>where
DB: Database + 'a,
fn evm_with_precompile_cache<'a, DB>(
&self,
db: DB,
evm_env: <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
_cache_map: PrecompileCacheMap<<<<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes as EvmTypesHost>::SpecId>,
_metrics_enabled: bool,
) -> <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>where
DB: Database + 'a,
std only.fn jit_backend(&self) -> Option<&dyn JitBackend>
Source§fn executor_for_block<'a, DB>(
&'a self,
db: DB,
block: &'a SealedBlock<<<&'b T as ConfigureEvm>::Primitives as NodePrimitives>::Block>,
) -> Result<<<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>, <&'b T as ConfigureEvm>::Error>where
&'b T: 'a,
DB: Database + 'a,
fn executor_for_block<'a, DB>(
&'a self,
db: DB,
block: &'a SealedBlock<<<&'b T as ConfigureEvm>::Primitives as NodePrimitives>::Block>,
) -> Result<<<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>, <&'b T as ConfigureEvm>::Error>where
&'b T: 'a,
DB: Database + 'a,
std only.Source§fn evm_for_block<'a, DB>(
&self,
db: DB,
header: &<<&'b T as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader,
) -> Result<<<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>, <&'b T as ConfigureEvm>::Error>where
DB: Database + 'a,
fn evm_for_block<'a, DB>(
&self,
db: DB,
header: &<<&'b T as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader,
) -> Result<<<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>, <&'b T as ConfigureEvm>::Error>where
DB: Database + 'a,
std only.Source§fn create_block_builder<'a>(
&'a self,
evm: <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>,
evm_env: <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
parent: &'a SealedHeader<<<&'b T as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader>,
ctx: <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
) -> impl BlockBuilder<Primitives = <&'b T as ConfigureEvm>::Primitives, Executor = <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>>where
&'b T: 'a,
fn create_block_builder<'a>(
&'a self,
evm: <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>,
evm_env: <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
parent: &'a SealedHeader<<<&'b T as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader>,
ctx: <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
) -> impl BlockBuilder<Primitives = <&'b T as ConfigureEvm>::Primitives, Executor = <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>>where
&'b T: 'a,
std only.Source§fn create_block_builder_with<'a, E>(
&'a self,
evm: <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>,
evm_env: <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
parent: &'a SealedHeader<<<&'b T as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader>,
ctx: <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
f: impl FnOnce(<<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>) -> E,
) -> impl BlockBuilder<Primitives = <&'b T as ConfigureEvm>::Primitives, Executor = E>where
&'b T: 'a,
E: BlockExecutor<Evm = <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>, Transaction = <<&'b T as ConfigureEvm>::Primitives as NodePrimitives>::SignedTx, Receipt = <<&'b T as ConfigureEvm>::Primitives as NodePrimitives>::Receipt>,
fn create_block_builder_with<'a, E>(
&'a self,
evm: <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>,
evm_env: <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
parent: &'a SealedHeader<<<&'b T as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader>,
ctx: <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
f: impl FnOnce(<<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>) -> E,
) -> impl BlockBuilder<Primitives = <&'b T as ConfigureEvm>::Primitives, Executor = E>where
&'b T: 'a,
E: BlockExecutor<Evm = <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>, Transaction = <<&'b T as ConfigureEvm>::Primitives as NodePrimitives>::SignedTx, Receipt = <<&'b T as ConfigureEvm>::Primitives as NodePrimitives>::Receipt>,
std only.Source§fn builder_for_next_block<'a, DB>(
&'a self,
db: DB,
parent: &'a SealedHeader<<<&'b T as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader>,
attributes: <&'b T as ConfigureEvm>::NextBlockEnvCtx,
) -> Result<impl BlockBuilder<Primitives = <&'b T as ConfigureEvm>::Primitives, Executor = <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>>, <&'b T as ConfigureEvm>::Error>where
&'b T: 'a,
DB: Database + 'a,
fn builder_for_next_block<'a, DB>(
&'a self,
db: DB,
parent: &'a SealedHeader<<<&'b T as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader>,
attributes: <&'b T as ConfigureEvm>::NextBlockEnvCtx,
) -> Result<impl BlockBuilder<Primitives = <&'b T as ConfigureEvm>::Primitives, Executor = <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>>, <&'b T as ConfigureEvm>::Error>where
&'b T: 'a,
DB: Database + 'a,
std only.Source§fn pre_block_state_changes<'a, DB>(
&'a self,
db: DB,
evm_env: <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
ctx: <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
) -> Result<BundleState, Box<dyn Error + Sync + Send>>where
&'b T: 'a,
DB: DynDatabase + 'a,
fn pre_block_state_changes<'a, DB>(
&'a self,
db: DB,
evm_env: <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
ctx: <<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
) -> Result<BundleState, Box<dyn Error + Sync + Send>>where
&'b T: 'a,
DB: DynDatabase + 'a,
std only.fn reuses_prewarm_results(&self) -> bool
Source§fn prewarm_tx_result<'a>(
&self,
tx: &<<&'b T as ConfigureEvm>::Primitives as NodePrimitives>::SignedTx,
result: TxResultWithState<<<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes>,
) -> Option<<<<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a> as BlockExecutor>::TransactionResultWithState>where
&'b T: 'a,
fn prewarm_tx_result<'a>(
&self,
tx: &<<&'b T as ConfigureEvm>::Primitives as NodePrimitives>::SignedTx,
result: TxResultWithState<<<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes>,
) -> Option<<<<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a> as BlockExecutor>::TransactionResultWithState>where
&'b T: 'a,
std only.fn speculative_next_evm_env( &self, parent: &SealedHeader<<<&'b T as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader>, beneficiary: Address, ) -> Option<<<&'b T as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv>
Source§impl<ChainSpec, EvmF> ConfigureEvm for EthEvmConfig<ChainSpec, EvmF>where
ChainSpec: EthChainSpec<Header = Header> + EthereumHardforks + Hardforks + 'static,
EvmF: EvmFactory,
<<EvmF as EvmFactory>::Types as EvmTypesHost>::Tx: Typed2718 + FromTxWithEncoded<EthereumTxEnvelope<TxEip4844>> + TransactionEnvMut,
impl<ChainSpec, EvmF> ConfigureEvm for EthEvmConfig<ChainSpec, EvmF>where
ChainSpec: EthChainSpec<Header = Header> + EthereumHardforks + Hardforks + 'static,
EvmF: EvmFactory,
<<EvmF as EvmFactory>::Types as EvmTypesHost>::Tx: Typed2718 + FromTxWithEncoded<EthereumTxEnvelope<TxEip4844>> + TransactionEnvMut,
type Primitives = EthPrimitives
type Error = !
type NextBlockEnvCtx = NextBlockEnvAttributes
type BlockExecutorFactory = EthBlockExecutorFactory<RethReceiptBuilder, ChainSpec, EvmF>
Source§type BlockAssembler = EthBlockAssembler<ChainSpec>
type BlockAssembler = EthBlockAssembler<ChainSpec>
std only.Source§fn block_executor_factory(
&self,
) -> &<EthEvmConfig<ChainSpec, EvmF> as ConfigureEvm>::BlockExecutorFactory
fn block_executor_factory( &self, ) -> &<EthEvmConfig<ChainSpec, EvmF> as ConfigureEvm>::BlockExecutorFactory
std only.Source§fn block_assembler(
&self,
) -> &<EthEvmConfig<ChainSpec, EvmF> as ConfigureEvm>::BlockAssembler
fn block_assembler( &self, ) -> &<EthEvmConfig<ChainSpec, EvmF> as ConfigureEvm>::BlockAssembler
std only.fn with_jit_support_enabled(
self,
enabled: bool,
) -> EthEvmConfig<ChainSpec, EvmF>where
EthEvmConfig<ChainSpec, EvmF>: Sized,
Source§fn evm_with_precompile_cache<'a, DB>(
&self,
db: DB,
evm_env: <<EthEvmConfig<ChainSpec, EvmF> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
cache_map: PrecompileCacheMap<<<<EthEvmConfig<ChainSpec, EvmF> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes as EvmTypesHost>::SpecId>,
metrics_enabled: bool,
) -> <<EthEvmConfig<ChainSpec, EvmF> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>where
DB: Database + 'a,
fn evm_with_precompile_cache<'a, DB>(
&self,
db: DB,
evm_env: <<EthEvmConfig<ChainSpec, EvmF> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
cache_map: PrecompileCacheMap<<<<EthEvmConfig<ChainSpec, EvmF> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes as EvmTypesHost>::SpecId>,
metrics_enabled: bool,
) -> <<EthEvmConfig<ChainSpec, EvmF> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>where
DB: Database + 'a,
std only.fn jit_backend(&self) -> Option<&dyn JitBackend>
fn evm_env( &self, header: &Header, ) -> Result<<<EthEvmConfig<ChainSpec, EvmF> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv, <EthEvmConfig<ChainSpec, EvmF> as ConfigureEvm>::Error>
fn next_evm_env( &self, parent: &Header, attributes: &NextBlockEnvAttributes, ) -> Result<<<EthEvmConfig<ChainSpec, EvmF> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv, <EthEvmConfig<ChainSpec, EvmF> as ConfigureEvm>::Error>
fn context_for_block<'a>(
&self,
block: &'a SealedBlock<Block<EthereumTxEnvelope<TxEip4844>>>,
) -> Result<EthBlockExecutionCtx<'a>, <EthEvmConfig<ChainSpec, EvmF> as ConfigureEvm>::Error>where
EthEvmConfig<ChainSpec, EvmF>: 'a,
fn context_for_next_block( &self, parent: &SealedHeader, attributes: <EthEvmConfig<ChainSpec, EvmF> as ConfigureEvm>::NextBlockEnvCtx, ) -> Result<EthBlockExecutionCtx<'_>, <EthEvmConfig<ChainSpec, EvmF> as ConfigureEvm>::Error>
fn reuses_prewarm_results(&self) -> bool
Source§fn prewarm_tx_result<'a>(
&self,
tx: &EthereumTxEnvelope<TxEip4844>,
result: TxResultWithState<<<EthEvmConfig<ChainSpec, EvmF> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes>,
) -> Option<<<<EthEvmConfig<ChainSpec, EvmF> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a> as BlockExecutor>::TransactionResultWithState>where
EthEvmConfig<ChainSpec, EvmF>: 'a,
fn prewarm_tx_result<'a>(
&self,
tx: &EthereumTxEnvelope<TxEip4844>,
result: TxResultWithState<<<EthEvmConfig<ChainSpec, EvmF> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes>,
) -> Option<<<<EthEvmConfig<ChainSpec, EvmF> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a> as BlockExecutor>::TransactionResultWithState>where
EthEvmConfig<ChainSpec, EvmF>: 'a,
std only.fn speculative_next_evm_env( &self, parent: &SealedHeader, beneficiary: Address, ) -> Option<<<EthEvmConfig<ChainSpec, EvmF> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv>
Source§impl<T> ConfigureEvm for Arc<T>
impl<T> ConfigureEvm for Arc<T>
type Primitives = <T as ConfigureEvm>::Primitives
type Error = <T as ConfigureEvm>::Error
type NextBlockEnvCtx = <T as ConfigureEvm>::NextBlockEnvCtx
type BlockExecutorFactory = <T as ConfigureEvm>::BlockExecutorFactory
Source§type BlockAssembler = <T as ConfigureEvm>::BlockAssembler
type BlockAssembler = <T as ConfigureEvm>::BlockAssembler
std only.Source§fn block_executor_factory(
&self,
) -> &<Arc<T> as ConfigureEvm>::BlockExecutorFactory ⓘ
fn block_executor_factory( &self, ) -> &<Arc<T> as ConfigureEvm>::BlockExecutorFactory ⓘ
std only.Source§fn block_assembler(&self) -> &<Arc<T> as ConfigureEvm>::BlockAssembler ⓘ
fn block_assembler(&self) -> &<Arc<T> as ConfigureEvm>::BlockAssembler ⓘ
std only.fn evm_env( &self, header: &<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader, ) -> Result<<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv, <Arc<T> as ConfigureEvm>::Error>
fn next_evm_env( &self, parent: &<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader, attributes: &<Arc<T> as ConfigureEvm>::NextBlockEnvCtx, ) -> Result<<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv, <Arc<T> as ConfigureEvm>::Error>
fn context_for_block<'a>(
&self,
block: &'a SealedBlock<<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::Block>,
) -> Result<<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>, <Arc<T> as ConfigureEvm>::Error>where
Arc<T>: 'a,
fn context_for_next_block( &self, parent: &SealedHeader<<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader>, attributes: <Arc<T> as ConfigureEvm>::NextBlockEnvCtx, ) -> Result<<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'_>, <Arc<T> as ConfigureEvm>::Error>
fn tx_env( &self, transaction: impl IntoTxEnv<Recovered<<<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes as EvmTypesHost>::Tx>>, ) -> Recovered<<<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes as EvmTypesHost>::Tx>
Source§fn evm_factory(
&self,
) -> &<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory ⓘ
fn evm_factory( &self, ) -> &<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory ⓘ
std only.Source§fn evm_with_precompile_cache<'a, DB>(
&self,
db: DB,
evm_env: <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
_cache_map: PrecompileCacheMap<<<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes as EvmTypesHost>::SpecId>,
_metrics_enabled: bool,
) -> <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a> ⓘwhere
DB: Database + 'a,
fn evm_with_precompile_cache<'a, DB>(
&self,
db: DB,
evm_env: <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
_cache_map: PrecompileCacheMap<<<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes as EvmTypesHost>::SpecId>,
_metrics_enabled: bool,
) -> <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a> ⓘwhere
DB: Database + 'a,
std only.fn jit_backend(&self) -> Option<&dyn JitBackend>
Source§fn executor_for_block<'a, DB>(
&'a self,
db: DB,
block: &'a SealedBlock<<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::Block>,
) -> Result<<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>, <Arc<T> as ConfigureEvm>::Error>where
Arc<T>: 'a,
DB: Database + 'a,
fn executor_for_block<'a, DB>(
&'a self,
db: DB,
block: &'a SealedBlock<<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::Block>,
) -> Result<<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>, <Arc<T> as ConfigureEvm>::Error>where
Arc<T>: 'a,
DB: Database + 'a,
std only.Source§fn evm_for_block<'a, DB>(
&self,
db: DB,
header: &<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader,
) -> Result<<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>, <Arc<T> as ConfigureEvm>::Error>where
DB: Database + 'a,
fn evm_for_block<'a, DB>(
&self,
db: DB,
header: &<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader,
) -> Result<<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>, <Arc<T> as ConfigureEvm>::Error>where
DB: Database + 'a,
std only.Source§fn create_block_builder<'a>(
&'a self,
evm: <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>,
evm_env: <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
parent: &'a SealedHeader<<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader>,
ctx: <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
) -> impl BlockBuilder<Primitives = <Arc<T> as ConfigureEvm>::Primitives, Executor = <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>>where
Arc<T>: 'a,
fn create_block_builder<'a>(
&'a self,
evm: <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>,
evm_env: <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
parent: &'a SealedHeader<<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader>,
ctx: <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
) -> impl BlockBuilder<Primitives = <Arc<T> as ConfigureEvm>::Primitives, Executor = <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>>where
Arc<T>: 'a,
std only.Source§fn create_block_builder_with<'a, E>(
&'a self,
evm: <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>,
evm_env: <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
parent: &'a SealedHeader<<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader>,
ctx: <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
f: impl FnOnce(<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>) -> E,
) -> impl BlockBuilder<Primitives = <Arc<T> as ConfigureEvm>::Primitives, Executor = E>where
Arc<T>: 'a,
E: BlockExecutor<Evm = <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>, Transaction = <<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::SignedTx, Receipt = <<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::Receipt>,
fn create_block_builder_with<'a, E>(
&'a self,
evm: <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>,
evm_env: <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
parent: &'a SealedHeader<<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader>,
ctx: <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
f: impl FnOnce(<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>) -> E,
) -> impl BlockBuilder<Primitives = <Arc<T> as ConfigureEvm>::Primitives, Executor = E>where
Arc<T>: 'a,
E: BlockExecutor<Evm = <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Evm<'a>, Transaction = <<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::SignedTx, Receipt = <<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::Receipt>,
std only.Source§fn builder_for_next_block<'a, DB>(
&'a self,
db: DB,
parent: &'a SealedHeader<<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader>,
attributes: <Arc<T> as ConfigureEvm>::NextBlockEnvCtx,
) -> Result<impl BlockBuilder<Primitives = <Arc<T> as ConfigureEvm>::Primitives, Executor = <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>>, <Arc<T> as ConfigureEvm>::Error>where
Arc<T>: 'a,
DB: Database + 'a,
fn builder_for_next_block<'a, DB>(
&'a self,
db: DB,
parent: &'a SealedHeader<<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader>,
attributes: <Arc<T> as ConfigureEvm>::NextBlockEnvCtx,
) -> Result<impl BlockBuilder<Primitives = <Arc<T> as ConfigureEvm>::Primitives, Executor = <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a>>, <Arc<T> as ConfigureEvm>::Error>where
Arc<T>: 'a,
DB: Database + 'a,
std only.Source§fn pre_block_state_changes<'a, DB>(
&'a self,
db: DB,
evm_env: <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
ctx: <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
) -> Result<BundleState, Box<dyn Error + Sync + Send>>where
Arc<T>: 'a,
DB: DynDatabase + 'a,
fn pre_block_state_changes<'a, DB>(
&'a self,
db: DB,
evm_env: <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
ctx: <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
) -> Result<BundleState, Box<dyn Error + Sync + Send>>where
Arc<T>: 'a,
DB: DynDatabase + 'a,
std only.fn reuses_prewarm_results(&self) -> bool
Source§fn prewarm_tx_result<'a>(
&self,
tx: &<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::SignedTx,
result: TxResultWithState<<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes>,
) -> Option<<<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a> as BlockExecutor>::TransactionResultWithState>where
Arc<T>: 'a,
fn prewarm_tx_result<'a>(
&self,
tx: &<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::SignedTx,
result: TxResultWithState<<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmTypes>,
) -> Option<<<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::Executor<'a> as BlockExecutor>::TransactionResultWithState>where
Arc<T>: 'a,
std only.