feat(tests): pin cross-frame state gas refund placement and settlement - #3490
Merged
fselmo merged 4 commits intoSep 1, 2026
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #3490 +/- ##
================================================
Coverage 93.90% 93.90%
================================================
Files 624 624
Lines 36905 36905
Branches 3326 3326
================================================
Hits 34655 34655
Misses 1569 1569
Partials 681 681
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:
|
spencer-tb
marked this pull request as ready for review
September 1, 2026 14:52
spencer-tb
force-pushed
the
tests/amsterdam/eip-8037-cross-frame-spill-coverage
branch
from
September 1, 2026 15:12
209d9a5 to
4625066
Compare
marioevz
self-requested a review
September 1, 2026 17:48
…pill Test that one frame's refund both repays a different slot's borrow and puts the excess in the reservoir, that the split state merges cleanly on success, and that it is fully unwound on revert and halt.
fselmo
approved these changes
Sep 1, 2026
fselmo
left a comment
Contributor
There was a problem hiding this comment.
These look good to me! I added another test after sniffing around a bit with Claude where it exercises two different paths on credit_state_gas_refund on two separate refund credits within the same frame.
@marioevz would be good if you wanted to take a pass here as well 👀
marioevz
approved these changes
Sep 1, 2026
marioevz
left a comment
Member
There was a problem hiding this comment.
Just a couple of nits. Thank you!
fselmo
added a commit
to spencer-tb/execution-specs
that referenced
this pull request
Sep 1, 2026
fselmo
force-pushed
the
tests/amsterdam/eip-8037-cross-frame-spill-coverage
branch
from
September 1, 2026 19:14
bedff2f to
1a7a3b1
Compare
fselmo
deleted the
tests/amsterdam/eip-8037-cross-frame-spill-coverage
branch
September 1, 2026 19:19
This was referenced Sep 2, 2026
spencer-tb
pushed a commit
to chfast/execution-specs
that referenced
this pull request
Sep 2, 2026
…voir Add a test where the sender pays for a reservoir that covers none, one or both of the parent's two fresh sets and the rest spill. A delegated child clears both slots and the refunded state gas lands in the reservoir. The call window, a later set and the receipt are the same in every case: the refund stays in the reservoir and the spill is not repaid. With one set covered, the refund merged from the child is larger than the outstanding spill. The existing tests in this file all start with an empty reservoir, so the merged refund never exceeds the spill there. Covering both sets and covering none are the boundaries. The expectations pin current placement. With the `src/` change of sets and `SLOT_PROBE_RESULT` rises by one state cost for `reservoir_slots=0` only. The receipt does not change. Follow-up to ethereum#3490. Coverage for ethereum/EIPs#12265 and ethereum#3478.
2 tasks
chfast
added a commit
to chfast/execution-specs
that referenced
this pull request
Sep 2, 2026
Add two tests pinning where a merged state gas refund lands, swept over `with_all_call_opcodes` and `with_all_create_opcodes`. A holder contract owns the cleared slot, so a create's initcode reaches it the same way a call's child does, and the parent's spill comes from setting the slot through the holder. Each test measures a clearing window against a no-op window of identical code, so neither needs gas arithmetic. Today the refund stays in the reservoir: the two windows cost the same at a call, and at a create the second window's account creation charge draws on the parked refund, so the clearing window costs one slot's state gas more. With the `src/` change of ethereum#3478 applied, every arm flips to minus one slot's state cost. Before this, `CREATE` and `CREATE2` never merged a refunding child into a parent holding a spill: a repayment applied only at `generic_call` passed the whole suite. `CALL`, `CALLCODE` and depth 2 did reach the path, in `test_state_gas_sstore` and `test_state_gas_set_code`, but nothing there discriminates. Both tests reach the holder through an intermediate frame, so the sweep pins depth 2 as well. `STATICCALL` is excluded: a static child cannot write, so it can never refund. `test_cross_frame_refund_parks_in_reservoir` builds the same probe, so move that shape into `clearing_probe_code` and take the setting code as a parameter. Its fixtures are unchanged. Follow-up to ethereum#3490 and ethereum#3499. Coverage for ethereum/EIPs#12265 and ethereum#3478.
2 tasks
20 tasks
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
Add coverage for a state charge spilled from
gas_leftwhose refund is credited in a different frame. Four tests pin the current placement and its settlement consequences:gas_leftis not repaid at the mergeThe settlement pins are placement independent and hold unchanged under the merge-time repayment of ethereum/EIPs#12265. The placement pins flip with it: three of the four tests fail when filled against #3478.
Related Issues or PRs
Coverage baseline for ethereum/EIPs#12265. #3478 revises the flipped pins if the repayment lands.
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.