Skip to content

refactor(tests): separate the gas window and receipt tests - #3512

Merged
spencer-tb merged 1 commit into
ethereum:forks/amsterdamfrom
chfast:eip8037-separate-window-and-receipt-tests
Sep 3, 2026
Merged

refactor(tests): separate the gas window and receipt tests#3512
spencer-tb merged 1 commit into
ethereum:forks/amsterdamfrom
chfast:eip8037-separate-window-and-receipt-tests

Conversation

@chfast

@chfast chfast commented Sep 3, 2026

Copy link
Copy Markdown
Member

Description

Four tests each asserted a gas window measuring where a merged refund sits and a receipt measuring what the sender pays. The window changes under the merge-time repayment of ethereum/EIPs#12265, the receipt must not. Asserted together, the receipt could only be read from a test that change makes fail.

Split each in two. The tests keeping the receipt drop the GAS stamps and the result slot, so one fewer slot survives and their sums stop carrying the probe overhead. With the src/ change of #3478 applied, the failing tests are exactly the ones measuring a window, so the module docstring's claim that the two are independent is now checked.

Extract what the halves share as clearing_child_code, clearing_child_storage and delegation_to, and name the budget leaving a storing child more than the call stipend budget_above_sstore_stipend. It was open-coded ten times. The two SSTORE metadata forms spelled out eleven times become FRESH_SET and WARM_CLEAR, and window_cost_excess loses its metadata parameter now that no receipt sum reads a measured frame. Fixtures for every pre-existing test are unchanged.

Related Issues or PRs

N/A.

Checklist

  • Ran fast static checks to avoid CI fails, see Code Standards & Verifying Changes: just static
  • PR title has the form <type>(<area>): <title>, where <type> and <area> come from an appropriate C-<type>, respectively A-<area>, label. The title should match the target squash commit message.

Four tests each asserted a gas window measuring where a merged refund
sits and a receipt measuring what the sender pays. The window changes
under the merge-time repayment of ethereum/EIPs#12265, the receipt
must not. Asserted together, the receipt could only be read from a
test that change makes fail.

Split each in two. The tests keeping the receipt drop the `GAS` stamps
and the result slot, so one fewer slot survives and their sums stop
carrying the probe overhead. With the `src/` change of ethereum#3478 applied,
the failing tests are exactly the ones measuring a window, so the
module docstring's claim that the two are independent is now checked.

Extract what the halves share as `clearing_child_code`,
`clearing_child_storage` and `delegation_to`, and name the budget
leaving a storing child more than the call stipend
`budget_above_sstore_stipend`. It was open-coded ten times. The two
`SSTORE` metadata forms spelled out eleven times become `FRESH_SET`
and `WARM_CLEAR`, and `window_cost_excess` loses its metadata
parameter now that no receipt sum reads a measured frame. Fixtures for
every pre-existing test are unchanged.
@chfast

chfast commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

Mostly AI generated, so if you think to big / not worth review then fine.

@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.01%. Comparing base (1855bb1) to head (6f31318).

Additional details and impacted files
@@               Coverage Diff                @@
##           forks/amsterdam    #3512   +/-   ##
================================================
  Coverage            94.01%   94.01%           
================================================
  Files                  624      624           
  Lines                36905    36905           
  Branches              3326     3326           
================================================
  Hits                 34695    34695           
  Misses                1533     1533           
  Partials               677      677           
Flag Coverage Δ
unittests 94.01% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@spencer-tb spencer-tb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks Pawel+AI co :)

@spencer-tb
spencer-tb merged commit b462ba2 into ethereum:forks/amsterdam Sep 3, 2026
17 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