Skip to content

test_builder_deposit_inhibited()

Documentation for tests/amsterdam/eip8282_builder_execution_requests/test_builder_deposit_disable.py::test_builder_deposit_inhibited@636b5f17.

Generate fixtures for these test cases for Bogota with:

fill -v tests/amsterdam/eip8282_builder_execution_requests/test_builder_deposit_disable.py::test_builder_deposit_inhibited --fork Bogota

A deposit to an inhibited predeploy reverts and produces no request, the end-of-block system call clears the inhibitor back to zero, and an identical deposit in the next block is queued and dequeued normally.

Source code in tests/amsterdam/eip8282_builder_execution_requests/test_builder_deposit_disable.py
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
def test_builder_deposit_inhibited(
    blockchain_test: BlockchainTestFiller,
    inhibited_pre: Alloc,
) -> None:
    """
    A deposit to an inhibited predeploy reverts and produces no request, the
    end-of-block system call clears the inhibitor back to zero, and an
    identical deposit in the next block is queued and dequeued normally.
    """
    rejected = SystemContractInteractionTransaction(
        requests=[deposit_request()]
    ).update_pre(inhibited_pre)
    accepted = SystemContractInteractionTransaction(
        requests=[deposit_request()]
    ).update_pre(inhibited_pre)

    # The dequeue advances past the record but does not zero its slots, so
    # the accepted request's calldata words remain in the queue's storage.
    calldata = deposit_request().calldata
    residual_record_slots = {
        BuilderDepositRequest.queue_offset + i: calldata[
            i * 32 : (i + 1) * 32
        ].ljust(32, b"\x00")
        for i in range((len(calldata) + 31) // 32)
    }

    blockchain_test(
        pre=inhibited_pre,
        blocks=[
            Block(
                txs=rejected.transactions(),
                header_verify=Header(requests_hash=Requests()),
            ),
            Block(
                txs=accepted.transactions(),
                header_verify=Header(
                    requests_hash=Requests(*accepted.requests)
                ),
            ),
        ],
        post={
            BuilderDepositRequest.system_contract_address: Account(
                storage={
                    BuilderDepositRequest.excess_slot: 0,
                    **residual_record_slots,
                },
            ),
        },
    )

Parametrized Test Cases

This test generates 1 parametrized test case across 2 forks.