-
Notifications
You must be signed in to change notification settings - Fork 415
refactor(test-tests): port EXTCODEHASH dynamicAccountOverwriteEmpty #2032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: forks/amsterdam
Are you sure you want to change the base?
refactor(test-tests): port EXTCODEHASH dynamicAccountOverwriteEmpty #2032
Conversation
8c9db98 to
55295bf
Compare
There was a problem hiding this 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 Report✅ All modified and coverable lines are covered by tests. 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
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:
|
LouisTsai-Csie
left a comment
There was a problem hiding this 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.
…ing pre-alloc groups (ethereum#2032) * feat(FixtureCollector): Add flush interval to the fixture collector * fix: typing * fix: typing * fix: unit test
55295bf to
ef406d9
Compare
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.
ef406d9 to
9eaaf43
Compare
9eaaf43 to
84a2f78
Compare
There was a problem hiding this 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.
LouisTsai-Csie
left a comment
There was a problem hiding this 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.
| @pytest.mark.parametrize( | ||
| "target_exists", | ||
| [True, False], | ||
| ) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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")
),
],
),
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 |
🗒️ 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
toxchecks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx tox -e statictype(scope):.mkdocs servelocally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.@ported_frommarker.Cute Animal Picture