Step 8 of the transaction pipeline — actually run the EVM.
Two paths:
- Call (
tx.tois a 20-byte address): transfertx.value, fetch the code atto, and run the interpreter against it. Whentois an active precompile with no code, the precompile runs ontx.datainstead. - Create (
tx.toisnil): derive the new contract address, fail with all execution gas consumed if it collides with an existing account (EIP-684, EIP-7610), transfertx.value, runtx.dataas initcode, then deploy whatever the initcode returns as the new account's runtime code (subject to size and EIP-3541 deposit-cost checks).
Returns {final_state, contract_address} where contract_address is the
newly-deployed address (CREATE path) or nil (call path).
From Prague, a call to an account whose code is an EIP-7702 delegation designator runs the delegate's code instead, with the delegate pre-warmed.
Summary
Functions
Runs a validated transaction's EVM execution with execution_gas against
db, in which the sender's nonce is already bumped and any EIP-7702
authorizations are applied.
Functions
@spec run_top_level( EEVM.Context.Transaction.t(), EEVM.Database.t(), EEVM.Context.Block.t(), EEVM.Config.t(), non_neg_integer(), EEVM.Handler.PreExecution.authorization_outcome() ) :: {EEVM.Interpreter.MachineState.t(), non_neg_integer() | nil}
Runs a validated transaction's EVM execution with execution_gas against
db, in which the sender's nonce is already bumped and any EIP-7702
authorizations are applied.
authorization is the outcome of PreExecution.apply_authorizations/3:
its authorities start warm and its refund is added to the transaction's
refund counter even if execution fails.
Returns the final machine state and the deployed contract address, or nil
for a message call or a failed deployment.