refactor(test-tests): migrate amsterdam gas costs to use bytecode.gas_cost(fork)#2186
Conversation
847927f to
3fb99d9
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 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
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:
|
310838c to
e588295
Compare
fselmo
left a comment
There was a problem hiding this comment.
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 🚀
🗒️ Description
Migrate Amsterdam EIP-7928 block access list tests from manual
fork.gas_costs()calculations 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 only difference is
test_bal_noop_storage_writewhich 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'sopcode_gas_map(), so future gas schedule changes only need updating in one place.The single remaining
fork.gas_costs().G_CALL_STIPENDreference is intentional — it's a threshold check, not a gas cost.🔗 Related Issues or PRs
Partially fixes #2049.
✅ Checklist
toxchecks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx tox -e statictype(scope):.Cute Animal Picture