Discussion topic EIP-8455
Summary
EIP-8037 splits gas into execution gas and state gas, and lets state gas be paid from a reservoir that GAS does not report. EIP-8141 frame transactions have a similar per-frame state_gas_left. As a result, contracts can no longer see their full remaining budget, and measuring a sub-call with two gasleft() readings under-counts any state gas the reservoir paid for.
This EIP adds one opcode, RESERVOIR (0x4d), which pushes the state gas available to the current frame that GAS does not include:
- for reservoir-model transactions (EIP-8037), the frame’s
state_gas_reservoir - inside an EIP-8141 frame transaction, the frame’s
state_gas_left
GAS and RESERVOIR together let a contract read its whole remaining budget and measure the full cost of a code region or call, state gas included.
Motivation
Protocols that meter sub-calls by subtracting two gasleft() readings, such as the ERC-4337 EntryPoint, under-count state gas whenever the reservoir pays for it. A call that creates one storage slot looks 97,920 gas cheaper when the reservoir funds the slot than when gas_left does. EIP-8037 points this out and asks such protocols to account for state gas explicitly, but no instruction currently exposes the value they need. RESERVOIR exposes it.
Design notes
- Opcode
0x4d. It sits in the block/transaction environment range (0x40–0x4f) and is currently unassigned. There is no free byte next toGAS(0x5a). GASis not redefined. MakingGASreturngas_left + reservoirwould break its main use as theCALLgas argument, which is capped at 63/64 ofgas_left. It would also change behavior for deployed contracts.- Separate instruction rather than a combined one. One opcode returning both pools was rejected to keep the interface aligned with
GAS. ACALLvariant taking a state-gas limit is a larger change that could later build onRESERVOIR. - EIP-7702. Authorization charges are applied before the first frame and are not refilled by a top-level revert, so delegated code cannot observe an inflated value.
Security considerations
RESERVOIRdepends on the inclusion context the same wayGASdoes. ERC-7562 validation rules restrictGASduring ERC-4337 validation and should restrictRESERVOIRin the same way.- Contracts whose success depends on
RESERVOIRcan make the set of sufficienttx.gasvalues non-monotonic, as withGAS, which affects gas estimation. - State gas prices and the execution/state split may change in later forks, so contracts should measure consumption rather than hard-code expected amounts.
Reference implementation & tests
The assets include patches for go-ethereum and execution-specs, plus test fillers covering both the reservoir model and frame transactions.
Update Log
- 2026-10-23: Initial draft, PR #12577
External Reviews
None as of 2026-10-28.
Outstanding Issues
None as of 2026-10-28.
Feedback is especially welcome on:
- the choice of
0x4dversus other free bytes, given pending proposals for0x4c,0x4eand0x4f - whether ERC-4337 / ERC-7562 maintainers agree on the validation-time restriction
- whether returning the reservoir alone is enough, or a combined view would be useful too