End-to-end transaction handler.
Orchestrates the per-transaction pipeline, deferring each phase to a sibling module so the layering stays inspectable:
EEVM.Handler.Validation— decode → recover sender → validateEEVM.Handler.PreExecution— charge upfront → intrinsic gas → bump nonce → apply EIP-7702 authorizationsEEVM.Handler.Execution— top-level CALL or CREATE through the EVMEEVM.Handler.PostExecution— settle refund, credit coinbase, build result
This split mirrors revm's handler/ crate (validation.rs,
pre_execution.rs, execution.rs, post_execution.rs) and keeps each
phase independently testable.
Summary
Types
A transaction: raw signed bytes, a signed EEVM.Transaction struct, or,
for simulation, an unsigned EEVM.TxEnv whose origin is the sender.
Functions
Execute a single transaction end-to-end. EEVM.transact/4 delegates here;
call that instead.
Types
@type opts() :: [ hardfork: EEVM.HardforkConfig.spec_id(), config: EEVM.Config.t(), tracer: boolean() | EEVM.Tracer.t(), commit: boolean(), details: boolean(), chain_id: non_neg_integer() ]
@type wire_tx() :: EEVM.Handler.Validation.wire_tx() | EEVM.TxEnv.t()
A transaction: raw signed bytes, a signed EEVM.Transaction struct, or,
for simulation, an unsigned EEVM.TxEnv whose origin is the sender.
Functions
@spec execute(wire_tx(), EEVM.BlockEnv.t(), EEVM.Database.t(), opts()) :: {:ok, EEVM.TransactionResult.t()} | {:error, EEVM.Error.reason() | EEVM.TransactionError.t()}
Execute a single transaction end-to-end. EEVM.transact/4 delegates here;
call that instead.
tx_or_bytes may be either raw wire bytes (legacy RLP or a typed envelope
prefix + RLP) or one of the typed EEVM.Transaction.* structs. For
simulation it may also be an unsigned EEVM.TxEnv: its origin is the
sender, with no signature to recover, and every other rule applies unless
a simulation switch in the config turns it off.
Options
:config— theEEVM.Config: hardfork, chain id (used to recover the sender and check EIP-7702 authorizations), custom precompiles, and the simulation switches, which are never for consensus.:hardfork— shorthand forconfig: EEVM.Config.new(hardfork)(default:cancun).:configtakes precedence when both are given.:tracer—trueor anEEVM.Tracerto record an EIP-3155 trace, returned asresult.trace.:commit—falseto leave the writes inresult.db's overlay and skipresult.changes;EEVM.Blockdoes this to commit once per block. By default the writes are committed when the backend implementsEEVM.Database.commit/2.:details—trueto return each rejection as{:error, %EEVM.TransactionError{}}, which carries the values the rule compared (the nonces, balance and cost, fees, gas limits) next to the reason. Defaultfalse:{:error, reason}with the bare atom.:chain_id— deprecated; set it withEEVM.Config.new/2. Overrides the config's chain id when given.
Returns
{:ok, %EEVM.TransactionResult{}}for any transaction that made it past validation, including reverted and halted ones. Inspectresult.statusto tell them apart.{:error, reason}when decoding, sender recovery, validation, or upfront balance charging fail, and{:error, {:database, reason}}when the backend fails a read or commit. The database is unchanged in each case.