Test Block Access Lists Opcodes¶
Documentation for tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists_opcodes.py@892e6d1e.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists_opcodes.py --fork Amsterdam
Tests for EIP-7928 Block Access Lists with single-opcode success and OOG scenarios.
Block access lists (BAL) are generated via a client's state tracing journal. Residual journal entries may persist when opcodes run out of gas, resulting in a bloated BAL payload.
Issues identified in: paradigmxyz/reth#17765 bluealloy/revm#2903
These tests ensure out-of-gas operations are not recorded in BAL, preventing consensus issues.
Test Functions Overview¶
| Name | Type | Cases (Amsterdam) | Description |
|---|---|---|---|
test_bal_account_touch_system_address |
blockchain_test | 6 | Ensure a regular transaction that explicitly touches SYSTEM_ADDRESS via |
test_bal_balance_and_oog |
blockchain_test | 2 | Ensure BAL handles BALANCE and OOG during BALANCE appropriately. |
test_bal_call_7702_delegation_and_oog |
blockchain_test | 64 | CALL with 7702 delegation - test all OOG boundaries. |
test_bal_call_no_delegation_and_oog_before_target_access |
blockchain_test | 32 | CALL without 7702 delegation - test SUCCESS and OOG before target access. |
test_bal_call_no_delegation_oog_after_target_access |
blockchain_test | 4 | CALL without 7702 delegation - OOG after state access. |
test_bal_call_opcode_succeeds_in_static_context |
blockchain_test | 4 | All call opcodes (without value) succeed in static context. |
test_bal_call_revert_insufficient_funds |
blockchain_test | 12 | Test BAL with CALL/CALLCODE failure due to insufficient balance |
test_bal_call_with_value_in_static_context |
blockchain_test | 4 | CALL with nonzero value in static context: target NOT in BAL. |
test_bal_callcode_7702_delegation_and_oog |
blockchain_test | 64 | CALLCODE with 7702 delegation - test all OOG boundaries. |
test_bal_callcode_no_delegation_and_oog_before_target_access |
blockchain_test | 16 | CALLCODE without 7702 delegation - test SUCCESS and OOG boundaries. |
test_bal_callcode_with_value_in_static_context |
blockchain_test | 1 | CALLCODE with nonzero value succeeds in static context. |
test_bal_create2_collision |
blockchain_test | 1 | Test BAL with CREATE2 collision against pre-existing contract. |
test_bal_create2_selfdestruct_then_recreate_same_block |
blockchain_test | 2 | Tx1 CREATE2+SELFDESTRUCT, Tx2 CREATE2 resurrection at same address. |
test_bal_create_and_oog |
blockchain_test | 6 | CREATE/CREATE2 OOG boundary test at three gas levels. |
test_bal_create_contract_init_revert |
blockchain_test | 1 | Test that BAL does not include nonce/code changes when CREATE happens |
test_bal_create_early_failure |
blockchain_test | 1 | Test BAL with CREATE failure due to insufficient endowment. |
test_bal_create_in_static_context |
blockchain_test | 4 | CREATE/CREATE2 in static context: created address NOT in BAL. |
test_bal_create_oog_code_deposit |
blockchain_test | 1 | Ensure BAL correctly handles CREATE that runs out of gas during code |
test_bal_create_selfdestruct_to_self_with_call |
blockchain_test | 1 | Test BAL with init code that CALLs Oracle, writes storage, then |
test_bal_create_storage_op_then_selfdestruct_same_tx |
blockchain_test | 4 | Same-tx CREATE/CREATE2 + storage_op + SELFDESTRUCT. |
test_bal_delegatecall_7702_delegation_and_oog |
blockchain_test | 32 | DELEGATECALL with 7702 delegation - test all OOG boundaries. |
test_bal_delegatecall_no_delegation_and_oog_before_target_access |
blockchain_test | 8 | DELEGATECALL without 7702 delegation - test SUCCESS and OOG boundaries. |
test_bal_extcodecopy_and_oog |
blockchain_test | 4 | Ensure BAL handles EXTCODECOPY and OOG during EXTCODECOPY appropriately. |
test_bal_extcodesize_and_oog |
blockchain_test | 2 | Ensure BAL handles EXTCODESIZE and OOG during EXTCODESIZE appropriately. |
test_bal_selfdestruct_in_static_context |
blockchain_test | 4 | SELFDESTRUCT in static context: beneficiary NOT in BAL. |
test_bal_sload_and_oog |
blockchain_test | 2 | Ensure BAL handles SLOAD and OOG during SLOAD appropriately. |
test_bal_sstore_and_oog |
blockchain_test | 4 | Test BAL recording with SSTORE at various OOG boundaries and success. |
test_bal_sstore_static_context |
blockchain_test | 2 | SSTORE in static context must not leak storage reads into BAL. |
test_bal_staticcall_7702_delegation_and_oog |
blockchain_test | 32 | STATICCALL with 7702 delegation - test all OOG boundaries. |
test_bal_staticcall_no_delegation_and_oog_before_target_access |
blockchain_test | 8 | STATICCALL without 7702 delegation - test SUCCESS and OOG boundaries. |
test_bal_storage_write_read_cross_frame |
blockchain_test | 3 | Ensure BAL captures write precedence over read across call frames. |
test_bal_storage_write_read_same_frame |
blockchain_test | 1 | Ensure BAL captures write precedence over read in same call frame. |
test_bal_transient_storage_not_tracked |
blockchain_test | 1 | Test BAL excludes EIP-1153 transient storage (TSTORE/TLOAD). |