Summary
Build the end-to-end transaction execution pipeline that takes a wire-format transaction and produces a state transition. Currently eevm can execute raw bytecode but has no pipeline for: decode tx → validate → deduct gas → execute → apply state changes → generate receipt.
Specification
The pipeline:
- Decode — deserialize from wire format using
Transaction.Envelope.decode/1
- Recover sender — via
Transaction.Signer.recover_sender/2
- Validate — via
Transaction.Validator.validate/3
- Deduct upfront cost —
gas_limit * gas_price + value from sender balance
- Calculate intrinsic gas — via
Transaction.IntrinsicGas.calculate/1
- Set up execution context — populate
Context.Transaction, Context.Block, Context.Contract
- Pre-warm access set — sender, recipient, coinbase, precompiles, access list entries
- Execute EVM —
EEVM.execute/2 for message calls, or CREATE for contract deployment
- Apply gas refund —
min(refund, gas_used / 5) back to sender
- Transfer priority fee — to coinbase
- Generate receipt — status, cumulative gas, logs, bloom
Implementation Guide
- Create
lib/eevm/transaction/executor.ex — the pipeline orchestrator
- Define
EEVM.TransactionResult struct — status, gas_used, logs, receipt, state changes
- Wire together existing modules: Envelope, Signer, Validator, IntrinsicGas, Database, EEVM.execute
- Handle all tx types — Legacy, AccessList, FeeMarket, Blob (and eventually SetCode)
- Tests: execute a simple value transfer, execute a contract call, contract deployment, failed tx (validation error), reverted tx
Acceptance Criteria
Reference
- Ethereum Yellow Paper §6 (Transaction Execution)
- execution-specs:
ethereum/execution-specs state_transition function
Summary
Build the end-to-end transaction execution pipeline that takes a wire-format transaction and produces a state transition. Currently eevm can execute raw bytecode but has no pipeline for: decode tx → validate → deduct gas → execute → apply state changes → generate receipt.
Specification
The pipeline:
Transaction.Envelope.decode/1Transaction.Signer.recover_sender/2Transaction.Validator.validate/3gas_limit * gas_price + valuefrom sender balanceTransaction.IntrinsicGas.calculate/1Context.Transaction,Context.Block,Context.ContractEEVM.execute/2for message calls, or CREATE for contract deploymentmin(refund, gas_used / 5)back to senderImplementation Guide
lib/eevm/transaction/executor.ex— the pipeline orchestratorEEVM.TransactionResultstruct — status, gas_used, logs, receipt, state changesAcceptance Criteria
Reference
ethereum/execution-specsstate_transition function