-
Notifications
You must be signed in to change notification settings - Fork 414
feat(test): OOG and success selfdestruct tests #1954
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
feat(test): OOG and success selfdestruct tests #1954
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## eips/amsterdam/eip-7928 #1954 +/- ##
==========================================================
Coverage ? 86.25%
==========================================================
Files ? 538
Lines ? 34561
Branches ? 3224
==========================================================
Hits ? 29809
Misses ? 4165
Partials ? 587
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:
|
|
I think we should move these to an earlier fork as it looks like we may not have coverage for this. I see some coverage in the static tests but not for all opcodes. It would be good to have this in python either way and use the I'll work on porting this to an earlier fork. |
250a01c to
a4faa41
Compare
|
Ah sorry, I think my comment is confusing. The YP case is, IIRC, a case which is only possible if a precompile account is empty (no balance, 0 nonce, no code, no storage). I am not sure but I thought some tests pre-fill precompiles with a balance to make them non-empty, and wanted to explicitly mention this here. But I think this is already the case. So no missing cases found here. |
jochem-brouwer
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.
Not a review of the tests, just a small point regarding fork names and docs 😄 👍
e89a230 to
88cb64f
Compare
dfac8a9 to
41d351d
Compare
* chore(ci|clis): updates for full release. temp * chore(ci): tweaks. * chore(ci): filter benchmark tests.
f63364f to
6c298a9
Compare
4011d69 to
0f19de7
Compare
|
@danceratopz this is ready for review now! Note that |
6cb7712 to
930a8dc
Compare
…ereum#1954 Bonus: - fix(test): remove unnecessary isolation for enginex
…rison - This will also help with support for any forks of this repo for L2s or other projects if some fork definitions don't have any meaningful relationship to SpuriousDragon.
930a8dc to
31937e3
Compare
| Note: Gas boundary testing not possible for initcode since CREATE | ||
| doesn't accept a gas parameter - it uses all available gas. |
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.
See example in this PR: https://github.com/ethereum/execution-specs/pull/2002/files#diff-095178dc2c6d121067cadab23cb09943682751281a0489a73f90906e26855a6a
Basically we limit the gas passed to the factory contract, taking into account the 63/64 rule.
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.
Really nice use 😄. I created #2010 to track this 👍🏼
marioevz
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.
Approving based on:
- Tracking issue #2010 will fix outstanding comment.
- CI failures require new BAL release.
f8f52d9
into
ethereum:eips/amsterdam/eip-7928
Bonus: - fix(test): remove unnecessary isolation for enginex
…ereum#1954 Bonus: - fix(test): remove unnecessary isolation for enginex
…ereum#1954 Bonus: - fix(test): remove unnecessary isolation for enginex
Bonus: - fix(test): remove unnecessary isolation for enginex
…ereum#1954 Bonus: - fix(test): remove unnecessary isolation for enginex
…ereum#1954 Bonus: - fix(test): remove unnecessary isolation for enginex
Bonus: - fix(test): remove unnecessary isolation for enginex

🗒️ Description
Added comprehensive
SELFDESTRUCTtests covering beneficiaries as EOA, contract, precompiles, and self. All tests consolidated inTangerineWhistlewith fork-aware parametrizationpytest.param(..., marks=valid_from("Berlin"))so warm tests only run on>=BerlinG_NEW_ACCOUNTevaluated)G_NEW_ACCOUNTPrecompile coverage was sparse - some static tests hit 0x01, others 0x01-0x03. Now using
@pytest.mark.with_all_precompilesfor full coverage across all fork precompiles.TangerineWhistle (EIP-150): All tests live here since this is when gas costs for
SELFDESTRUCTwere introduced. Fork-aware parametrization handles Berlin+ warm/cold distinction.SpuriousDragon (EIP-161, EIP-155): Tests correctly handle the originator_balance > 0 requirement for G_NEW_ACCOUNT.
Also updated old tests to use >= SpuriousDragon for protected transactions since this is when EIP-155 was introduced, not Byzantium as other tests have been using in our codebase.[This was then refactored asfork.supports_protected_txs, returningTruebeginning atSpuriousDragon].Berlin (EIP-2929): Warm/cold coverage integrated via warm param with
valid_from("Berlin")mark - no separate Berlin test file needed.🔗 Related Issues or PRs
✅ 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.Cute Animal Picture