Skip to content

feat(tests): port EXTCODEHASH dynamicAccountOverwriteEmpty#2032

Merged
danceratopz merged 1 commit into
ethereum:forks/amsterdamfrom
ipsilon:tests/port_account_overwrite
Feb 24, 2026
Merged

feat(tests): port EXTCODEHASH dynamicAccountOverwriteEmpty#2032
danceratopz merged 1 commit into
ethereum:forks/amsterdamfrom
ipsilon:tests/port_account_overwrite

Conversation

@chfast

@chfast chfast commented Jan 17, 2026

Copy link
Copy Markdown
Member

🗒️ Description

Port the legacy static test:
stExtCodeHash/dynamicAccountOverwriteEmpty_Paris
for EIP-1052 EXTCODEHASH testing.

The test verifies EXTCODEHASH correctly updates when an empty account is overwritten by CREATE2. Modified from original: target account has no storage to avoid EIP-7610 collision behavior.

🔗 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 adding an entry to CHANGELOG.md.
  • 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-->

Copilot AI review requested due to automatic review settings January 17, 2026 10:19
@chfast chfast force-pushed the tests/port_account_overwrite branch from 8c9db98 to 55295bf Compare January 17, 2026 10:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@codecov

codecov Bot commented Jan 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.85%. Comparing base (04fb242) to head (7e566ba).

Additional details and impacted files
@@               Coverage Diff                @@
##           forks/amsterdam    #2032   +/-   ##
================================================
  Coverage            85.85%   85.85%           
================================================
  Files                  599      599           
  Lines                39428    39428           
  Branches              3776     3776           
================================================
  Hits                 33851    33851           
  Misses                4946     4946           
  Partials               631      631           
Flag Coverage Δ
unittests 85.85% <ø> (ø)

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.

@danceratopz danceratopz self-assigned this Jan 19, 2026

@LouisTsai-Csie LouisTsai-Csie left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the PR! I’ve left a few comments suggesting some refactoring using helper functions. Overall, the test logic looks great.

Comment thread tests/constantinople/eip1052_extcodehash/test_extcodehash.py
Comment thread tests/constantinople/eip1052_extcodehash/test_extcodehash.py Outdated
Comment thread tests/constantinople/eip1052_extcodehash/test_extcodehash.py
Comment thread tests/constantinople/eip1052_extcodehash/test_extcodehash.py Outdated
Comment thread tests/constantinople/eip1052_extcodehash/test_extcodehash.py
Comment thread tests/constantinople/eip1052_extcodehash/test_extcodehash.py Outdated
jsign pushed a commit to jsign/execution-specs that referenced this pull request Jan 20, 2026
…ing pre-alloc groups (ethereum#2032)

* feat(FixtureCollector): Add flush interval to the fixture collector

* fix: typing

* fix: typing

* fix: unit test
@chfast chfast force-pushed the tests/port_account_overwrite branch 2 times, most recently from ef406d9 to 9eaaf43 Compare January 24, 2026 13:32
@chfast chfast requested a review from Copilot January 24, 2026 13:36
@chfast chfast force-pushed the tests/port_account_overwrite branch from 9eaaf43 to 84a2f78 Compare January 24, 2026 13:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@LouisTsai-Csie LouisTsai-Csie left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I leave a comment about the potential missing coverage for non-empty storage scenario. In the deleted tests/static/state_tests/stExtCodeHash/dynamicAccountOverwriteEmpty_ParisFiller.ym file, i found this pre-alloc setting:

# non-empty storage for target account
c5691dc90d9fd2a2e9a5fa5bd28bf77ffd60aa78:
  balance: '10'
  code: ''
  nonce: '0'
  storage: {
     "0x01": '1'
  }

while in the test this logic is removed.

Comment on lines +30 to +33
@pytest.mark.parametrize(
"target_exists",
[True, False],
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The new test format looks good, but in the legacy test the target account (created via CREATE2) had pre-existing storage. We’ve removed that setup, do we lose the coverage here?

I now understand why pytest.mark.pre_alloc_modify is required: we want to configure an account storage via pre.

I’m thinking of parameterizing the cases like this:

@pytest.mark.parametrize(
    "exist_balance, exist_storage",
    [
        pytest.param(True, True, id="collision", marks=pytest.mark.pre_alloc_modify),
        pytest.param(True, False, id="balance_only"),
        pytest.param(False, False, id="non_existent"),
    ],
)

And configuring pre like:

if exist_storage:
    pre[target_address] = Account(balance=10, storage={0: 1})
elif exist_balance:
    pre.fund_address(target_address, 1)

However, this setting keeps failing in fill: it looks like t8n doesn’t handle the initial storage + nonce=0 scenario as I expected. Am I missing something in how pre-state is applied here?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We could add multiple markers like this, for the pre-alloc modification, we should also skip the execute-remote mode.

pytest.param(
  True,
  True,
  id="collision",
  marks=[
      pytest.mark.pre_alloc_modify,
      pytest.mark.execute(
          pytest.mark.skip(reason="pre-alloc modified")
      ),
  ],
),

@chfast

chfast commented Jan 27, 2026

Copy link
Copy Markdown
Member Author

I leave a comment about the potential missing coverage for non-empty storage scenario. In the deleted tests/static/state_tests/stExtCodeHash/dynamicAccountOverwriteEmpty_ParisFiller.ym file, i found this pre-alloc setting:

# non-empty storage for target account
c5691dc90d9fd2a2e9a5fa5bd28bf77ffd60aa78:
  balance: '10'
  code: ''
  nonce: '0'
  storage: {
     "0x01": '1'
  }

while in the test this logic is removed.

I dropped the "empty account with storage" because it actually prevents the original scenario. If there is storage, CREATE2 fails. Moreover, the EIP-7610 which describes what happens in this scenario is not final. This is my main motivation for the porting.

I believe if you want test EXTCODEHASH against "empty account with storage" we need separate test. Something that don't overwrite the account with CREATE2.

@chfast

chfast commented Feb 5, 2026

Copy link
Copy Markdown
Member Author

Ping.

@spencer-tb spencer-tb added C-feat Category: an improvement or new feature A-test-tests Area: tests for packages/testing labels Feb 19, 2026
@spencer-tb spencer-tb changed the title refactor(test-tests): port EXTCODEHASH dynamicAccountOverwriteEmpty feat(test-tests): port EXTCODEHASH dynamicAccountOverwriteEmpty Feb 19, 2026

@danceratopz danceratopz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @chfast! I checked the traces and indeed the original tests went OOG and didn't even test the intended behavior. The new Python versions do. The comments below are v minor nits.

I rebased to forks/amsterdam to add these on top of #2237 and #2249, but don't have rights to push to this branch. Please enable the rights or rebase this branch.

@LouisTsai-Csie could you please re-review and retract your "Requested Changes"?

Comment thread tests/constantinople/eip1052_extcodehash/__init__.py Outdated
Comment thread tests/constantinople/eip1052_extcodehash/test_extcodehash.py Outdated
Comment thread tests/constantinople/eip1052_extcodehash/test_extcodehash.py Outdated
Comment thread tests/constantinople/eip1052_extcodehash/test_extcodehash.py Outdated
@danceratopz danceratopz changed the title feat(test-tests): port EXTCODEHASH dynamicAccountOverwriteEmpty feat(tests): port EXTCODEHASH dynamicAccountOverwriteEmpty Feb 23, 2026
@danceratopz danceratopz added A-tests Area: Consensus tests. and removed A-test-tests Area: tests for packages/testing labels Feb 23, 2026
Port the legacy static test:
stExtCodeHash/dynamicAccountOverwriteEmpty_Paris
for EIP-1052 EXTCODEHASH testing.

The test verifies EXTCODEHASH correctly updates when an empty account is
overwritten by CREATE2. Modified from original: target account has no
storage to avoid EIP-7610 collision behavior.

@LouisTsai-Csie LouisTsai-Csie left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, thank you!

@danceratopz danceratopz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @chfast!

@danceratopz danceratopz merged commit cdf9add into ethereum:forks/amsterdam Feb 24, 2026
14 checks passed
kevaundray added a commit to kevaundray/execution-specs that referenced this pull request Feb 28, 2026
commit a48c892
Author: Kevaundray Wedderburn <kevtheappdev@gmail.com>
Date:   Fri Feb 27 17:39:02 2026 +0000

    introduce BlockDiff

commit a4a4b47
Merge: e801c45 5034aa2
Author: Kevaundray Wedderburn <kevtheappdev@gmail.com>
Date:   Tue Feb 24 23:25:33 2026 +0000

    Merge remote-tracking branch 'upstream/forks/amsterdam' into kw/extract-stateless-functionality

commit e801c45
Author: Kevaundray Wedderburn <kevtheappdev@gmail.com>
Date:   Tue Feb 24 23:14:11 2026 +0000

    add doc comments for ChainContext fields

commit de68f63
Author: Kevaundray Wedderburn <kevtheappdev@gmail.com>
Date:   Tue Feb 24 22:57:06 2026 +0000

    initial commit

commit 5034aa2
Author: kevaundray <kevtheappdev@gmail.com>
Date:   Tue Feb 24 22:56:44 2026 +0000

    chore(ci): Skip diffs if not on default branch (ethereum#2304)

    * skip diffs

    * Update .github/workflows/gh-pages.yaml

    Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>

    * revert: actionlint

    ---------

    Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>

commit 7ca499e
Author: danceratopz <danceratopz@gmail.com>
Date:   Tue Feb 24 20:06:22 2026 +0100

    feat(test-fill,test-benchmark): organize fixtures into fork and gas-limit subdirs (ethereum#2134)

    * feat(test-benchmark): split gas benchmark outputs by subdir

    * docs(test-benchmark): document gas benchmark output layout

    * test(test-benchmark): verify gas benchmark subdir layout

    * feat(test-benchmark): update folder structure according to review

    * refactor(test-filler): move fixture_output to shared

    Move FixtureOutput from filler/ to shared/ and absorb fixture_naming.py.
    This prepares for future build-tool plugins that also generate fixtures.

    * feat(test-filler): organize fill fixture output by target fork

    Always include the gas-limit suffix in the fork output subdirectory,
    not just for benchmark tests. Non-benchmark (consensus) tests now also
    get a subdirectory like `for_prague_at_0120M/` using the environment
    default gas limit (respecting `--block-gas-limit`).

    The `_at_` separator makes the directory name unambiguous:
      for_{fork}_at_{gas}M   (e.g. for_prague_at_0120M)

    * docs(releases): document fixture output directory layout

    Add a "Fixture Output Directory Structure" section explaining the
    for_{fork}_at_{gas}M subdirectory convention, default gas limit, and
    how benchmark tests use --gas-benchmark-values.

    * feat(test-filler): drop gas limit from consensus fixture subdirs

    Consensus fixtures now use `for_{fork}/` (e.g. `for_prague/`) instead of
    `for_{fork}_at_{gas}M/`. Benchmark fixtures keep the gas limit suffix.

    * feat(test-filler): use fixture_subfolder marker for output subdirs

    Replace manual gas-benchmark detection in the filler with a composable
    pytest.mark.fixture_subfolder(level, prefix) marker:

    - Add level-0 marker (fork prefix) in fork parametrization.
    - Add level-1 marker in GasBenchmarkValues and OpcodeCountsConfig.
    - Resolve output subdirs from markers in filler instead of hard-coding.
    - Break circular import so collector can share the separator constant.
    - Register the marker in execute_fill alongside other shared markers.

    * feat(test-tests): add fixed-opcode-count subdirectory output test

    - Verify --fixed-opcode-count splits fixtures into per-count subdirs.
    - Mirror the existing gas-benchmark subdir test for opcode counts.

    * fix(test-fill): fix-up typehints for mypy

    * fix(test-fill): remove dead code and tighten types

    - Remove unused `should_auto_enable_all_formats` property.
    - Remove unused `format_gas_limit_subdir()` function.
    - Remove unreachable `FORK_SUBDIR_PREFIX` check in post-merge
      verification (format dir is always at `parts[0]`).
    - Tighten `resolve_fixture_subfolder` parameter from `list` to
      `list[pytest.Mark]`.
    - Clarify "benchmark" prefix stripping in collector with comment.

    * docs(test-fill): update docs for fixed-opcode-count fixture dir layout

    * fix: static tests

    ---------

    Co-authored-by: Mario Vega <marioevz@gmail.com>

commit 84025b7
Author: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
Date:   Tue Feb 24 14:05:19 2026 -0500

    chore: bump docc version (ethereum#2303)

commit 4fff5eb
Author: Mario Vega <marioevz@gmail.com>
Date:   Tue Feb 24 19:30:35 2026 +0100

    feat(test-execute): Support `testing_buildBlockV1` (ethereum#2295)

    * feat(test-rpc): Add `Testing` namespace

    * nit: transactions parameter

    * feat(test-execute): Support `testing_buildBlockV1`

    * docs

    * refactor(execute): Testing endpoint non-auth

    * review comments

    Co-authored-by: fselmo <fselmo2@gmail.com>

    ---------

    Co-authored-by: fselmo <fselmo2@gmail.com>

commit 7329095
Author: Carson <carson@ethereum.org>
Date:   Tue Feb 24 12:29:35 2026 -0500

    refactor(test): rename/align gas cost constants (ethereum#2094)

    - rename base gas cost
    - rename very low gas cost
    - rename memory gas cost
    - rename copy gas cost
    - rename low gas cost
    - rename medium gas cost
    - rename high gas cost
    - rename warm access gas cost
    - rename cold access gas cost
    - rename storage reset gas cost
    - rename storage clear gas cost
    - rename storage set gas cost
    - rename warm account gas cost
    - rename cold account gas cost
    - rename initcode word gas cost
    - rename code deposit gas cost
    - rename create gas cost
    - rename call stipen gas cost
    - rename selfdestruct gas cost
    - rename call value gas cost
    - rename new account gas cost
    - rename exp gas cost
    - rename exp per byte gas cost
    - rename keccak256 gas cost
    - rename keccak256 word gas cost
    - rename blockhash gas cost
    - rename log data gas cost
    - rename log gas cost
    - rename log topic gas cost
    - rename tx based gas cost
    - rename contract creation gas cost
    - rename access list addr gas cost
    - rename access list storage gas cost
    - rename floor calldata gas cost
    - rename token standard gas cost
    - rename authorize gas cost
    - rename authorize base cost
    - rename data zero gas cost
    - rename non-zero data gas cost
    - rename blob gas per block gas cost
    - rename blob min price gas cost
    - rename all precompile gas costs
    - (refactor) TX_ACCESS_LIST_ADDRESS_COST => GAS_TX_ACCESS_LIST_ADDRESS
    - (refactor) GAS_CODE_DEPOSIT => GAS_CODE_DEPOSIT_PER_BYTE
    - (refactor) remove unnecessary Uint cast for REFUND_STORAGE_CLEAR
    - (refactor) TX_ACCESS_LIST_STORAGE_KEY_COST => GAS_TX_ACCESS_LIST_STORAGE_KEY
    - (refactor) GAS_KECCAK256_WORD => GAS_KECCAK256_PER_WORD
    - (refactor) TX_BASE_COST => GAS_TX_BASE
    - (refactor) TX_CREATE_COST => GAS_TX_CREATE
    - (refactor) TX_DATA_STANDARD_TOKEN_COST => GAS_TX_DATA_TOKEN_STANDARD
    - (refactor) => TX_DATA_FLOOR_TOKEN_COST => GAS_TX_DATA_TOKEN_FLOOR
    - (refactor) GAS_INIT_CODE_WORD_COST => GAS_CODE_INIT_PER_WORD
    - (refactor) TX_DATA_COST_PER_ZERO => GAS_TX_DATA_PER_ZERO
    - (refactor) TX_DATA_COST_PER_NON_ZERO => GAS_TX_DATA_PER_NON_ZERO
    - (refactor) GAS_AUTH_PER_EMPTY_ACCOUNT_COST => GAS_AUTH_PER_EMPTY_ACCOUNT
    - (refactor) GAS_LOG_DATA => GAS_LOG_DATA_PER_BYTE
    - (refactor) GAS_PRECOMPILE_SHA256_WORD => GAS_PRECOMPILE_SHA256_PER_WORD
    - (refactor) GAS_PRECOMPILE_RIPEMD160_WORD => GAS_PRECOMPILE_RIPEMD160_PER_WORD
    - (refactor) GAS_PRECOMPILE_IDENTITY_WORD => GAS_PRECOMPILE_IDENTITY_PER_WORD
    - (refactor) REFUND_PER_AUTH_BASE_COST => REFUND_AUTH_PER_EXISTING_ACCOUNT

    ---------

    Co-authored-by: LouisTsai <q1030176@gmail.com>

commit cdf9add
Author: Paweł Bylica <pawel@hepcolgum.band>
Date:   Tue Feb 24 16:53:55 2026 +0100

    feat(tests): port EXTCODEHASH dynamicAccountOverwriteEmpty (ethereum#2032)

    Port the legacy static test:
    stExtCodeHash/dynamicAccountOverwriteEmpty_Paris
    for EIP-1052 EXTCODEHASH testing.

    The test verifies EXTCODEHASH correctly updates when an empty account is
    overwritten by CREATE2. Modified from original: target account has no
    storage to avoid EIP-7610 collision behavior.

commit 9bd111a
Author: felix <felix314159@users.noreply.github.com>
Date:   Tue Feb 24 14:20:18 2026 +0100

    fix: failing test in ci for 7981 (ethereum#2297)

commit 6f80f72
Author: Jochem Brouwer <jochembrouwer96@gmail.com>
Date:   Tue Feb 24 10:25:24 2026 +0100

    refactor(test-benchmarks): ensure `SSTORE` N->N writes nonzero key/value (ethereum#2255)

commit 04fb242
Author: Paweł Bylica <pawel@hepcolgum.band>
Date:   Mon Feb 23 23:24:31 2026 +0100

    feat(tests): port EXTCODEHASH codeless account with storage test (ethereum#2291)

    Port sub-case from dynamicAccountOverwriteEmpty_ParisFiller.yml:
    a codeless account with storage returns keccak256("") for EXTCODEHASH
    and 0 for EXTCODESIZE. Parametrized over three non-empty variants
    (balance only, nonce only, both).

commit 7add493
Author: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
Date:   Mon Feb 23 15:45:25 2026 -0500

    chore: expand docstring guide (ethereum#2195)

    Co-authored-by: danceratopz <danceratopz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-tests Area: Consensus tests. C-feat Category: an improvement or new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants