Trait BlockExecutorFactory
pub trait BlockExecutorFactory: 'static {
type EvmFactory: EvmFactory;
type ExecutionCtx<'a>: Clone;
type Transaction;
type Receipt;
// Required methods
fn evm_factory(&self) -> &Self::EvmFactory;
fn create_executor<'a, DB, I>(
&'a self,
evm: <Self::EvmFactory as EvmFactory>::Evm<&'a mut State<DB>, I>,
ctx: Self::ExecutionCtx<'a>,
) -> impl BlockExecutorFor<'a, Self, DB, I>
where DB: Database + 'a,
I: Inspector<<Self::EvmFactory as EvmFactory>::Context<&'a mut State<DB>>> + 'a;
}
evm
only.Expand description
A factory that can create BlockExecutor
s.
This trait extends crate::EvmFactory
and provides a way to construct a BlockExecutor
.
Executor is expected to derive most of the context for block execution from the EVM (which
includes [revm::context::BlockEnv
]), and any additional context should be contained in
configured ExecutionCtx
.
Every block executor factory is expected to contain and expose an EvmFactory
instance.
For more context on the executor design, see the documentation for BlockExecutor
.
Required Associated Types§
type EvmFactory: EvmFactory
type EvmFactory: EvmFactory
The EVM factory used by the executor.
type ExecutionCtx<'a>: Clone
type ExecutionCtx<'a>: Clone
Context required for block execution.
This is similar to crate::EvmEnv
, but only contains context unrelated to EVM and
required for execution of an entire block.
type Transaction
type Transaction
Transaction type used by the executor, see BlockExecutor::Transaction
.
type Receipt
type Receipt
Receipt type produced by the executor, see BlockExecutor::Receipt
.
Required Methods§
fn evm_factory(&self) -> &Self::EvmFactory
fn evm_factory(&self) -> &Self::EvmFactory
Reference to EVM factory used by the executor.
fn create_executor<'a, DB, I>(
&'a self,
evm: <Self::EvmFactory as EvmFactory>::Evm<&'a mut State<DB>, I>,
ctx: Self::ExecutionCtx<'a>,
) -> impl BlockExecutorFor<'a, Self, DB, I>where
DB: Database + 'a,
I: Inspector<<Self::EvmFactory as EvmFactory>::Context<&'a mut State<DB>>> + 'a,
fn create_executor<'a, DB, I>(
&'a self,
evm: <Self::EvmFactory as EvmFactory>::Evm<&'a mut State<DB>, I>,
ctx: Self::ExecutionCtx<'a>,
) -> impl BlockExecutorFor<'a, Self, DB, I>where
DB: Database + 'a,
I: Inspector<<Self::EvmFactory as EvmFactory>::Context<&'a mut State<DB>>> + 'a,
Creates an executor with given EVM and execution context.
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.