Skip to content

Test Fork Transition

Documentation for tests/amsterdam/eip8038_state_access_gas_cost_increase/test_fork_transition.py@5fa5938b.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/amsterdam/eip8038_state_access_gas_cost_increase/test_fork_transition.py --fork Amsterdam

Fork-transition tests for EIP-8038: State Access Gas Cost Increase.

"Same operation, different gas" across the Amsterdam boundary. A block at timestamp=14_999 runs under the pre-fork (parent) schedule; a block at timestamp=15_000 runs under the EIP-8038 schedule. Every before/after magnitude is derived from fork.fork_at(timestamp=...).gas_costs() — nothing is hardcoded.

Two proof styles are used:

  • Account-access dimensions that are pure regular gas (BALANCE cold access and the EXT* code-read surcharge) are measured exactly with CodeGasMeasure in each regime and asserted against the derived cost.
  • Constant repricings that the runtime opcode model cannot isolate without state-gas confounders (CALL_VALUE, CREATE base, SELFDESTRUCT account-write) are asserted at the constant level from the derived schedules while the operation is still exercised in both blocks to prove it runs in each regime.
  • The authorization intrinsic rise is proven behaviourally: a tx whose gas_limit equals the old auth intrinsic is valid before the fork and rejected with INTRINSIC_GAS_TOO_LOW after.

Test Functions Overview

Name Type Cases (Amsterdam) Description
test_auth_intrinsic_at_transition blockchain_test 1 The 7702 authorization intrinsic falls across the boundary.
test_call_value_cost_at_transition blockchain_test 1 CALL_VALUE rises across the boundary (9000 -> 10300 on mainnet,
test_cold_account_access_at_transition blockchain_test 1 BALANCE of a cold account costs COLD_ACCOUNT_ACCESS, which
test_create_base_cost_at_transition blockchain_test 1 The CREATE regular base cost changes across the boundary
test_ext_code_surcharge_at_transition blockchain_test 1 The EIP-8038 EXT* code-read surcharge appears at the fork. The
test_selfdestruct_account_write_at_transition blockchain_test 1 SELFDESTRUCT gains an ACCOUNT_WRITE charge when it sends a
test_sstore_write_cost_at_transition blockchain_test 1 The SSTORE first-change cost is repriced across the Amsterdam