Repository navigation
feat(specs,tests): charge a frame target's access at frame entry - #3412
Merged
spencer-tb merged 3 commits intoAug 22, 2026
Merged
spencer-tb merged 3 commits into
spencer-tb merged 3 commits into
Conversation
EIP-8141 revision b6b6f1ce (EIPs #12212) rewords every `APPROVE` failure mode from "revert the frame" to "revert the current call frame", and the same in gas accounting. The implementation already behaves that way: `approve` raises `Revert` for a wrong `ADDRESS`, an out-of-mask scope and any refusal from `attempt_approval`, whose sender-creation charge raises `OutOfGasError`; `process_call` catches both inside the call frame and restores the transaction state and the frame context, so the parent resumes with a failed call. Only the docstrings claimed otherwise. Note that "without applying any approval effects" holds because `restore_frame_context` restores `payer` and `sender_approved`, not because of the order of the assignments in `attempt_approval` -- an execution approval is recorded before the payment branch's charge can raise. The default code's own wording is left alone: there the frame is the call frame. The new test pins the distinction, which nothing covered in either direction. A frame with no approval flags targets a contract that self-calls; the inner invocation attempts an approval outside the frame's scope and is refused, and the outer records the failed call and runs on to a successful frame. The control replaces the inner `APPROVE` with `STOP`, so the recorded outcome attributes to the refusal. A non-sender target cannot supply the refusal instead: a frame flagged to approve execution must resolve to the sender to be statically valid, which makes `attempt_approval`'s target check defensive. The `ReferenceSpec` pin stays at 06035145: revision 7d1f8857 also carries EIPs #12211 and #12157, so it bumps once those land.
EIP-8141 revision b3e8cad3 (EIPs #12211) moves the resolved target's warm or cold access to frame entry, before the balance check and before dispatch: resolving the target's code is what dispatch is, so the charge applies uniformly whether the frame goes on to run contract code, delegated code or the default code. `execute_frame` now builds the frame's meter and access sets and takes that charge, leaving `create_evm_from_frame` the delegation access and the value revival's state gas. Three consequences the revision spells out follow from the move: a frame that cannot afford the access halts before the default code is evaluated, which invalidates the transaction when the frame is a VERIFY; a frame reverting on the balance check reports the gas charged so far rather than zero; and the payer needs no warming rule of its own, being the resolved target of the frame that approves payment, so commit 8467af1's `accessed_addresses` and `warm_addresses` plumbing is unwound. Every default-code frame receipt therefore reports its entry access instead of zero — 100 for a frame resolving to the sender the transaction starts warm with, 3000 for a sponsor's frame. The suite expresses that through a new `default_code_frame_gas` helper taking warmth as a keyword: centralized so a reprice touches one place, but explicit at each call site, since assuming warmth would be wrong for exactly the sponsored flow this change is about. `test_calldata_floor_ with_state_gas` also gains a real budget for its verifying frame, which previously declared zero execution gas and now could not pay to enter. New tests: `test_frame_entry_gas_boundary` runs a codeless target at exactly its entry access and one gas short, and `test_default_code_entry_gas_shortfall` starves a sponsor's approving frame by one gas, pinning that the charge precedes the default code — its affordable control approves and binds the payer. `test_value_transfer_exceeding_balance` pins the reverting frame's receipt on the balance-check path. The `ReferenceSpec` pin moves to b6b6f1ce, not the current tip: the revision after it carries EIPs #12157, whose precompile dispatch arm execution-specs PR ethereum#3407 implements.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## eips/amsterdam/eip-8141 #3412 +/- ##
==========================================================
Coverage ? 93.17%
==========================================================
Files ? 576
Lines ? 33250
Branches ? 2975
==========================================================
Hits ? 30980
Misses ? 1578
Partials ? 692
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:
|
42 of 75 tasks
16 tasks done
spencer-tb
approved these changes
Aug 22, 2026
spencer-tb
left a comment
Contributor
There was a problem hiding this comment.
LGTM! Pushed 7dffd932 on top to pin exact gas in the refused-approval test and cover the entry-charge halt inside an atomic batch.
spencer-tb
merged commit Aug 22, 2026
e9c45ae
into
ethereum:eips/amsterdam/eip-8141
25 checks passed
2 tasks done
spencer-tb
added a commit
that referenced
this pull request
Aug 22, 2026
…#3412) Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
spencer-tb
added a commit
that referenced
this pull request
Aug 22, 2026
…#3412) Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
gurukamath
added a commit
that referenced
this pull request
Aug 26, 2026
…#3412) Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
gurukamath
added a commit
that referenced
this pull request
Aug 26, 2026
…#3412) Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
gurukamath
added a commit
that referenced
this pull request
Sep 2, 2026
…#3412) Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
gurukamath
added a commit
that referenced
this pull request
Sep 3, 2026
…#3412) Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
gurukamath
added a commit
that referenced
this pull request
Sep 3, 2026
…#3412) Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
gurukamath
added a commit
that referenced
this pull request
Sep 4, 2026
…#3412) Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
gurukamath
added a commit
that referenced
this pull request
Sep 4, 2026
…#3412) Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
spencer-tb
added a commit
to spencer-tb/execution-specs
that referenced
this pull request
Sep 28, 2026
…ethereum#3412) Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
spencer-tb
added a commit
to spencer-tb/execution-specs
that referenced
this pull request
Sep 28, 2026
…ethereum#3412) Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
spencer-tb
added a commit
to spencer-tb/execution-specs
that referenced
this pull request
Sep 29, 2026
…ethereum#3412) Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
spencer-tb
added a commit
that referenced
this pull request
Oct 5, 2026
…#3412) Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
spencer-tb
added a commit
to AnkushinDaniil/eth1.0-specs
that referenced
this pull request
Oct 6, 2026
…ethereum#3412) Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
gurukamath
added a commit
that referenced
this pull request
Oct 9, 2026
…#3412) Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
spencer-tb
added a commit
to spencer-tb/execution-specs
that referenced
this pull request
Oct 13, 2026
…ethereum#3412) Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
gurukamath
added a commit
that referenced
this pull request
Oct 13, 2026
…#3412) Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
gurukamath
added a commit
that referenced
this pull request
Oct 21, 2026
…#3412) Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
gurukamath
added a commit
that referenced
this pull request
Oct 21, 2026
…#3412) Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
gurukamath
added a commit
that referenced
this pull request
Oct 23, 2026
…#3412) Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
gurukamath
added a commit
that referenced
this pull request
Oct 24, 2026
…#3412) Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
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
EIP-8141 revision
b3e8cad3(EIPs #12211) moves the resolved target's warm or cold access to frame entry — before the balance check and before dispatch — soexecute_frametakes the charge, every default-code frame receipt reports it instead of zero, and the payer's warming rule from #12113 falls out as redundant;Revision
b6b6f1ce(EIPs #12212) rescopes everyAPPROVEfailure from the frame to the current call frame, which the implementation already did —process_callcatchesRevertandExceptionalHaltinside the call frame and restores the frame context — so only three docstrings changed, one test now pins the distinction, and theReferenceSpecmoves tob6b6f1cerather than the current tip, whose #12157 precompile arm belongs to feat(spec-specs,tests): dispatch a precompile a VERIFY frame targets #3407.Related Issues or PRs
#2829
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.