Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions crates/evm/src/block/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ where
Evm = <F::EvmFactory as EvmFactory>::Evm<DB, I>,
Transaction = F::Transaction,
Receipt = F::Receipt,
Result = F::TxExecutionResult,
>,
DB: StateDB + 'a,
I: Inspector<<F::EvmFactory as EvmFactory>::Context<DB>> + 'a,
Expand All @@ -464,6 +465,7 @@ where
Evm = <F::EvmFactory as EvmFactory>::Evm<DB, I>,
Transaction = F::Transaction,
Receipt = F::Receipt,
Result = F::TxExecutionResult,
>,
{
}
Expand Down Expand Up @@ -498,6 +500,18 @@ pub trait BlockExecutorFactory: 'static {
/// The EVM factory used by the executor.
type EvmFactory: EvmFactory;

/// Result type produced by the executor for each transaction.
///
/// This is the concrete [`BlockExecutor::Result`] type returned by executors created from this
/// factory. It captures the raw EVM execution output before it is committed into block state
/// and converted into a receipt.
///
/// Exposing this type on the factory allows generic callers that only know the
/// [`BlockExecutorFactory`] to name the per-transaction execution result produced by its
/// executors. The result's halt reason must match the halt reason used by the configured
/// [`EvmFactory`].
type TxExecutionResult: TxResult<HaltReason = <Self::EvmFactory as EvmFactory>::HaltReason>;

/// Context required for block execution beyond what the EVM provides (e.g.
/// [`EvmEnv`](crate::EvmEnv))
///
Expand Down
4 changes: 4 additions & 0 deletions crates/evm/src/eth/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,10 @@ where
type ExecutionCtx<'a> = EthBlockExecutionCtx<'a>;
type Transaction = R::Transaction;
type Receipt = R::Receipt;
type TxExecutionResult = EthTxResult<
<EvmF as EvmFactory>::HaltReason,
<R::Transaction as TransactionEnvelope>::TxType,
>;

fn evm_factory(&self) -> &Self::EvmFactory {
&self.evm_factory
Expand Down