reth::builder

Trait ConfigureEvm

pub trait ConfigureEvm: ConfigureEvmEnv {
    type Evm<'a, DB: Database + 'a, I: 'a>: Evm<Tx = TxEnv, DB = DB, Error = EVMError<<DB as Database>::Error>>;

    // Required methods
    fn evm_with_env<DB>(
        &self,
        db: DB,
        evm_env: EvmEnv,
        tx: TxEnv,
    ) -> Self::Evm<'_, DB, ()>
       where DB: Database;
    fn evm_with_env_and_inspector<DB, I>(
        &self,
        db: DB,
        evm_env: EvmEnv,
        tx: TxEnv,
        inspector: I,
    ) -> Self::Evm<'_, DB, I>
       where DB: Database,
             I: GetInspector<DB>;

    // Provided method
    fn evm_for_block<DB>(
        &self,
        db: DB,
        header: &Self::Header,
    ) -> Self::Evm<'_, DB, ()>
       where DB: Database { ... }
}
Expand description

Trait for configuring the EVM for executing full blocks.

Required Associated Types§

type Evm<'a, DB: Database + 'a, I: 'a>: Evm<Tx = TxEnv, DB = DB, Error = EVMError<<DB as Database>::Error>>

The EVM implementation.

Required Methods§

fn evm_with_env<DB>( &self, db: DB, evm_env: EvmEnv, tx: TxEnv, ) -> Self::Evm<'_, DB, ()>
where DB: Database,

Returns a new EVM with the given database configured with the given environment settings, including the spec id and transaction environment.

This will preserve any handler modifications

fn evm_with_env_and_inspector<DB, I>( &self, db: DB, evm_env: EvmEnv, tx: TxEnv, inspector: I, ) -> Self::Evm<'_, DB, I>
where DB: Database, I: GetInspector<DB>,

Returns a new EVM with the given database configured with the given environment settings, including the spec id.

This will use the given external inspector as the EVM external context.

This will preserve any handler modifications

Provided Methods§

fn evm_for_block<DB>( &self, db: DB, header: &Self::Header, ) -> Self::Evm<'_, DB, ()>
where DB: Database,

Returns a new EVM with the given database configured with cfg and block_env configuration derived from the given header. Relies on ConfigureEvmEnv::cfg_and_block_env.

§Caution

This does not initialize the tx environment.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl ConfigureEvm for EthEvmConfig

§

type Evm<'a, DB: Database + 'a, I: 'a> = EthEvm<'a, I, DB>

§

fn evm_with_env<DB>( &self, db: DB, evm_env: EvmEnv, tx: TxEnv, ) -> <EthEvmConfig as ConfigureEvm>::Evm<'_, DB, ()>
where DB: Database,

§

fn evm_with_env_and_inspector<DB, I>( &self, db: DB, evm_env: EvmEnv, tx: TxEnv, inspector: I, ) -> <EthEvmConfig as ConfigureEvm>::Evm<'_, DB, I>
where DB: Database, I: GetInspector<DB>,

§

impl<'b, T> ConfigureEvm for &'b T

§

type Evm<'a, DB: Database + 'a, I: 'a> = <T as ConfigureEvm>::Evm<'a, DB, I>

§

fn evm_for_block<DB>( &self, db: DB, header: &<&'b T as ConfigureEvmEnv>::Header, ) -> <&'b T as ConfigureEvm>::Evm<'_, DB, ()>
where DB: Database,

§

fn evm_with_env<DB>( &self, db: DB, evm_env: EvmEnv, tx: TxEnv, ) -> <&'b T as ConfigureEvm>::Evm<'_, DB, ()>
where DB: Database,

§

fn evm_with_env_and_inspector<DB, I>( &self, db: DB, evm_env: EvmEnv, tx_env: TxEnv, inspector: I, ) -> <&'b T as ConfigureEvm>::Evm<'_, DB, I>
where DB: Database, I: GetInspector<DB>,

Implementors§