feat(spec-specs, tests): implement EIP-8253, bump nonce of zero-nonce storage accounts - #3535
feat(spec-specs, tests): implement EIP-8253, bump nonce of zero-nonce storage accounts#3535jochem-brouwer wants to merge 2 commits into
Conversation
… block Set the nonce of the 28 Mainnet accounts with empty code, a zero nonce and non-empty storage to one at the start of the fork block, before the pre-execution system contract calls. The change is recorded in the block access list at block access index zero. `execute_block` derives whether a block activates the fork from `FORK_CRITERIA` and the parent header, and passes it to `apply_body`. `ForkLoad` exposes the new module to the transition tool.
…vation Add fork-transition tests for EIP-8253: the nonce bump and its block access list entries, a replay of each account's Mainnet creation colliding at the fork block, calls to a bumped account, untouched non-targeted accounts, and the unconditional bump of accounts absent from the pre-state. The blockchain filler now tells the transition tool when a block activates its fork (`fork_activation`), which the in-process spec t8n uses to apply the bump; the CLI and daemon accept `--state.fork-activation`. Forks expose `zero_nonce_storage_accounts()`. Pre-states are checked against the EIP-8253 invariants: before the bump, a listed address must have a zero nonce and no code; from the bump on, no account may have empty code, a zero nonce and non-empty storage. The EIP-7928 BAL size transition test budgets the extra fork-block entries.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #3535 +/- ##
===================================================
- Coverage 94.01% 93.63% -0.38%
===================================================
Files 624 625 +1
Lines 36912 36934 +22
Branches 3326 3328 +2
===================================================
- Hits 34702 34583 -119
- Misses 1533 1624 +91
- Partials 677 727 +50
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
(Dumping some extra output of Claude here) Tests capped by EIP-8253From Amsterdam on, no account may have empty code, a zero nonce, and
Alternative to cappingThe ported tests (3 to 17) all use the same pre-state line, |
Description
Implements EIP-8253 for Amsterdam, with tests.
Spec. At the start of the fork block, before the pre-execution system calls, the nonce of the 28 Mainnet accounts with empty code, zero nonce and non-empty storage is set to one. Balance, code and storage are untouched. The BAL records one
NonceChange [0, 1]per account at block access index 0. The bump is unconditional, as the EIP specifies: test chains stand in for Mainnet.Fork block detection. The spec derives
is_fork_blockfromFORK_CRITERIAand the parent header. The filler passes an explicitfork_activationflag to the transition tool (--state.fork-activationfor the CLI and daemon); external t8n binaries do not receive it yet.Pre-state invariants. Since test chains model Mainnet, filling now rejects pre-states that contradict the EIP: before the bump, a listed address must have zero nonce and no code; from the bump on, no account may have empty code, zero nonce and non-empty storage. The 17 existing tests that build that shape are capped with
valid_before("EIP8253")(2 EXTCODEHASH cases, 15 ported static tests).Tests (
tests/amsterdam/eip8253_..., all fork-transition): nonce bump with full BAL and post-state checks;CREATEcollision at the fork block by replaying each account's Mainnet creation (original creator address and nonce, verified against chain data); calls to a bumped account; non-targeted accounts untouched; bump of accounts absent from the pre-state. The EIP-7928 BAL size transition test budgets the 28 extra fork-block entries.None of the 28 addresses is reachable by
CREATEagain: 26 were created by EOA transactions whose nonces have moved on, and the 2 factory-created ones came from factories that self-destructed and, under EIP-161, could never again create from nonce 0.Related Issues or PRs
N/A.
Checklist
just static<type>(<area>): <title>, where<type>and<area>come from an appropriateC-<type>, respectivelyA-<area>, label. The title should match the target squash commit message.Cute Animal Picture