Skip to main content

BlockExecutorFactory

Trait BlockExecutorFactory 

Source
pub trait BlockExecutorFactory {
    type EvmFactory;
    type EvmTypes: EvmTypes
       where <Self::EvmTypes as EvmTypesHost>::TxResultExt: for<'a> Send + for<'a> Sync,
             <Self::EvmTypes as EvmTypesHost>::SpecId: for<'a> Eq + for<'a> Hash + for<'a> Debug + for<'a> Send + for<'a> 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 { ... }
}
Available on crate feature evm only.
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 where <Self::EvmTypes as EvmTypesHost>::TxResultExt: for<'a> Send + for<'a> Sync, <Self::EvmTypes as EvmTypesHost>::SpecId: for<'a> Eq + for<'a> Hash + for<'a> Debug + for<'a> Send + for<'a> 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§

Source§

impl<C, F> BlockExecutorFactory for EthBigBlockExecutorFactory<C, F>
where C: EthChainSpec<Header = Header> + EthereumHardforks, F: EvmFactory, <F as EvmFactory>::Types: EvmTypes<Tx = TxEnvelope>,

Source§

type EvmFactory = F

Source§

type EvmTypes = <F as EvmFactory>::Types

Source§

type Transaction = EthereumTxEnvelope<TxEip4844>

Source§

type Receipt = EthereumReceipt

Source§

type Evm<'a> = Evm<'a, <F as EvmFactory>::Types>

Source§

type EvmEnv = EthEvmEnv<<F as EvmFactory>::Types>

Source§

type ExecutionCtx<'a> = EthBigBlockPlan<'a, <F as EvmFactory>::Types> where EthBigBlockExecutorFactory<C, F>: 'a

Source§

type Executor<'a> = EthBigBlockExecutor<'a, C, F> where EthBigBlockExecutorFactory<C, F>: 'a

Source§

impl<R, C, F> BlockExecutorFactory for EthBlockExecutorFactory<R, C, F>
where C: EthChainSpec<Header = Header> + EthereumHardforks, F: EvmFactory, R: ReceiptBuilder, <<F as EvmFactory>::Types as EvmTypesHost>::Tx: Typed2718,