test_sstore_cold_then_warm_same_slot()¶
Documentation for tests/amsterdam/eip8038_state_access_gas_cost_increase/test_sstore_gas.py::test_sstore_cold_then_warm_same_slot@343274cc.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/amsterdam/eip8038_state_access_gas_cost_increase/test_sstore_gas.py::test_sstore_cold_then_warm_same_slot --fork Amsterdam
A first SSTORE on a cold slot warms it; the second in-frame
SSTORE of the same slot is charged only WARM_SLOAD.
The slot starts non-zero (original 1) and is left unlisted, so the
first write is cold and is its first change (original == current !=
new), costing COLD_STORAGE_ACCESS + STORAGE_WRITE.
That write warms the slot, so the second write -- which moves the slot
again without being a first change -- costs only WARM_SLOAD,
with no further STORAGE_WRITE. Slot 0 records the cold first write
and slot 1 the warm second write; the data slot keeps its final value.
Source code in tests/amsterdam/eip8038_state_access_gas_cost_increase/test_sstore_gas.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | |
Parametrized Test Cases¶
This test generates 1 parametrized test case across 1 fork.