Skip to content

Add EIP-8037 spill-refund accounting coverage#3158

Open
Marchhill wants to merge 1 commit into
ethereum:forks/amsterdamfrom
Marchhill:tests/eip8037-spill-refund-coverage
Open

Add EIP-8037 spill-refund accounting coverage#3158
Marchhill wants to merge 1 commit into
ethereum:forks/amsterdamfrom
Marchhill:tests/eip8037-spill-refund-coverage

Conversation

@Marchhill

@Marchhill Marchhill commented Jul 13, 2026

Copy link
Copy Markdown

Adds tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_spill_refund.py — coverage for EIP-8037 spill-refund accounting shapes that the existing suite does not pin. Cross-client testing of Nethermind's EIP-8037 implementation against EELS surfaced several consensus-relevant divergences (sender over/undercharged, header.gasUsed shifted) that the full tests-glamsterdam-devnet@v6.1.1 fixture suite did not catch — see NethermindEth/nethermind#12369 and NethermindEth/nethermind#12419 (the latter's description lists the divergences).

Scenarios

All run with the tx gas limit well below the EIP-7825 cap, so the reservoir is empty and every state charge spills from gas_left:

  1. Cross-frame refund advance — a contract sets fresh slots (spilled), calls a middle contract that re-enters it to clear them; the refund is credited in the re-entered frame and must discharge through the middle frame's merge. Variants: all frames succeed / top level reverts / middle reverts after the clear (advance revoked, sender pays full state gas for the surviving slots).
  2. Reverted-grandchild spill through child halt — a grandchild's reverted spill must not ride through the child's exceptional halt into the caller's accounting (sender overcharge).
  3. Double-marked refund through child halt — same-frame NEW_ACCOUNT charge-and-refund on a soft-failed value CALL, after importing a reverted child, inside a frame with its own spilled set that later halts.
  4. Top-level halt with burned child spill and intrinsic authorization state gas — type-4 tx with a fresh authority; the burned spill must stay in the regular dimension and the full intrinsic authorization state gas in the state dimension, asserted via block gasUsed.
  5. Partially discharged advance revoked by halt — two clears advanced against one dischargeable set in the middle frame, revoked by the entry frame's exceptional halt; plus a top-level-halt variant combined with (4).

Cover cross-frame restoration-refund advances (discharge, top-level
revert, revocation by a middle-frame revert), reverted-grandchild spill
through a halted child, same-frame NEW_ACCOUNT charge-and-refund on a
soft-failed value call under a later halt, partially discharged
advances revoked by an exceptional halt, and the regular/state split of
burned spill versus intrinsic authorization state gas on a top-level
halt.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Marchhill
Marchhill marked this pull request as ready for review July 13, 2026 18:41
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.

1 participant