Skip to content

test_system_call_execution_grant()

Documentation for tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_system_calls.py::test_system_call_execution_grant@622620d8.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_system_calls.py::test_system_call_execution_grant --fork Amsterdam

Keep the execution grant independent of the reservoir and tx cap.

Source code in tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_system_calls.py
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
@system_contract_cases
@EIPChecklist.GasCostChanges.Test.GasUpdatesMeasurement()
def test_system_call_execution_grant(
    blockchain_test: BlockchainTestFiller,
    pre: Alloc,
    fork: Fork,
    system_contract: int,
) -> None:
    """Keep the execution grant independent of the reservoir and tx cap."""
    address = Address(system_contract)
    # GAS executes first, before the key is pushed for SSTORE.
    code = Op.SSTORE(0, Op.GAS)
    pre[address] = Account(code=code)
    expected = system_call_execution_grant(fork) - Op.GAS.gas_cost(fork)
    blockchain_test(
        pre=pre,
        genesis_environment=Environment(gas_limit=1_000_000),
        blocks=[Block(txs=[], header_verify=Header(gas_used=0))],
        post={address: Account(storage={0: expected})},
    )

Parametrized Test Cases

This test generates 6 parametrized test cases across 1 fork.