diff --git a/crates/evm/src/block/mod.rs b/crates/evm/src/block/mod.rs index 5a630d4f..00a2d93d 100644 --- a/crates/evm/src/block/mod.rs +++ b/crates/evm/src/block/mod.rs @@ -449,6 +449,7 @@ where Evm = ::Evm, Transaction = F::Transaction, Receipt = F::Receipt, + Result = F::TxExecutionResult, >, DB: StateDB + 'a, I: Inspector<::Context> + 'a, @@ -464,6 +465,7 @@ where Evm = ::Evm, Transaction = F::Transaction, Receipt = F::Receipt, + Result = F::TxExecutionResult, >, { } @@ -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>; + /// Context required for block execution beyond what the EVM provides (e.g. /// [`EvmEnv`](crate::EvmEnv)) /// diff --git a/crates/evm/src/eth/block.rs b/crates/evm/src/eth/block.rs index 49d1fb77..bf0b742e 100644 --- a/crates/evm/src/eth/block.rs +++ b/crates/evm/src/eth/block.rs @@ -393,6 +393,10 @@ where type ExecutionCtx<'a> = EthBlockExecutionCtx<'a>; type Transaction = R::Transaction; type Receipt = R::Receipt; + type TxExecutionResult = EthTxResult< + ::HaltReason, + ::TxType, + >; fn evm_factory(&self) -> &Self::EvmFactory { &self.evm_factory