fix(ported_static): bump gas budgets for EIP-8037 state-gas headroom on Amsterdam#2796
fix(ported_static): bump gas budgets for EIP-8037 state-gas headroom on Amsterdam#2796leolara wants to merge 1 commit intoethereum:devnets/bal/7from
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## devnets/bal/7 #2796 +/- ##
================================================
Coverage ? 85.58%
================================================
Files ? 630
Lines ? 39600
Branches ? 3936
================================================
Hits ? 33891
Misses ? 5084
Partials ? 625
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:
|
…on Amsterdam
EIP-8037's two-dimensional gas model raises NEW_ACCOUNT state gas
(112 × cost_per_state_byte = 131 488) and per-storage-set state gas
(32 × cpsb = 37 568). Several ported_static tests were authored
against the pre-EIP-8037 gas budgets, where these state-gas costs
didn't exist; on Amsterdam they OoG before reaching the operations
the test exercises (SELFDESTRUCT-to-empty, nested CREATE, init-code
SSTORE, multi-CREATE wallet construction, ...). Cancun/Prague/Osaka
post-state expectations are unaffected — the helpers return 0 for
state gas there, so the same code path runs on the same budget.
Bump the relevant `tx_gas` (or inner CALL gas) on tests where:
- the failure is a CREATE/SELFDESTRUCT path running out of state-gas
headroom (not a refund/coinbase accounting shift), and
- the bump preserves the test's intent (post-state on all forks
unchanged; the OoG-by-design parametrizations, where applicable,
keep their original budget).
Each modified file gets a `@manually-enhanced` docstring marker so a
future regenerator skips them.
Files modified (10) and skip-list entries dropped (24):
- stCreate2/test_create2collision_selfdestructed{,2}.py
- stCreate2/test_create2_smart_init_code.py
- stCreate2/test_create2_contract_suicide_during_init_then_store_then_return.py
- stCreateTest/test_create_transaction_call_data.py
- stRevertTest/test_revert_opcode_in_init.py
- stSStoreTest/test_sstore_change_from_external_call_in_init_code.py
- stInitCodeTest/test_call_the_contract_to_create_empty_contract.py
- stWalletTest/test_{day_limit,wallet}_construction.py
Verified: all 10 files, --fork Amsterdam and --fork Cancun, 102 passed
0 failed. Reduces the still-failing fork_Amsterdam parametrization
count by 57 (1 269 -> 1 212).
Out of scope for this branch: tests where the post-state mismatch is
a coinbase-balance shift (formula-derived fix territory, like ethereum#2790),
tests where OoG/revert is the test premise, and the bulk
KeyValueMismatchError cluster (1 036) which needs a different fix
shape entirely.
cc41427 to
052496d
Compare
| # { (CALL 150000 0xc94f5374fce5edbc8e2a8697c15331677e6ebf0b 1 0 0 0 32) (SSTORE 1 (MLOAD 0)) } # noqa: E501 | ||
| contract_0 = pre.deploy_contract( # noqa: F841 | ||
| code=Op.POP( | ||
| Op.CALL( | ||
| gas=0x249F0, | ||
| gas=0x100000, |
There was a problem hiding this comment.
Can we create a call_gas variable that has a different value depending on whether EIP-8037 is enabled in the fork where the test is being executed?
call_gas = 0x249F0
if fork.is_eip_enabled(8037):
call_gas = 0x100000
# { (CALL 150000 0xc94f5374fce5edbc8e2a8697c15331677e6ebf0b 1 0 0 0 32) (SSTORE 1 (MLOAD 0)) } # noqa: E501
contract_0 = pre.deploy_contract( # noqa: F841
code=Op.POP(
Op.CALL(
gas=call_gas,This will allow us to preserve the original gas value in case we need to do further modifications, and it also makes it more clear why this gas bump was done in the first place.
There was a problem hiding this comment.
Same comment for the rest of the tests.
🗒️ Description
Bump gas budgets in 10
tests/ported_static/files so they pass onfork_Amsterdamunder EIP-8037's two-dimensional gas model. Each changed file gets@manually-enhancedso future regenerator runs skip them. Drop 24 corresponding entries fromamsterdam_skip_list.txt.Why
EIP-8037 raises
NEW_ACCOUNTstate gas to112 × cost_per_state_byte = 131 488and per-storage-set state gas to32 × cpsb = 37 568. The affected tests were authored against pre-EIP-8037 gas budgets; on Amsterdam they OoG before reaching the operation the test exercises (SELFDESTRUCT-to-empty, nested CREATE, init-code SSTORE, multi-CREATE wallet construction, …).On Cancun / Prague / Osaka the same
Fork.create_state_gas/sstore_state_gashelpers return 0, so the bumped budget runs the same code path on the same accounting — no observable difference.What changed
stCreate2/test_create2collision_selfdestructed.py400 000 → 1 000 0000xC350 → 0x40000(3×)stCreate2/test_create2collision_selfdestructed2.py400 000 → 1 000 0000xC350 → 0x40000(2×)stCreate2/test_create2_smart_init_code.py400 000 → 1 000 000stCreate2/test_create2_contract_suicide_during_init_then_store_then_return.py600 000 → 5 000 0000x249F0 → 0x100000stCreateTest/test_create_transaction_call_data.py100 000 → 500 000stRevertTest/test_revert_opcode_in_init.py160 000 → 800 000stSStoreTest/test_sstore_change_from_external_call_in_init_code.py200 000 → 1 000 000stInitCodeTest/test_call_the_contract_to_create_empty_contract.py100 000 → 500 000stWalletTest/test_day_limit_construction.py[817 083, 1 217 083] → [5 000 000, 7 000 000]stWalletTest/test_wallet_construction.py[1 225 023, 1 825 023] → [6 000 000, 8 000 000]Verification
uv run fill <all 10 files> --fork Amsterdam --output ... --clean -n 4:Same on
--fork Cancun(102 passed, 1.99 s) — confirms the bumps don't change the test outcome on earlier forks.Reduces the
amsterdam_skip_list.txtfrom 5 458 to 5 445 entries (24 removed; 13 had already been pruned in the corresponding pre-@manually-enhancedcleanup).What is not in this PR
Discovered while triaging: 7 files where a gas bump did let the tx run, but surfaced a post-state mismatch (coinbase-balance shift, refund-residue accounting, env-
gas_limit-is-the-test-parameter, etc.) that can't be fixed without changing the test's premise. Those need either a fork-conditional formula in the post-state (the PR #2790 pattern) or per-parametrization analysis. They're documented under "Tried gas-bump, found NOT simple" in.mb/sync-ported-static-snobal-4/skipped-failures.md(not committed).The bulk
KeyValueMismatchErrorcluster (1 036 parametrizations) is also out of scope — different fix family.🔗 Related Issues or PRs
devnets/snøbal/4directly (none of the modified files are touched by chore(ported_static): sync from forks/amsterdam onto snøbal/6 #2783).✅ Checklist
just statictype(scope):.mkdocs servelocally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.@ported_frommarker.