Skip to content

Test State Gas Ordering

Documentation for tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_ordering.py@622620d8.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_ordering.py --fork Amsterdam

Test state gas consumption ordering under EIP-8037.

When an opcode charges both execution gas and state gas, execution gas MUST be charged first. If execution gas OOGs, state gas is not consumed. This prevents the parent's reservoir from being inflated on frame failure.

Each test gives a child frame exactly 1 gas less than needed, then uses a probe contract to detect whether the parent's reservoir was inflated by incorrectly consumed state gas.

Tests for [EIP-8037: State Creation Gas Cost Increase] (https://eips.ethereum.org/EIPS/eip-8037).

Test Functions Overview

Name Type Cases (Amsterdam) Description
test_create_oog_full_burn_no_state_credit blockchain_test 4 Verify a CREATE OOG inside a non-creation tx burns the whole
test_state_charge_oog_full_burn_no_state_credit blockchain_test 3 Verify every state charge burns the whole tx gas_limit when it OOGs.