feat(tests): port TouchToEmptyAccountRevert legacy tests#2388
feat(tests): port TouchToEmptyAccountRevert legacy tests#2388chfast wants to merge 1 commit intoethereum:forks/amsterdamfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #2388 +/- ##
================================================
Coverage 85.73% 85.73%
================================================
Files 599 599
Lines 36916 36916
Branches 3771 3771
================================================
Hits 31650 31650
Misses 4604 4604
Partials 662 662
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:
|
|
Ready for review or still in draft? |
ec18c9d to
a58ef7e
Compare
Ready now. |
| An empty target is deleted; a funded target survives. | ||
| """ | ||
| storage = Storage() | ||
| target = pre.empty_account() |
There was a problem hiding this comment.
I'm now thinking that this empty_account name could be misleading. We are not placing an account with all fields set to zero in the pre-state, as one might expect an empty account to be, rather the returned address is an address that is nowhere in the pre-state.
Perhaps pre.nonexistent_address() is a better name.
I don't think we currently can put an actual empty account in the pre-state, but after looking at the original static tests, it doesn't try to put an empty account either, so it might be ok?
There was a problem hiding this comment.
It looks I moved too fast with these tests, sorry. The main point I need precise this scenario which is not covered in evmone by EEST: there is an empty account in the pre-state, it is touched during execution, then this touch is reverted and the account is not deleted in the end.
I identified only this legacy test (from legacytests repo) coverts it. Now I understand why: this test is filled for Paris+ only in EEST.
Can I create completely empty account in the pre-state pre-Paris?
There was a problem hiding this comment.
So, afaik:
- The test framework has a check to disallow empty accounts in the pre-allocation (but we can workaround this depending on the next point)
- I'm not sure if the same check exists on the EELS side in one or multiple forks, perhaps @SamWilsn or @gurukamath know
- If not possible, this might be one reason why we would not be able to delete legacy-tests, cc @danceratopz
| target = pre.empty_account() | ||
|
|
||
| if target_balance > 0: | ||
| pre[target] = Account(balance=target_balance) |
There was a problem hiding this comment.
Need to add pytest.mark.pre_alloc_mutable due to this line.
|
Another comment is that these files should be deleted in this PR: |
2bd4c6a to
d557a11
Compare
d557a11 to
4da5eea
Compare
4da5eea to
97b54c0
Compare
🗒️ Description
TouchToEmptyAccountRevertstatic tests for EIP-161 empty account cleanuptest_touch_empty_account_call_chain: zero-value CALL through a call chaintest_touch_empty_account_call_then_oog: direct CALL + OOG sub-calltest_touch_empty_account_selfdestruct_then_oog: SELFDESTRUCT touch + OOG sub-call🔗 Related Issues or PRs
Closes #2174
✅ 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
🪱