EEVM.Handler.PostExecution (eevm v0.1.0)

Copy Markdown View Source

Steps 9-11 of the transaction pipeline:

  • Settle gas refund — the sender was debited gas_limit * max_price upfront. They actually owe gas_used * effective_price. Refund the difference. On a successful tx the refund lands in the EVM-side db (which already reflects every side effect); on revert / out-of-gas / invalid it lands in the post-upfront, post-nonce-bump db, which also holds any EIP-7702 delegations (since EVM mutations are dropped).

  • Coinbase reward — credit the block proposer (effective_price - basefee) * gas_used.

  • Build receipt + result — produce the EEVM.TransactionResult struct that callers consume.

Summary

Functions

finalize(final_state, contract_address, tx, sender_bytes, db_nonce_bumped, block)

Settle gas, credit the coinbase, and build the EEVM.TransactionResult.

The database argument is the state after upfront charging, the nonce bump, and EIP-7702 authorizations; settlement starts from it when execution failed.