Skip to content

test_bal_4788_empty_block()

Documentation for tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists_eip4788.py::test_bal_4788_empty_block@c74f1a67.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists_eip4788.py::test_bal_4788_empty_block --fork Amsterdam

Ensure BAL captures beacon root storage writes in empty block.

Block with no transactions. At block start (pre-execution), SYSTEM_ADDRESS calls BEACON_ROOTS_ADDRESS to store parent beacon root.

Source code in tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists_eip4788.py
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
def test_bal_4788_empty_block(
    pre: Alloc,
    blockchain_test: BlockchainTestFiller,
) -> None:
    """
    Ensure BAL captures beacon root storage writes in empty block.

    Block with no transactions. At block start (pre-execution),
    SYSTEM_ADDRESS calls BEACON_ROOTS_ADDRESS to store parent beacon root.
    """
    block_timestamp = 12
    beacon_root = Hash(0xABCDEF)

    # Build BAL expectations (only system call, no transactions)
    account_expectations = beacon_root_system_call_expectations(
        block_timestamp, beacon_root
    )

    block = Block(
        txs=[],
        parent_beacon_block_root=beacon_root,
        timestamp=block_timestamp,
        expected_block_access_list=BlockAccessListExpectation(
            account_expectations=account_expectations
        ),
    )

    blockchain_test(
        pre=pre,
        blocks=[block],
        post={},
    )

Parametrized Test Cases

This test generates 1 parametrized test case across 1 fork.