test_top_level_halt_burns_spilled_state_gas()¶
Documentation for tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_call.py::test_top_level_halt_burns_spilled_state_gas@5c024cbb.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_call.py::test_top_level_halt_burns_spilled_state_gas --fork Amsterdam
Verify a top-level halt burns the spilled state gas, so only the start reservoir survives. The parent calls a child that reverts or halts, then INVALIDs at the top level.
Under LIFO refills a frame's spilled state gas refills to
gas_left, which the halt then zeros. Only the reservoir-funded
portion survives, equal to the reservoir at frame start.
That start value equals the sized reservoir R, so for every child
failure mode and reservoir_delta:
`state_gas_left_end = R`,
`tx_gas_used = tx.gas - R = gas_limit_cap`.
With the reservoir one short (reservoir_delta == -1) the child's
SSTORE spills one unit from gas_left, which is refilled then
burned by the halt. So tx_gas_used stays gas_limit_cap. The
old behavior refunded the spill, giving gas_limit_cap - 1.
Source code in tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_call.py
1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 | |
Parametrized Test Cases¶
This test generates 6 parametrized test cases across 1 fork.