Test SLOAD Gas¶
Documentation for tests/amsterdam/eip8038_state_access_gas_cost_increase/test_sload_gas.py@5fa5938b.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/amsterdam/eip8038_state_access_gas_cost_increase/test_sload_gas.py --fork Amsterdam
Tests for EIP-8038: State Access Gas Cost Increase.
Covers the EIP-8038 SLOAD repricing: a cold storage slot read costs
COLD_STORAGE_ACCESS (3000) and a warm read costs WARM_SLOAD (100).
A slot is warmed either by listing it in the transaction access list or by
a prior in-frame access; warmth acquired inside a sub-call that REVERTs is
discarded, so a subsequent read in the outer frame is cold again.
Test Functions Overview¶
| Name | Type | Cases (Amsterdam) | Description |
|---|---|---|---|
test_sload_gas |
state_test | 2 | Measure the gas of a SLOAD on a slot that is either cold or |
test_sload_warm_after_prior_touch |
state_test | 1 | A first SLOAD on a cold slot warms it; the second in-frame |
test_sload_warmth_reverts_on_subcall_revert |
state_test | 1 | Warmth acquired inside a reverted sub-call does not persist. |