Skip to content

Test SSTORE Gas

Documentation for tests/amsterdam/eip8038_state_access_gas_cost_increase/test_sstore_gas.py@ffe48572.

Generate fixtures for these test cases for Bogota with:

fill -v tests/amsterdam/eip8038_state_access_gas_cost_increase/test_sstore_gas.py --fork Bogota

Tests for EIP-8038: State-access gas cost update.

Covers the EIP-8038 SSTORE execution (non-state) gas schedule. The state-creation charge for a zero-to-nonzero write is owned by EIP-8037 and is asserted separately; here every expectation is taken from the execution_cost dimension only.

The execution SSTORE cost is the slot-access cost (COLD_STORAGE_ACCESS when the key is cold, else WARM_SLOAD) plus, on the first change of the slot in the transaction (original == current != new), the write cost STORAGE_WRITE (modeled as COLD_STORAGE_WRITE - COLD_STORAGE_ACCESS).

Test Functions Overview

Name Type Cases (Bogota) Description
test_sstore_cold_then_warm_same_slot state_test 1 A first SSTORE on a cold slot warms it; the second in-frame
test_sstore_execution_gas state_test 20 Measure the execution SSTORE gas for each EIP-8038 row and assert it.
test_sstore_stipend_sentry_boundary state_test 4 The EIP-2200 stipend sentry, not the slot's access cost, sets the