Skip to content

test_calldata_floor_independent_of_state_gas()

Documentation for tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_calldata_floor.py::test_calldata_floor_independent_of_state_gas@2119b382.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_calldata_floor.py::test_calldata_floor_independent_of_state_gas --fork Amsterdam

Test calldata floor applies only to regular gas dimension.

The calldata floor applies only to the sender's bill and does not affect the state gas dimension. A transaction with high calldata and no state operations should succeed even when the floor exceeds actual execution gas.

Source code in tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_calldata_floor.py
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
@pytest.mark.valid_from("EIP8037")
def test_calldata_floor_independent_of_state_gas(
    state_test: StateTestFiller,
    pre: Alloc,
) -> None:
    """
    Test calldata floor applies only to regular gas dimension.

    The calldata floor applies only to the sender's bill and does not
    affect the state gas dimension. A transaction with high calldata
    and no state operations should succeed even when the floor exceeds
    actual execution gas.
    """
    contract = pre.deploy_contract(code=Op.STOP)

    # Large calldata so the floor exceeds actual execution gas
    calldata = b"\xff" * 512

    tx = Transaction(
        to=contract,
        data=calldata,
        state_gas_reservoir=0,
        sender=pre.fund_eoa(),
    )

    state_test(pre=pre, post={}, tx=tx)

Parametrized Test Cases

This test generates 1 parametrized test case across 1 fork.