Skip to content

refactor(spec-specs): remove unused regular gas constants in amsterdam#2971

Merged
spencer-tb merged 1 commit into
ethereum:forks/amsterdamfrom
danceratopz:gas-constant-cleanup
Jun 10, 2026
Merged

refactor(spec-specs): remove unused regular gas constants in amsterdam#2971
spencer-tb merged 1 commit into
ethereum:forks/amsterdamfrom
danceratopz:gas-constant-cleanup

Conversation

@danceratopz

@danceratopz danceratopz commented Jun 10, 2026

Copy link
Copy Markdown
Member

🗒️ Description

Removes four regular gas constants from forks/amsterdam that became unreferenced when EIP-8037 (#2901) moved the corresponding charges to state gas (StateGasCosts):

  • GasCosts.STORAGE_SET (20000): SSTORE set-from-zero now charges StateGasCosts.STORAGE_SET.
  • GasCosts.NEW_ACCOUNT (25000): CALL*/SELFDESTRUCT/creation account charges now use StateGasCosts.NEW_ACCOUNT.
  • GasCosts.AUTH_PER_EMPTY_ACCOUNT (25000): Per-authorization costs are now split into PER_AUTH_BASE_COST (regular) and StateGasCosts.NEW_ACCOUNT + StateGasCosts.AUTH_BASE (state).
  • GasCosts.OPCODE_SELFDESTRUCT_NEW_ACCOUNT (25000): Folded into the state-gas charge above.

Pure dead-code removal with no behavior change. Verified each constant has no remaining references within forks/amsterdam; earlier forks keep their own copies per the WET principle.

🔗 Related Issues or PRs

Follow-up to #2901.

✅ Checklist

  • All: Ran fast static checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    just 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

image

EIP-8037 moved the new-account, storage-set, selfdestruct new-account
and per-empty-authorization charges to state gas (`StateGasCosts`),
leaving their legacy regular-gas counterparts unreferenced:

- `GasCosts.STORAGE_SET` (20000)
- `GasCosts.NEW_ACCOUNT` (25000)
- `GasCosts.AUTH_PER_EMPTY_ACCOUNT` (25000)
- `GasCosts.OPCODE_SELFDESTRUCT_NEW_ACCOUNT` (25000)

Remove them to avoid confusion with the state-gas values now in use.
@danceratopz danceratopz added A-spec-specs Area: Specification—The Ethereum specification itself (eg. `src/ethereum/*`) C-refactor Category: refactor labels Jun 10, 2026
@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.52%. Comparing base (84e39e1) to head (7bbee20).
⚠️ Report is 1 commits behind head on forks/amsterdam.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           forks/amsterdam    #2971      +/-   ##
===================================================
- Coverage            90.53%   90.52%   -0.01%     
===================================================
  Files                  535      535              
  Lines                32897    32893       -4     
  Branches              3021     3021              
===================================================
- Hits                 29782    29778       -4     
  Misses                2596     2596              
  Partials               519      519              
Flag Coverage Δ
unittests 90.52% <ø> (-0.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.

@danceratopz danceratopz changed the title refactor(specs): remove unused regular gas constants in amsterdam refactor(spec-specs): remove unused regular gas constants in amsterdam Jun 10, 2026

@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!

@spencer-tb spencer-tb merged commit 5f132e7 into ethereum:forks/amsterdam Jun 10, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-spec-specs Area: Specification—The Ethereum specification itself (eg. `src/ethereum/*`) C-refactor Category: refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants