Skip to content

chore(tests): sync ported_static tests with forks/amsterdam#2615

Open
leolara wants to merge 26 commits intoethereum:eips/amsterdam/eip-8037from
leolara:wt-static-test-fix-eip-8037
Open

chore(tests): sync ported_static tests with forks/amsterdam#2615
leolara wants to merge 26 commits intoethereum:eips/amsterdam/eip-8037from
leolara:wt-static-test-fix-eip-8037

Conversation

@leolara
Copy link
Copy Markdown
Member

@leolara leolara commented Apr 2, 2026

🗒️ Description

Sync tests/ported_static with forks/amsterdam to fix stale file paths on the EIP-8037 branch. Files that were reorganized upstream (e.g., moved under VMTests/, Cancun/, Shanghai/) were still present at old top-level paths, causing duplicates and divergence.

🔗 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).
  • 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-->

spencer-tb and others added 25 commits March 17, 2026 11:07
…se (ethereum#2363)

* feat(spec-specs): update EIP-8037 to match latest spec revision

* feat(tests): add EIP-8037 state creation gas cost increase tests
Co-authored-by: Ben Adams <thundercat@illyriad.co.uk>
Add sstore_state_gas(), code_deposit_state_gas(), and create_state_gas()
calculator methods to Fork. Replace Spec constants and manual gas
arithmetic across all EIP-8037 tests with dynamic fork method calls.
Remove redundant Op.STOP, hardcoded numbers from docstrings, and add
fork: Fork parameter to all test functions that use fork methods.
Test CREATE with max initcode size using proper regular/state gas
split via the reservoir. Verifies gas boundary behavior with EIP-8037
two-dimensional metering.
Align EIP-8037 gas constant references with upstream renames:
- GAS_STORAGE_UPDATE → GAS_COLD_STORAGE_WRITE
- GAS_COLD_SLOAD → GAS_COLD_STORAGE_ACCESS
- GAS_WARM_ACCOUNT_ACCESS → GAS_WARM_ACCESS

Bump gas_limit on tests added to upstream after EIP-8037 branched,
which now need extra gas for EIP-8037 state gas costs.
… format runs in withdrawal request contract tests (ethereum#2532)

* fix(tests): prevent tx_gas_limit double-accumulation across fixture format runs in withdrawal request contract tests

* fix: mypy

* fix: ruff

* fix: ruff

* chore(tests): refactor fix to fork-aware transactions to prevent mutation

* chore(test): add a warning to all tests that could mutate vars; address in later PR

Add a lightweight repr-based snapshot hook to the filler plugin that warns whenever
any ``pytest.param`` value is mutated during a test run.

A subsequent PR could address this by returning values instead of mutating, then
flipping the hook to a hard failure.

---------

Co-authored-by: fselmo <fselmo2@gmail.com>
… gas validity test (ethereum#2583)

Co-authored-by: Stefan <22667037+qu0b@users.noreply.github.com>
…terdam/eip-8037

# Conflicts:
#	packages/testing/src/execution_testing/forks/base_fork.py
#	packages/testing/src/execution_testing/forks/forks/forks.py
#	src/ethereum/forks/amsterdam/fork.py
#	src/ethereum/forks/amsterdam/transactions.py
#	tests/osaka/eip7825_transaction_gas_limit_cap/test_tx_gas_limit.py
#	tests/prague/eip7702_set_code_tx/test_set_code_txs.py
Conditionally increase tx gas_limit (and env gas_limit where needed)
when fork >= Amsterdam to account for EIP-8037 state creation gas costs.

137 files, 9 with env gas_limit bumps. Headroom: 2,000,000.
Move MAX_CODE_SIZE check before gas charges, charge keccak hash
cost (regular gas) before code deposit state gas, and add tests
for over-max code size and reservoir preservation after OOG.
On CREATE/CREATE2 address collision the 63/64 gas allocation is
burned but was not added to regular_gas_used, leaving it invisible
to 2D block gas accounting. Per EIP-684 collision behaves as an
immediate exceptional halt, so the burned gas belongs in the regular
dimension.
…and subcall pattern

Co-authored-by: Mario Vega <marioevz@gmail.com>
The static test skip list and conftest were a temporary workaround for
EIP-8037 gas failures. The ported static tests in tests/ported_static/
replace this approach; failures are tracked in ethereum#2601.
…thereum#2603)

* fix(execute): use --sender-fund-refund-gas-limit for all funding txs

On EIP-8037 networks, simple value transfers to new accounts require
more than 21000 gas due to GAS_NEW_ACCOUNT state gas (112 * cpsb).
The default Transaction gas_limit of 21000 causes 'intrinsic gas too
low' errors during test setup.

Changes:
- contracts.py: Use 200000 gas for deterministic factory deployer funding
- pre_alloc.py: Pass sender_fund_refund_gas_limit to Alloc and use it
  for simple EOA funding transactions

Usage: --sender-fund-refund-gas-limit 200000

* chore: additional fixes for execute remote funds w/ higher gas limits

* fix: bump all gas limits to 200k for EIP-8037 state creation costs

- sender.py: bump --sender-fund-refund-gas-limit default 21000 → 200000
- pre_alloc.py: bump funding_gas_limit default 21000 → 200000
- pre_alloc.py: use configurable gas limit for per-test refund txs
- execute_recover.py: bump recovery refund gas limit 21000 → 200000

EIP-8037 charges GAS_NEW_ACCOUNT (112 × cost_per_state_byte = 131488)
for transfers to new accounts, making 21000 gas insufficient for all
funding, refund, and recovery transactions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Felipe Selmo <fselmo2@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… gas (ethereum#2595)

Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
@leolara leolara requested a review from spencer-tb April 2, 2026 11:10
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (eips/amsterdam/eip-8037@468e5b2). Learn more about missing BASE report.

Additional details and impacted files
@@                    Coverage Diff                     @@
##             eips/amsterdam/eip-8037    #2615   +/-   ##
==========================================================
  Coverage                           ?   88.17%           
==========================================================
  Files                              ?      524           
  Lines                              ?    31088           
  Branches                           ?     3036           
==========================================================
  Hits                               ?    27412           
  Misses                             ?     3161           
  Partials                           ?      515           
Flag Coverage Δ
unittests 88.17% <ø> (?)

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.

@leolara
Copy link
Copy Markdown
Member Author

leolara commented Apr 2, 2026

@spencer-tb the tests don't pass I guess that is what we want to fix

@kclowes kclowes force-pushed the wt-static-test-fix-eip-8037 branch 2 times, most recently from 0c777fe to 94bcb07 Compare April 2, 2026 22:08
@kclowes
Copy link
Copy Markdown
Contributor

kclowes commented Apr 2, 2026

Sorry for the force pushes @leolara. In hindsight, I should have just made a new branch. Anyway, I tried my hand at fixing a couple tests, if that isn't helpful, feel free to get rid of that commit!

{
"indexes": {"data": [0], "gas": -1, "value": -1},
"network": [">=Amsterdam"],
"result": {contract_12: Account(storage={0: 9089})},
Copy link
Copy Markdown
Contributor

@kclowes kclowes Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regular gas create: 9000 + 89 overhead, the rest comes from state gas now, cancun had create gas of 32000

@leolara
Copy link
Copy Markdown
Member Author

leolara commented Apr 3, 2026

@kclowes I don't think the idea is that here we are fixing the tests, but that I am bringing the tests as they are currently in the default branch

@leolara leolara force-pushed the wt-static-test-fix-eip-8037 branch from 94bcb07 to 8e9cf66 Compare April 3, 2026 09:48
@leolara
Copy link
Copy Markdown
Member Author

leolara commented Apr 3, 2026

@kclowes I had to add more stuff, because still it was different from forks/amsterdam

@leolara
Copy link
Copy Markdown
Member Author

leolara commented Apr 3, 2026

I made a mistake, I was using the wrong branch to get this

@leolara leolara marked this pull request as draft April 3, 2026 10:50
@leolara leolara force-pushed the wt-static-test-fix-eip-8037 branch from 8e9cf66 to 2092450 Compare April 3, 2026 11:00
@leolara leolara marked this pull request as ready for review April 3, 2026 11:00
@leolara
Copy link
Copy Markdown
Member Author

leolara commented Apr 7, 2026

Sorry, I made comments here that were about a different PR: #2535

@marioevz marioevz force-pushed the eips/amsterdam/eip-8037 branch 2 times, most recently from 629b34b to 9755dba Compare April 10, 2026 22:19
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.

5 participants