feat(tests): EIP-7928 BAL withdrawal predeploy balance read across txs#2883
Open
edg-l wants to merge 1 commit into
Open
feat(tests): EIP-7928 BAL withdrawal predeploy balance read across txs#2883edg-l wants to merge 1 commit into
edg-l wants to merge 1 commit into
Conversation
Add a cross-tx test in eip7928_block_level_access_lists/test_block_access_lists_cross_index.py that verifies a transaction observing the BAL balance change of the WITHDRAWAL_REQUEST_PREDEPLOY recorded by a prior transaction within the same block. tx 0 pays the withdrawal fee (balance 0 -> fee, recorded as a BAL balance_change at index 1). tx 1 calls a contract that performs SSTORE(0, BALANCE(WITHDRAWAL_REQUEST_PREDEPLOY)); the assertion that slot 0 equals fee exercises that tx 1's pre-state for the predeploy includes tx 0's BAL prefix entry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a cross-tx test in
tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists_cross_index.pycovering a transaction reading the post-state balance ofWITHDRAWAL_REQUEST_PREDEPLOYafter a prior transaction in the same block paid the withdrawal fee.Coverage gap
The existing EIP-7002 / EIP-7251 BAL tests cover the per-tx storage and balance entries for the predeploys in isolation, and the post-execution NOOP-filtering paths, but they do not exercise the case where:
BALANCE).This is the cross-tx propagation of a BAL
balance_changeto a later transaction's view of the account, for an account that is also touched during pre-execution system calls.Test
test_bal_withdrawal_predeploy_balance_observed_cross_tx:tx 0: EOA sends 1 wei toWITHDRAWAL_REQUEST_PREDEPLOYwith valid withdrawal-request calldata. The predeploy retains the fee, so its balance transitions0 -> 1, recorded as abalance_changeatblock_access_index = 1.tx 1: calls a contract whose code isSSTORE(0, BALANCE(WITHDRAWAL_REQUEST_PREDEPLOY)) + STOP.reader.storage[0] == 1.The expected BAL declares the predeploy
balance_changeat index 1 and the reader'sstorage_changeat index 2.Fee retention is consistent with existing BAL tests in the same suite:
test_bal_7002_clean_sweepintest_block_access_lists_eip7002.pyalready assertsAccount(balance=withdrawal_request.fee)in post-state after a single fee-paying transaction.Notes
BlockAccessListExpectationif a slimmer declaration is preferred, or to extend toEXTCODESIZE/EXTCODEHASH/EXTCODECOPYas parametrised variants.CONSOLIDATION_REQUEST_PREDEPLOY(EIP-7251) admits the same shape; can mirror if useful.