Skip to content

test_blobbasefee_stack_overflow()

Documentation for tests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.py::test_blobbasefee_stack_overflow@verkle@v0.0.6.

Generate fixtures for these test cases for Cancun with:

Cancun only:

fill -v tests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.py::test_blobbasefee_stack_overflow --fork=Cancun --evm-bin=/path/to/evm-tool-dev-version

For all forks up to and including Cancun:

fill -v tests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.py::test_blobbasefee_stack_overflow --until=Cancun

Tests that the BLOBBASEFEE opcode produces a stack overflow by using it repeatedly.

Source code in tests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.py
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
@pytest.mark.parametrize(
    "callee_code,call_fails",
    [
        pytest.param(Op.BLOBBASEFEE * 1024, False, id="no_stack_overflow"),
        pytest.param(Op.BLOBBASEFEE * 1025, True, id="stack_overflow"),
    ],
)
@pytest.mark.valid_from("Cancun")
def test_blobbasefee_stack_overflow(
    state_test: StateTestFiller,
    pre: Alloc,
    caller_address: Address,
    callee_address: Address,
    tx: Transaction,
    call_fails: bool,
):
    """
    Tests that the BLOBBASEFEE opcode produces a stack overflow by using it repeatedly.
    """
    post = {
        caller_address: Account(
            storage={1: 0 if call_fails else 1},
        ),
        callee_address: Account(
            balance=0,
        ),
    }
    state_test(
        env=Environment(),
        pre=pre,
        tx=tx,
        post=post,
    )

Parametrized Test Cases

The interactive table below is also available as a standalone page.

Skipped Parameters

For more concise readability, the table below does not list the following parameter values: fork, blockchain_test, state_test, state_test_only, eof_test, eof_state_test.

Test ID callee_code call_fails
no_stack_overflow False
stack_overflow True
no_stack_overflow False
stack_overflow True