Skip to content

refactor(testing): Refactor Initcode to allign gas_cost behavior with Bytecode#2201

Merged
marioevz merged 4 commits intoethereum:forks/amsterdamfrom
marioevz:refactor-initcode
Feb 12, 2026
Merged

refactor(testing): Refactor Initcode to allign gas_cost behavior with Bytecode#2201
marioevz merged 4 commits intoethereum:forks/amsterdamfrom
marioevz:refactor-initcode

Conversation

@marioevz
Copy link
Member

🗒️ Description

Refactors on top of #2176 to align behavior of Initcode.gas_cost with what is normally expected of Bytecode.gas_cost.

Method gas_cost now correctly returns the full cost of executing the initcode including the code deposit.

execution_gas and deployment_gas, previously set during instantiation, are now public methods which take the fork as parameter and return the gas cost excluding the code deposit and the code deposit cost, respectively.

The fork parameter requirement was removed from the instantiation of Initcode.

🔗 Related Issues or PRs

N/A.

✅ 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).
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.
  • Tests: For PRs implementing a missed test case, update the post-mortem document to add an entry the list.
  • Ported Tests: All converted JSON/YML tests from ethereum/tests or tests/static have been assigned @ported_from marker.

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@marioevz marioevz requested a review from fselmo February 12, 2026 18:27
@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.07%. Comparing base (8e276dc) to head (9800019).
⚠️ Report is 1 commits behind head on forks/amsterdam.

Additional details and impacted files
@@               Coverage Diff                @@
##           forks/amsterdam    #2201   +/-   ##
================================================
  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.

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! Left some nits but nothing blocking 👍🏼

@marioevz marioevz merged commit 4714700 into ethereum:forks/amsterdam Feb 12, 2026
18 checks passed
@marioevz marioevz deleted the refactor-initcode branch February 13, 2026 00:32
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