chore(specs, tests): restore spilled state gas to reservoir on revert/halt#2378
Conversation
…/halt When a child frame's state gas spills from the reservoir into gas_left and then reverts or halts, the spilled state gas was lost. Since state changes are rolled back, all state gas (reservoir + spill) should be restored to the parent's reservoir, not just the original reservoir.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## eips/amsterdam/eip-8037 #2378 +/- ##
==========================================================
Coverage ? 82.59%
==========================================================
Files ? 642
Lines ? 39495
Branches ? 4062
==========================================================
Hits ? 32620
Misses ? 6154
Partials ? 721
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Isn't the state gas spent by a frame not refunded in the case of revert? From the EIP:
I'm guessing that this also applies to SSTORE as well:
|
43b63ca to
eb27582
Compare
|
Thx @jwasinger. Comments below! These two EIP quotes are about different items compared to what the PR changes. What this PR changes:
|
eb27582 to
7ce782a
Compare
2dd44d2
into
ethereum:eips/amsterdam/eip-8037
🗒️ Description
When a child frame's state gas spills from the reservoir into
gas_leftand then reverts or halts, the spilled state gas was lost. Since state changes are rolled back, all state gas (reservoir + spill) should be restored to the parent's reservoir, not just the original reservoir.🔗 Related Issues or PRs
N/A.
✅ Checklist
toxchecks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx tox -e statictype(scope):.Cute Animal Picture