Skip to content

Test Fork Transition

Documentation for tests/amsterdam/eip8038_state_access_gas_cost_increase/test_fork_transition.py@26332146.

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 the opcode's own cost at each fork (bytecode.gas_cost / execution_cost / refund) — nothing is hardcoded.

Two proof styles are used:

  • Account-access dimensions that are pure execution gas (BALANCE cold access and the EXT* code-read surcharge) are measured exactly with CodeGasMeasure in each regime and asserted against the derived cost.
  • Repricings that the runtime opcode model cannot isolate without state-gas confounders (CALL with value, CREATE, SELFDESTRUCT to a fresh beneficiary, SSTORE first change) are exercised in both blocks to prove the operation still runs in each regime, with the SSTORE execution/state split and clear refund compared across forks via the bytecode's own cost methods.
  • 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, becoming
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 execution 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