Skip to content

Conversation

@chfast
Copy link
Member

@chfast chfast commented Jan 17, 2026

🗒️ 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
Copy link
Contributor

Copilot AI left a comment

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
Copy link

codecov bot commented Jan 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.18%. Comparing base (c3813a5) to head (31eefbd).

Additional details and impacted files
@@                 Coverage Diff                 @@
##           forks/amsterdam    #2032      +/-   ##
===================================================
+ Coverage            86.14%   86.18%   +0.03%     
===================================================
  Files                  599      599              
  Lines                39472    39472              
  Branches              3780     3780              
===================================================
+ Hits                 34002    34017      +15     
+ Misses                4848     4838      -10     
+ Partials               622      617       -5     
Flag Coverage Δ
unittests 86.18% <ø> (+0.03%) ⬆️

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
Copy link
Collaborator

@LouisTsai-Csie LouisTsai-Csie left a comment

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.

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 from 55295bf to ef406d9 Compare January 22, 2026 18:28
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.
@chfast chfast force-pushed the tests/port_account_overwrite branch 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
Copy link
Contributor

Copilot AI left a comment

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.

Copy link
Collaborator

@LouisTsai-Csie LouisTsai-Csie left a comment

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
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
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
Copy link
Member Author

chfast commented Jan 27, 2026

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.

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.

3 participants