Skip to content

Test Block 2d Gas Accounting

Documentation for tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_block_2d_gas_accounting.py@636b5f17.

Generate fixtures for these test cases for Bogota with:

fill -v tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_block_2d_gas_accounting.py --fork Bogota

Test block-level two-dimensional gas accounting under EIP-8037.

Verify that the block header gas_used equals max(block_execution_gas_used, block_state_gas_used) across single-block, multi-block, and mixed-transaction scenarios.

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

Test Functions Overview

Name Type Cases (Bogota) Description
test_base_fee_decreases_from_dominant_dimension blockchain_test 2 Verify that a block below gas target lowers the child's base fee.
test_base_fee_per_gas_follows_dominant_dimension blockchain_test 4 Verify the child block's base fee follows the bottleneck dimension.
test_block_2d_gas_boundary_exact_fit blockchain_test 3 Verify a block is valid when state gas dominates execution gas.
test_block_2d_gas_tx_gas_limit_exceeds_execution_remaining blockchain_test 2 Verify a block is valid when a later tx's gas_limit exceeds the
test_block_2d_inclusion_execution_gate_full_gas_reservation blockchain_test 3 Pin the flat execution-gas inclusion gate on a contract creation.
test_block_gas_refund_eip7778_no_block_reduction blockchain_test 1 Verify block gas accounting for SSTORE 0→x→0 refund paths.
test_block_gas_used_call_new_account blockchain_test 1 Verify block.gas_used includes state gas from CALL creating accounts.
test_block_gas_used_create_tx blockchain_test 1 Verify block.gas_used includes intrinsic state gas from CREATE txs.
test_block_gas_used_execution_dominates blockchain_test 2 Verify block.gas_used = block_execution_gas when execution dominates.
test_block_gas_used_mixed_txs blockchain_test 2 Verify block.gas_used with mixed STOP and SSTORE transactions.
test_block_gas_used_state_dominates blockchain_test 4 Verify block.gas_used = block_state_gas when state > execution.
test_cumulative_block_state_gas_boundary blockchain_test 2 Probe the block state-gas inclusion gate with spill-funded usage.
test_multi_block_dimension_flip blockchain_test 1 Verify gas_used across blocks where dominant dimension flips.
test_receipt_cumulative_differs_from_header_gas_used blockchain_test 1 Verify receipt cumulative_gas_used can diverge from header
test_reject_incorrect_two_dimensional_header blockchain_test 4 Reject alternate header gas totals for an otherwise valid block.
test_tx_gas_limit_block_boundary blockchain_test 64 Reject tx whose gas_limit exceeds the block gas_limit.
test_tx_inclusion_at_execution_gas_block_limit_small blockchain_test 2 Probe the execution-gas inclusion boundary with a small-gas tx.
test_tx_total_gas_limit_cap state_test 10 Accept a transaction at TX_MAX_TOTAL_GAS_LIMIT and reject one a