Skip to content

refactor(test-tests): migrate amsterdam gas costs to use bytecode.gas_cost(fork)#2186

Merged
fselmo merged 2 commits intoethereum:forks/amsterdamfrom
spencer-tb:chore/migrate-gas-costs-amsterdam
Feb 11, 2026
Merged

refactor(test-tests): migrate amsterdam gas costs to use bytecode.gas_cost(fork)#2186
fselmo merged 2 commits intoethereum:forks/amsterdamfrom
spencer-tb:chore/migrate-gas-costs-amsterdam

Conversation

@spencer-tb
Copy link
Contributor

@spencer-tb spencer-tb commented Feb 11, 2026

🗒️ Description

Migrate Amsterdam EIP-7928 block access list tests from manual fork.gas_costs() calculations to bytecode.gas_cost(fork).

This is a pure refactor with no functional change, all exact gas-boundary test fixtures produce identical output (verified via fixture hash comparison). The only difference is test_bal_noop_storage_write which uses a non-exact generous gas limit, the value changed but both old and new are sufficient for the test to pass.

The benefit is maintainability: tests now declare intent via opcode metadata (e.g., address_warm=False, value_transfer=True) and delegate gas calculation to the framework's opcode_gas_map(), so future gas schedule changes only need updating in one place.

The single remaining fork.gas_costs().G_CALL_STIPEND reference is intentional — it's a threshold check, not a gas cost.

🔗 Related Issues or PRs

Partially fixes #2049.

✅ Checklist

  • All: Ran fast tox checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    uvx tox -e static
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).

Cute Animal Picture

butterfree

@spencer-tb spencer-tb force-pushed the chore/migrate-gas-costs-amsterdam branch from 847927f to 3fb99d9 Compare February 11, 2026 13:27
@spencer-tb spencer-tb added C-refactor Category: refactor A-test-tests Area: tests for packages/testing P-medium labels Feb 11, 2026
@marioevz marioevz requested a review from fselmo February 11, 2026 13:53
@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.07%. Comparing base (1140c0e) to head (e588295).
⚠️ Report is 30 commits behind head on forks/amsterdam.

Additional details and impacted files
@@               Coverage Diff                @@
##           forks/amsterdam    #2186   +/-   ##
================================================
  Coverage            86.07%   86.07%           
================================================
  Files                  599      599           
  Lines                39472    39472           
  Branches              3780     3780           
================================================
  Hits                 33977    33977           
  Misses                4862     4862           
  Partials               633      633           
Flag Coverage Δ
unittests 86.07% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fselmo fselmo force-pushed the chore/migrate-gas-costs-amsterdam branch from 310838c to e588295 Compare February 11, 2026 19:59
Copy link
Contributor

@fselmo fselmo left a comment

Choose a reason for hiding this comment

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

lgtm @spencer-tb! I added a DRYing commit on top of this removing some Bytecode wrapping / duplication as we can add metadata inline and not repeat it. I saw @marioevz made some similar changes in the other refactoring PRs (e.g. #2191 (comment)).

I also re-checked the gas boundaries with traces and everything looks good after the refactor. Thanks for getting this in 🚀

@fselmo fselmo merged commit a8025c6 into ethereum:forks/amsterdam Feb 11, 2026
15 checks passed
@fselmo fselmo deleted the chore/migrate-gas-costs-amsterdam branch February 11, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-test-tests Area: tests for packages/testing C-refactor Category: refactor P-medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(test-tests): migrate tests from fork.gas_costs to bytecode.gas_cost(fork)

2 participants