Skip to content

Test State Gas Multi Block

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

Generate fixtures for these test cases for Amsterdam with:

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

Multi-block tests for EIP-8037 state gas receipt accounting and coinbase fee accumulation.

Verify that receipt_gas_used is computed correctly across multiple blocks under two-dimensional gas accounting. These tests exercise:

  • Receipt gas accounting over multi-block sequences with diverse state gas paths (reservoir, spill+revert, spill+halt)
  • Observable coinbase balance between state-creating transactions

Any disagreement in receipt_gas_used between clients causes the coinbase balance to diverge, producing a different state root.

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_coinbase_fee_paid_on_execution_and_state blockchain_test 2 Assert the miner is paid on execution gas plus state gas.
test_coinbase_fee_with_state_gas_refund blockchain_test 1 Assert the coinbase is paid on the post-refund gas, not the charge.
test_exact_coinbase_fee_simple_sstore blockchain_test 1 Assert exact coinbase balance from a single SSTORE transaction.
test_multi_block_mixed_state_operations blockchain_test 1 Verify coinbase fee across blocks with diverse state operations.
test_multi_block_observed_coinbase_balance blockchain_test 1 Observe coinbase balance between state-creating transactions.