Skip to main content

BlockExecutorFactory

Trait BlockExecutorFactory 

Source
pub trait BlockExecutorFactory {
    type EvmFactory;
    type EvmTypes: EvmTypes<TxResultExt: Send + Sync, SpecId: Eq + Hash + Debug + Send + Sync + 'static>;
    type Transaction: Debug + Clone + Send + Sync + 'static;
    type Receipt;
    type Evm<'a>: Evm<EvmTypes = Self::EvmTypes, Transaction = <Self::EvmTypes as EvmTypesHost>::Tx>;
    type EvmEnv: EvmEnv<EvmTypes = Self::EvmTypes>;
    type ExecutionCtx<'a>: Debug + Clone + Send
       where Self: 'a;
    type Executor<'a>: BlockExecutor<Transaction = Self::Transaction, Receipt = Self::Receipt, Evm = Self::Evm<'a>, BlockAccessList = Bal>
       where Self: 'a;

    // Required methods
    fn create_executor<'a>(
        &'a self,
        evm: Self::Evm<'a>,
        ctx: Self::ExecutionCtx<'a>,
    ) -> Self::Executor<'a>
       where Self: 'a;
    fn evm_factory(&self) -> &Self::EvmFactory;
    fn evm_with_env<'a, DB>(
        &self,
        db: DB,
        evm_env: Self::EvmEnv,
    ) -> Self::Evm<'a>
       where DB: DynDatabase + 'a;

    // Provided method
    fn evm_with_database<'a, DB>(
        &self,
        db: DB,
        evm_env: Self::EvmEnv,
    ) -> Self::Evm<'a>
       where DB: Database + 'a { ... }
}
Expand description

A type that creates configured block executors.

Required Associated Types§

Source

type EvmFactory

Additional EVM factory configuration owned by this executor factory.

Source

type EvmTypes: EvmTypes<TxResultExt: Send + Sync, SpecId: Eq + Hash + Debug + Send + Sync + 'static>

Runtime EVM type family.

Source

type Transaction: Debug + Clone + Send + Sync + 'static

Consensus transaction type consumed by executors from this factory.

Source

type Receipt

Receipt type produced by executors from this factory.

Source

type Evm<'a>: Evm<EvmTypes = Self::EvmTypes, Transaction = <Self::EvmTypes as EvmTypesHost>::Tx>

EVM instance consumed by executors from this factory.

Source

type EvmEnv: EvmEnv<EvmTypes = Self::EvmTypes>

EVM environment consumed by this factory.

Source

type ExecutionCtx<'a>: Debug + Clone + Send where Self: 'a

Execution context for a block or payload.

Source

type Executor<'a>: BlockExecutor<Transaction = Self::Transaction, Receipt = Self::Receipt, Evm = Self::Evm<'a>, BlockAccessList = Bal> where Self: 'a

Block executor returned by this factory.

Required Methods§

Source

fn create_executor<'a>( &'a self, evm: Self::Evm<'a>, ctx: Self::ExecutionCtx<'a>, ) -> Self::Executor<'a>
where Self: 'a,

Creates a configured block executor.

Source

fn evm_factory(&self) -> &Self::EvmFactory

Returns the configured EVM factory state.

Source

fn evm_with_env<'a, DB>(&self, db: DB, evm_env: Self::EvmEnv) -> Self::Evm<'a>
where DB: DynDatabase + 'a,

Creates an EVM instance with the configured execution environment.

Provided Methods§

Source

fn evm_with_database<'a, DB>( &self, db: DB, evm_env: Self::EvmEnv, ) -> Self::Evm<'a>
where DB: Database + 'a,

Available on crate feature std only.

Creates an EVM instance with the configured execution environment over a typed database.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§