Skip to content

feat(tests): add empty precompile top-frame charge test - #13

Merged
gurukamath merged 3 commits into
gurukamath:fix/eip-2780-empty-precompile-new-accountfrom
danceratopz:fix/eip-2780-empty-precompile-new-account-suggestion
Jun 25, 2026
Merged

feat(tests): add empty precompile top-frame charge test#13
gurukamath merged 3 commits into
gurukamath:fix/eip-2780-empty-precompile-new-accountfrom
danceratopz:fix/eip-2780-empty-precompile-new-account-suggestion

Conversation

@danceratopz

@danceratopz danceratopz commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Suggestions for ethereum#3048.

I think the new test in commit 1 is worthwhile.

Commit 2 is a simplification due to ethereum#2969 while we're here.

Commit 3 maybe too cautious, but explicitly the value to precompile with balance 0 behavior; the test fails to fill if the behavior is incorrect regarding account creation charges. If you think this is too heavy or would lead to too much maintenance (I don't think so), we can drop this. Will be caught anyway by the new test in tests/amsterdam/eip2780_reduce_intrinsic_tx_gas/test_top_frame_charges.py.

Add a gas-boundary regression test for value transfers to an unfunded precompile. The transaction is one gas short of covering the top-frame NEW_ACCOUNT state charge, so implementations that incorrectly carve out precompile recipients reach the identity precompile and fail the expected post-state instead of silently filling.
Pin the sender balance for one value-moving transaction to an unfunded precompile so the source test fails if the NEW_ACCOUNT top-frame state charge is accidentally skipped. Without this check the broad precompile matrix can still fill because recipient balance and sender nonce are unchanged by the missing charge.

Use precompile 0x04 specifically because identity accepts the empty calldata already used by this test and has deterministic execution gas. The NEW_ACCOUNT rule is independent of which precompile executes, so this avoids duplicating every precompile's gas model while still catching the silent-fill regression.
@gurukamath
gurukamath merged commit 634c1ab into gurukamath:fix/eip-2780-empty-precompile-new-account Jun 25, 2026
5 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants