-
Notifications
You must be signed in to change notification settings - Fork 392
feat(tests): add more 7928 test descriptions #1815
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: eips/amsterdam/eip-7928
Are you sure you want to change the base?
Conversation
…1815) * chore(consume): add exponential retry logic for initial fcu in consume engine. * chore(docs): changelog.
| | `test_value_transfer_gas_calculation` | Ensure BAL correctly tracks OOG scenarios for CALL/CALLCODE/DELEGATECALL/STATICCALL (pre-Amsterdam test with BAL) | Nested calls with precise gas limits to test OOG behavior. For CALL with OOG: target account is read. For CALLCODE/DELEGATECALL/STATICCALL with OOG: target account **NOT** read (OOG before state access) | For CALL: target in BAL even with OOG. For CALLCODE/DELEGATECALL/STATICCALL: target **NOT** in BAL when OOG (state access deferred until after gas check) | ✅ Completed | | ||
| | `test_bal_7702_double_auth_reset_minimal` | Ensure BAL tracks multiple 7702 nonce increments but filters net-zero code change | Single transaction contains two EIP-7702 authorizations for `Alice`: (1) first auth sets delegation `0xef0100\|\|Oracle`, (2) second auth clears delegation back to empty. Transaction sends 10 wei to `Bob`. Two variants: (a) Self-funded: `Alice` is tx sender (one tx nonce bump + two auth bumps → nonce 0→3). (b) Sponsored: `Relayer` is tx sender (`Alice` only in auths → nonce 0→2 for `Alice`, plus one nonce bump for `Relayer`). | Variant (a): BAL **MUST** include `Alice` with `nonce_changes` 0→3. Variant (b): BAL **MUST** include `Alice` with `nonce_changes` 0→2 and `Relayer` with its own `nonce_changes`. For both variants, BAL **MUST NOT** include `code_changes` for `Alice` (net code is empty), **MUST** include `Bob` with `balance_changes` (receives 10 wei), and `Oracle` **MUST NOT** appear in BAL. | 🟡 Planned | | ||
| | `test_bal_selfdestruct_send_to_sender` | Ensure BAL tracks SELFDESTRUCT sending all funds back to the tx sender (no burn) | Pre-state: contract `C` exists from a prior transaction with non-empty code and balance = 100 wei. EOA `Alice` sends a transaction calling `C`. `C`’s code executes `SELFDESTRUCT(Alice)`. Under EIP-6780, because `C` was not created in this transaction, SELFDESTRUCT does not delete code or storage; it only transfers the entire 100 wei balance from `C` to `Alice`. Final post-state: `C` still exists with the same code and balance = 0; `Alice`’s balance increased by 100 wei (ignoring gas for this test). | BAL **MUST** include `Alice` with `nonce_changes` (tx sender) and `balance_changes` reflecting receipt of 100 wei, and **MUST** include `C` with `balance_changes` 100→0 and no `code_changes`. BAL **MUST NOT** include any other accounts. This test ensures SELFDESTRUCT-to-sender is modeled as a pure value transfer (no burn, no code deletion). | 🟡 Planned | | ||
| | `test_bal_selfdestruct_burn_balance` | Ensure BAL records ETH burn when a contract created in the same tx selfdestructs to itself | Pre-state: `Alice` sends a CREATE/CREATE2 transaction that deploys contract `D` with an initial endowment of 100 wei. In the same transaction, `D`’s runtime executes and calls `SELFDESTRUCT(D)` (beneficiary is its own address). Under EIP-6780, because `D` is created and selfdestructs in the same transaction and the target equals the caller, the 100 wei is **burned** (removed from total supply). Final post-state: `D` has balance = 0 and is considered destroyed per same-tx semantics. | BAL **MUST** include `D` with `balance_changes` 100→0 (burn) and may include `code_changes` indicating deletion if BAL models code removal; no other account **MUST** have `balance_changes` corresponding to this 100 wei, i.e. no recipient appears. `Alice` **MAY** appear only with `nonce_changes` and gas-related balance changes; the key assertion is that the 100 wei leaves `D` and is not credited to any other account. | 🟡 Planned | |
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 just merged some more cases and I rebased here. I think that this test case covers this scenario here, what do you think?
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.
lgtm, took me a minute to review and merge some PRs ahead of this one... sorry for the wait here! I just merged those and rebased this one. We may have a duplicate case, can you make sure?
ebc749e to
6044b67
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## eips/amsterdam/eip-7928 #1815 +/- ##
========================================================
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:
|
🗒️ Description
This PR adds three new BAL edge-case tests covering 7702 multi-authorization behavior and the two distinct post-Cancún SELFDESTRUCT outcomes:
7702 Double Authorization Reset:
A single transaction includes two EIP-7702 authorizations for
Alice—first setting delegation code, then clearing it.BAL must reflect the correct nonce increments (self-funded: 0→3; sponsored: 0→2) and must not include any
code_changes, since the final code is empty.SELFDESTRUCT Sending Funds Back to Sender:
A pre-existing contract
CexecutesSELFDESTRUCT(Alice).Under EIP-6780,
Cremains intact (no code deletion) and all its balance is transferred toAlice.BAL must show
C’s balance going to zero andAlicereceiving the value.SELFDESTRUCT That Burns ETH (Created and Destroyed in Same Tx):
A contract
Dis created and, in the same transaction, executesSELFDESTRUCT(D).Per EIP-6780, the ETH is burned rather than transferred.
BAL must show
D’s balance reduced to zero with no beneficiary receiving the value.