refactor(test-tests): migrate cancun to osaka gas costs to bytecode.gas_cost(fork)#2191
Merged
marioevz merged 5 commits intoethereum:forks/amsterdamfrom Feb 11, 2026
Conversation
…ode.gas_cost(fork)`
61 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #2191 +/- ##
================================================
Coverage 86.07% 86.07%
================================================
Files 599 599
Lines 39472 39472
Branches 3780 3780
================================================
Hits 33977 33977
Misses 4862 4862
Partials 633 633
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bytecode.gas_cost(fork)
Member
|
Have not reviewed yet but did a push of a commit to remove the |
4 tasks
marioevz
reviewed
Feb 11, 2026
tests/cancun/eip1153_tstore/test_tstorage_execution_contexts.py
Outdated
Show resolved
Hide resolved
marioevz
approved these changes
Feb 11, 2026
tests/osaka/eip7825_transaction_gas_limit_cap/test_tx_gas_limit.py
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🗒️ Description
Migrate Cancun, Prague, and Osaka test files from manual
fork.gas_costs()/ hardcodedSpecconstants tobytecode.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 benefit is maintainability: tests now declare intent via opcode metadata (e.g.,
address_warm=False,key_warm=True) and delegate gas calculation to the framework'sopcode_gas_map(), so future gas schedule changes only need updating in one place.Files migrated:
tests/cancun/eip1153_tstore/test_basic_tload.pytests/cancun/eip1153_tstore/test_tstorage.pytests/cancun/eip1153_tstore/test_tstorage_execution_contexts.pytests/cancun/eip4844_blobs/test_blobhash_opcode.pytests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.pytests/prague/eip7702_set_code_tx/test_eip_mainnet.pytests/prague/eip7702_set_code_tx/test_gas.pytests/prague/eip7702_set_code_tx/test_set_code_txs.pytests/prague/eip7702_set_code_tx/test_set_code_txs_2.pytests/prague/eip7623_increase_calldata_cost/test_refunds.pytests/osaka/eip7823_modexp_upper_bounds/conftest.pytests/osaka/eip7825_transaction_gas_limit_cap/test_tx_gas_limit.pytests/osaka/eip7883_modexp_gas_increase/conftest.pytests/osaka/eip7883_modexp_gas_increase/test_modexp_thresholds_transition.pyRemaining
fork.gas_costs()references are intentional:R_STORAGE_CLEAR,R_AUTHORIZATION_EXISTING_AUTHORITY), not opcode costsG_TX_DATA_FLOOR_TOKEN_COST,G_ACCESS_LIST_ADDRESS,G_ACCESS_LIST_STORAGE), not expressible viabytecode.gas_cost(fork)🔗 Related Issues or PRs
Partially fixes #2049.
✅ Checklist
toxchecks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:type(scope):.Cute Animal Picture