reth::api

Trait ConfigureEvm

pub trait ConfigureEvm: ConfigureEvmEnv {
    type DefaultExternalContext<'a>;

    // Required method
    fn default_external_context<'a>(&self) -> Self::DefaultExternalContext<'a>;

    // Provided methods
    fn evm<DB>(&self, db: DB) -> Evm<'_, Self::DefaultExternalContext<'_>, DB>
       where DB: Database { ... }
    fn evm_with_env<DB>(
        &self,
        db: DB,
        env: EnvWithHandlerCfg,
    ) -> Evm<'_, Self::DefaultExternalContext<'_>, DB>
       where DB: Database { ... }
    fn evm_with_env_and_inspector<DB, I>(
        &self,
        db: DB,
        env: EnvWithHandlerCfg,
        inspector: I,
    ) -> Evm<'_, I, DB>
       where DB: Database,
             I: GetInspector<DB> { ... }
    fn evm_with_inspector<DB, I>(&self, db: DB, inspector: I) -> Evm<'_, I, DB>
       where DB: Database,
             I: GetInspector<DB> { ... }
}
Expand description

Trait for configuring the EVM for executing full blocks.

Required Associated Types§

type DefaultExternalContext<'a>

Associated type for the default external context that should be configured for the EVM.

Required Methods§

fn default_external_context<'a>(&self) -> Self::DefaultExternalContext<'a>

Provides the default external context.

Provided Methods§

fn evm<DB>(&self, db: DB) -> Evm<'_, Self::DefaultExternalContext<'_>, DB>
where DB: Database,

Returns new EVM with the given database

This does not automatically configure the EVM with ConfigureEvmEnv methods. It is up to the caller to call an appropriate method to fill the transaction and block environment before executing any transactions using the provided EVM.

fn evm_with_env<DB>( &self, db: DB, env: EnvWithHandlerCfg, ) -> Evm<'_, Self::DefaultExternalContext<'_>, DB>
where DB: Database,

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

This will preserve any handler modifications

fn evm_with_env_and_inspector<DB, I>( &self, db: DB, env: EnvWithHandlerCfg, inspector: I, ) -> Evm<'_, I, DB>
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

fn evm_with_inspector<DB, I>(&self, db: DB, inspector: I) -> Evm<'_, I, DB>
where DB: Database, I: GetInspector<DB>,

Returns a new EVM with the given inspector.

Caution: This does not automatically configure the EVM with ConfigureEvmEnv methods. It is up to the caller to call an appropriate method to fill the transaction and block environment before executing any transactions using the provided EVM.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl ConfigureEvm for EthEvmConfig

§

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

§

type DefaultExternalContext<'a> = <T as ConfigureEvm>::DefaultExternalContext<'a>

§

fn evm<DB>( &self, db: DB, ) -> Evm<'_, <&'b T as ConfigureEvm>::DefaultExternalContext<'_>, DB>
where DB: Database,

§

fn evm_with_env<DB>( &self, db: DB, env: EnvWithHandlerCfg, ) -> Evm<'_, <&'b T as ConfigureEvm>::DefaultExternalContext<'_>, DB>
where DB: Database,

§

fn evm_with_env_and_inspector<DB, I>( &self, db: DB, env: EnvWithHandlerCfg, inspector: I, ) -> Evm<'_, I, DB>
where DB: Database, I: GetInspector<DB>,

§

fn evm_with_inspector<DB, I>(&self, db: DB, inspector: I) -> Evm<'_, I, DB>
where DB: Database, I: GetInspector<DB>,

§

fn default_external_context<'a>( &self, ) -> <&'b T as ConfigureEvm>::DefaultExternalContext<'a>

§

impl<T> ConfigureEvm for Arc<T>

§

type DefaultExternalContext<'a> = <T as ConfigureEvm>::DefaultExternalContext<'a>

§

fn evm<DB>( &self, db: DB, ) -> Evm<'_, <Arc<T> as ConfigureEvm>::DefaultExternalContext<'_>, DB>
where DB: Database,

§

fn evm_with_env<DB>( &self, db: DB, env: EnvWithHandlerCfg, ) -> Evm<'_, <Arc<T> as ConfigureEvm>::DefaultExternalContext<'_>, DB>
where DB: Database,

§

fn evm_with_env_and_inspector<DB, I>( &self, db: DB, env: EnvWithHandlerCfg, inspector: I, ) -> Evm<'_, I, DB>
where DB: Database, I: GetInspector<DB>,

§

fn evm_with_inspector<DB, I>(&self, db: DB, inspector: I) -> Evm<'_, I, DB>
where DB: Database, I: GetInspector<DB>,

§

fn default_external_context<'a>( &self, ) -> <Arc<T> as ConfigureEvm>::DefaultExternalContext<'a>

Implementors§