For educational purposes only; not investment or security advice. EVM behavior depends on the exact chain, fork, state, bytecode, call context, gas schedule, client and protocol upgrades.
Direct answer
The Ethereum Virtual Machine is the execution-layer state-transition machine that interprets bytecode under a specific fork’s rules. Given the same valid pre-state, top-level transaction or message, block environment and fork specification, conforming execution clients must compute the same post-state or failure result. The EVM does not choose transaction order, provide consensus finality, authenticate a frontend or make every EVM-compatible chain as secure as Ethereum.
An externally signed transaction is a top-level protocol object. Contract-to-contract activity consists of nested message calls and call frames, not independent transactions with their own transaction nonce, receipt or hash. Each frame has code, program counter, 256-bit stack, memory, calldata, returndata, gas and execution context; persistent storage belongs to an account, while transient storage has transaction-scoped lifetime under its fork rules.
How it works
- Pin the execution snapshot: chain and
chainId, network, block number and hash, canonical or finalized status, fork, execution-client and spec revision, pre-state or state root, transaction type, raw signed bytes, transaction hash and receipt. Determinism is conditional on this exact context. - Decode the transaction envelope and separate pre-execution validity from execution. Verify signature and sender, nonce, destination or creation, value, calldata, gas limit, fee fields, access list and any type-specific fields. A transaction rejected before inclusion is not an included transaction that executed and reverted.
- Build the top-level message and complete call tree. Record
CALL,STATICCALL,DELEGATECALL, contract creation and precompile frames; caller, context address, code address,msg.sender,msg.value, value transfer, calldata, returndata, forwarded gas and success flag. An explorer’s internal transaction label is a trace view, not a signed transaction. - Trace each frame’s program counter, stack, memory, calldata, returndata, logs, persistent storage and transient storage journal.
CALLuses the callee’s address and storage context;DELEGATECALLexecutes target code in the caller’s address and storage context while preserving the upstream sender and value;STATICCALLforbids state modification. - Apply the target fork’s gas rules: intrinsic gas, opcode dynamic costs, memory expansion, cold and warm accesses, call forwarding, stipends, precompile charges, refunds and refund caps. Then calculate transaction fees separately from value using gas used and the effective gas price. A gas estimate is conditional, not a guarantee.
- Resolve frame outcomes by scope.
RETURNcommits the frame if its ancestors later commit.REVERTrolls back that frame and descendants, returns data and need not consume all remaining frame gas; exceptional halts differ. A parent can catch a failed low-level call and continue, so top-level receipt status can be1even when a child failed. A top-level included failure still consumes the sender nonce and paid gas. - Reconcile receipt status, gas used, logs, created address and return data against pre- and post-state balances, nonces, code, persistent and transient storage, token ledgers, traces and the block state root. Re-execute with an independent client where warranted, and audit proxy implementations, storage layouts, precompiles, compiler EVM targets and fork upgrades separately from consensus finality.
Worked examples
- Included top-level revert and fee ledger. A type-2 transaction has gas limit
80,000, gas used52,000, base fee20 gwei, max priority fee3 gweiand max fee40 gwei. Effective gas price ismin(40, 20 + 3) = 23 gwei; actual fee is52,000 * 23 gwei = 0.001196 ETH, comprising52,000 * 20 gwei = 0.001040 ETHburned and52,000 * 3 gwei = 0.000156 ETHpriority fee. The unused28,000 gasis not charged. If top-level execution reverts, its storage, value-transfer and log effects roll back, but the sender nonce and actual fee remain. - Caught child failure. Contract A starts with
A.x = 5. It calls B; B writesB.y = 9, emits a log and executesREVERT. B’s write and log roll back. A observessuccess = false, writesA.x = 7and returns normally. Final receipt status is1,A.x = 7and B retains its prior value. Top-level success therefore does not prove every child call succeeded. - DELEGATECALL storage context. A proxy has
slot0 = 5; an implementation account hasslot0 = 99. Implementation code reads slot 0, adds7and stores the result. Executed throughDELEGATECALL, it changes the proxy toslot0 = 12while the implementation remainsslot0 = 99; the proxy address and storage context apply, and the upstream sender and value are preserved. An incompatible storage layout can corrupt proxy state. - Fork-scoped SELFDESTRUCT. Under the EIP-6780 rule, an existing contract with
2 ETHexecutesSELFDESTRUCTto beneficiary B. B receives2 ETHand the contract balance becomes zero, but the existing account, code and storage are not deleted. Deletion behavior remains only when the contract was created and self-destructed in the same transaction. This is fork-scoped behavior, not a rule to extrapolate backward or to every EVM chain.
Risks
- Replaying against the wrong chain, block, fork, client or pre-state.
- Treating a noncanonical or reorganized state as final execution context.
- Confusing pre-validation rejection with included execution revert.
- Assuming a pending simulation will match later included state.
- Ignoring a top-level revert, exceptional halt or out-of-gas condition.
- Missing a child failure caught by its parent.
- Misreading call context, code address, caller, sender or value.
- Corrupting proxy state through
DELEGATECALLstorage-layout mismatch. - Allowing reentrancy or unsafe external value and control transfer.
- Trusting unvalidated returndata, success flags or custom errors.
- Treating logs or traces as authoritative final state.
- Miscalculating cold and warm accesses, memory or call-forwarded gas.
- Misapplying refunds, refund caps, stipends or the
63/64rule. - Using the wrong precompile address, input, gas rule or fork semantics.
- Confusing persistent storage, memory and transient storage lifetimes.
- Expecting state modification to succeed inside
STATICCALL. - Applying pre-EIP-6780
SELFDESTRUCTdeletion assumptions. - Missing proxy implementation, admin or compiler-target drift.
- Running divergent or unupgraded execution-client rules.
- Inferring consensus, bridge, token, governance or finality security from EVM compatibility.
Common misconceptions
- Solidity source code is the object directly executed on-chain.
- A reverted included transaction costs nothing and leaves the nonce unchanged.
- Receipt status
1proves that every internal call succeeded as intended. - An event or trace is the authoritative asset and storage state.
- EVM compatibility guarantees identical opcodes, gas, precompiles, consensus and security.
Related topics
Sources
- Ethereum Virtual Machine (EVM) - Ethereum.org (accessed: 2026-08-12)
- Ethereum Yellow Paper: a formal specification of Ethereum, a programmable blockchain - Ethereum Foundation (accessed: 2026-08-12)
- Ethereum Execution Layer Specification - Ethereum Execution Specs (accessed: 2026-08-12)
- Introduction to Smart Contracts - Solidity Documentation (accessed: 2026-08-12)
- EIP-7: DELEGATECALL - Ethereum Improvement Proposals (accessed: 2026-08-12)
- EIP-140: REVERT instruction - Ethereum Improvement Proposals (accessed: 2026-08-12)
- EIP-2929: Gas cost increases for state access opcodes - Ethereum Improvement Proposals (accessed: 2026-08-12)
- EIP-6780: SELFDESTRUCT only in same transaction - Ethereum Improvement Proposals (accessed: 2026-08-12)