fix(tests): probe the actual CREATE target on nonce overflow#5
Merged
marioevz merged 2 commits intoJun 23, 2026
Merged
Conversation
The `nonce_overflow` branch of `test_aborted_create_does_not_warm_address` deployed the factory with nonce `2**64 - 1` but derived the `BALANCE` probe address with a hard-coded nonce of `1`. A plain `CREATE` derives its target from the factory's nonce at CREATE time, so the probe pointed at an unrelated address the execution never touches. The branch passed on both correct and buggy clients without exercising the intended address. Thread a single `factory_nonce` through both the factory deploy and the `compute_create_address` probe so they cannot drift. `CREATE2` is left unchanged, since its address is nonce-independent.
marioevz
approved these changes
Jun 23, 2026
marioevz
left a comment
There was a problem hiding this comment.
LGTM. The suggestions are purely cosmetic so feel free to apply or merge without them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🗒️ Description
test_aborted_create_does_not_warm_addresschecks that a silently abortedCREATEdoes not warm the would-be contract address. Thenonce_overflowcase deployed the factory with nonce2**64 - 1but pointed theBALANCEprobe atcompute_create_address(address=factory, nonce=1).A plain
CREATEderives its target from the factory's nonce at CREATE time, so for this factory the address uses nonce2**64 - 1, not1. In the spec,generic_createruns the nonce-overflow check before adding the target toaccessed_addresses, so a client that incorrectly warmed the target before rejecting the overflow would warm the nonce2**64 - 1address. Because the probe pointed at an unrelated, never-touched address, it stayed cold on both correct and buggy clients: TheCREATEbranch could pass without exercising the intended address.CREATE2was unaffected, since its address is nonce-independent.Fix
Thread a single
factory_nonce(2**64 - 1fornonce_overflow,1otherwise) through both the factory deployment and thecompute_create_addressprobe, so the deploy nonce and the probe nonce cannot drift. TheCREATE2derivation is unchanged, since its address is nonce-independent.Trace verification
Filled with
--traceson Amsterdam and inspected the t8n execution trace for theCREATE+nonce_overflowcase, before and after the fix. The factory is identical in both runs (deployed with nonce2**64 - 1) and theCREATEaborts at depth 1 with no child frame, so the only behavioral change is the address theBALANCEprobe reads:BALANCEtargets0x04bb...5a2b, which iscompute_create_address(factory, 1), an address unrelated to the creation. Charged cold (3000), so the assertion held vacuously.BALANCEtargets0x79fa...1c77, which iscompute_create_address(factory, 2**64 - 1), the address theCREATEwould have produced. Charged cold (3000), confirming the abortedCREATEdid not warm it.The cold
3000charge is identical in both runs, which is why the green fill alone never caught the bug: only the probed address distinguishes them.🔗 Related Issues or PRs
Fix-up to ethereum#3033 (EIP-8038 state-access gas-cost test suite), which introduced this test.