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@ffe48572.

Generate fixtures for these test cases for Bogota with:

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

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
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 2 forks.