feat(tests): EIP-7928 OOG edge cases for EIP-7702 delegations#1856
feat(tests): EIP-7928 OOG edge cases for EIP-7702 delegations#1856raxhvl wants to merge 1 commit intoethereum:eips/amsterdam/eip-7928from
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## eips/amsterdam/eip-7928 #1856 +/- ##
========================================================
Coverage 83.85% 83.85%
========================================================
Files 402 402
Lines 25105 25105
Branches 2287 2287
========================================================
Hits 21051 21051
Misses 3615 3615
Partials 439 439
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:
|
| # Bob is a pre-deployed account with 7702 delegation to target_contract | ||
| bob = pre.deploy_contract( | ||
| nonce=1, | ||
| code=Spec7702.delegation_designation(target_contract), |
There was a problem hiding this comment.
I'm not sure how the test framework translates this, but if it tries to deploy a contract with the designated 7702 delegation pointer then this will not work (contract deployment will fail because it attempts to deploy 0xEF-prefixed code (see EIP-3541)
There was a problem hiding this comment.
The deployment goes through (we've done the same for the other tests). My understanding that this just adds to the pre-state before invoking EVM so its fine.
cc: @fselmo
There was a problem hiding this comment.
Ah right, yes this would work to generate the fixtures but it would fail on a live network (uv run execute remote)
| # Provide enough for intrinsic + pushes + Bob access, | ||
| # but not TargetContract | ||
| tx_gas_limit = ( | ||
| intrinsic_gas_cost + push_cost + bob_cold_cost + target_cold_cost - 1 |
There was a problem hiding this comment.
This test is almost similar to the previous one, right? The only difference is the gas limit of the tx and the expected BAL 🤔 I think those should be merged in one test (and it should be parametrized)
ebc749e to
6044b67
Compare
📄 docs: Changelog entry ✨ feat(tests): test_bal_7702_oog_at_target 🥢 nit: reduce gas stipend to zero ✨ feat: test_bal_7702_oog_at_authority 📄 docs: Update 7702 OOG desc
2d2473d to
3c37b64
Compare
|
@raxhvl, we had a lot of changes this time that came from |
* fix(tests): fix invalid kwarg fails in 7702 `test_set_code_to_log` * docs: update and fix changelog
* fix(tests): fix invalid kwarg fails in 7702 `test_set_code_to_log` * docs: update and fix changelog
🗒️ Description
The PR adds two test cases targeting OOG scenarios when accessing 7702 delegation:
The overall goal is to ensure when an account access runs out of gas, it does not make it to BAL.
🔗 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):.Cute Animal Picture