feat(tests): add empty precompile top-frame charge test - #13
Merged
gurukamath merged 3 commits intoJun 25, 2026
Conversation
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.
3 tasks
gurukamath
merged commit Jun 25, 2026
634c1ab
into
gurukamath:fix/eip-2780-empty-precompile-new-account
5 of 14 checks passed
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.
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.