fevm-replay

Mainnet blocks, validated statelessly by fevm

Each row is a mainnet block. fevm-replay took the parent's Merkle proofs as a witness, ran the block's system calls and transactions in fevm, wrote fevm's end state into the partial trie and hashed it again. A block counts only if that root is the header's stateRoot and every other root in the header (transactions, receipts, withdrawals, requests, gas, logs bloom) came out of fevm too. The blocks were taken as the chain grew, two behind the head, by fevm_replay follow, which runs the tool's own fetch-block, fetch-proofs and chain, or by the fetcher the browser page uses (the same Fe decides what to prove), checked natively by chain. Two other implementations agree on every block: fevm's own chain layer (fevm_chain), and geth's evm t8n on the same witness, whose receipts root, logs bloom, gas and requests hash are the header's and whose end state is the proven one (fevm_replay geth-block). Every one also validates in the WebAssembly module the browser runs.

Witness against gas used

One dot a block: the Merkle-Patricia witness fevm needed, against the block's gas.

Merkle-Patricia against a binary tree

Per block, oldest first: the witness fevm used, and EIP-7864's binary tree estimated for the same keys (a range: 28 to 31 levels).

Merkle-PatriciaBinary tree, est.
Block Transactions Every root Witness per tx per Mgas Binary tree, est. In WebAssembly With Fe's fix

Whose storage weighs the most

Each block's five contracts with the heaviest storage proofs in the parent's witness, summed over the blocks above. Nodes a slot is the length of a slot's proof path: the deeper a contract's storage trie, the more each slot it touches costs. Binary tree is the same account and slots alone in EIP-7864's unified tree (estimated, as above), against their Merkle-Patricia witness with the account proof: deep storage tries shrink, while a contract with a small trie can grow, since in the unified tree each of its slots sits on its own path from the root.

ContractBlocksSlots provenNodes a slotBytes a slotMerkle-PatriciaBinary tree, est.

What EIP-4762 would charge for these blocks

EIP-4762 (Draft) prices the witness a stateless client needs: per transaction, each stem and leaf read and written, code chunk by chunk, in place of today's cold-access and SSTORE charges. fevm-replay counts it for every transaction from its traces and the 31-byte code chunks fevm ran (ingots/replay_core/src/gas4762.fe). The draft makes the sender and target free but not the block's coinbase, which every transaction pays its fee to.

What Glamsterdam would do to these transactions

fevm already implements Glamsterdam's execution rules (Config::amsterdam(): EIP-8037 and EIP-8038 state gas and repricing, EIP-2780, EIP-7976 and EIP-7981 transaction repricing, EIP-7708 transfer logs). fevm_replay amsterdam (src/amsterdam.fe) runs every transaction of these 93 blocks on the pre-state the node traced for it, with the gas limit it was sent with, under Osaka and under Amsterdam. geth's own Amsterdam rules (evm t8n, go-ethereum 1.17.10) give the same status, gas, logs and state on all 3,718 transactions compared. Check one transaction yourself: your browser runs it in fevm under both forks.

35%of 20,636 transactions that succeeded would fail at their gas limit (7,264), and 184 more would no longer be valid
+26%gas for those that still succeed
63%of the failures are state gas (EIP-8037): 3,220 fill a storage slot from zero, 1,286 create an account; the rest is repricing
1,086plain ETH transfers would fail: they create an account, sent with 21,000 gas
72,006more gas, the median a failing transaction would need; 187 fail at any limit
USDT, USDCtake 1,378 and 813 of the 6,191 contract calls that would fail (1,395 contracts in all): a transfer to a new holder fills a slot from zero
3,718 / 3,718transactions where geth's Amsterdam and fevm's agree

Block access lists (EIP-7928)

The list each block would carry, built from its transactions' traces: every account it touched, each storage write and balance, nonce and code change by transaction, and the slots only read (ingots/replay_core/src/bal.fe, RLP, uncompressed). With it a client knows each transaction's reads and writes before it runs; the longest chain is the most transactions that each touch what an earlier one wrote, the steps unlimited cores would need. The coinbase, which every transaction credits, is left out.

What the blocks say, in findings computed from this data: what mainnet blocks say about stateless Ethereum.

What the columns are

Witness is what fevm needed besides code: the parent's distinct proof nodes, account and storage, plus the nodes a deletion moved up that the parent's proofs lack (taken from the block's own proofs by the hash a parent's node names). Contract code comes on top, checked against the proven code hashes.

Binary tree, est. is the witness the unified binary tree of EIP-7864 would need for the same accounts and slots, worked out in Fe: the stems and values are exact, the stems are placed by keccak (the EIP has not fixed its hash yet; keccak is among the candidates), and the tree is taken to be 28 to 31 levels deep above the stems. It leaves code chunks out, as the Merkle-Patricia column leaves code out.

With Fe's fix is the same, with the module built by Fe at 61fc4ee, which fixed the tail calls fevm-replay reported (argotorg/fe#2060): no rewrite, the default 1 MiB stack, every block still valid, median 2.03 s against 2.55 s.

In WebAssembly is the time the browser's module (fevm and fevm-replay's validation, compiled from Fe 26.7) took to validate the block again, every root, with the same verdict as natively: run in Node.js on one core of a laptop, from the saved block.

A block marked not proven could not be fetched in time: nodes serve proofs for about 100 blocks, and the free endpoint sometimes errs. Its transactions are not counted.