EIP-1930: Strict gas semantics for CALL variant

Hi all,

I am resurrecting EIP-1930 from Stagnant to Draft, with an updated specification: ethereum/EIPs#12791. The original discussion was in ethereum/EIPs#1930; as requested by the editors back then, this thread replaces it.

What it does

It adds STRICTCALL, STRICTDELEGATECALL and STRICTSTATICCALL (provisionally 0xe0 to 0xe2). They behave exactly like their counterparts, except that the gas argument is a requirement instead of a maximum: if, after all the charges the call makes before entering the callee, the calling frame cannot forward the requested gas under the 63/64 rule of EIP-150, the calling frame halts as if out of gas. It also halts when the call would abort before entering the callee (insufficient balance, depth limit). So when a strict call returns 0, the callee ran with exactly the gas that was asked for and failed on its own.

Under EIP-8037 the guarantee is on execution gas (gas_left); the state-gas reservoir is forwarded on top, as it already is. Since state charges come out of gas_left when the reservoir is empty, a requirement sized for an empty reservoir is enough whatever the transaction gas limit.

In EIP-8141 frame transactions, state gas comes only from the frame’s own state budget, which the transaction signer picks. So STRICTCALL and STRICTDELEGATECALL also take a state_gas requirement, right after gas: in a frame transaction the calling frame halts if state_gas_left is below it. Outside frame transactions it is not checked. Contracts pass gas = execution + state and state_gas = state, which is correct in both. STRICTSTATICCALL is unchanged. (Added 2 Dec, see the update below.)

Why now

“Do not rely on gas pricing” has been good advice for years. But a contract that needs a call to receive a given amount of gas (a meta-transaction forwarder, a smart account, a relayer, a bridge executor, a keeper, an ERC-165 check) has had no way to get that guarantee without relying on gas pricing. The only technique is a gasleft() check before the call with an overhead constant that bounds every charge between the check and the callee, and that constant is the gas schedule.

The Glamsterdam changes (EIP-8037 and EIP-8038) make this concrete. The list of invariants published for auditors includes several that come from this gap, and its guide to handling call failures recommends exactly this pre-call check (rule D), with a governance-adjustable overhead because the next repricing will change it. This EIP lets the EVM do that check at the one point where every charge is known. To be clear about the scope:

  • It addresses INV-6, the starvation part of INV-1, the “why did the call fail” half of INV-3, and the nonce part of INV-7, for contracts that use it.
  • It does not address INV-2, INV-4, INV-5, INV-8, stipends, reserves for work after the call, or unchecked CREATE.
  • It does nothing for contracts already deployed. It is for the contracts written from now on.

Design choices I would like feedback on

  1. New opcodes rather than a flag bit in the gas argument (the “option B” of the old draft). Option B would change the meaning of deployed bytecode that passes gas values with the top bit set, and would hide the guarantee from static analysis. EOF is Stagnant and its EXTCALL dropped the gas argument altogether, so the legacy space is where this has to live. Opcode numbers are provisional.
  2. Exceptional halt of the calling frame (not a REVERT-like return of the remaining gas).
  3. Halting also on the insufficient-balance and depth-limit aborts, so a 0 result has a single meaning.
  4. eth_estimateGas needs no change: estimators that search for the smallest non-failing gas limit converge above the requirement, because an unmet requirement makes the transaction fail. A non-normative note describes how a client can compute the implied gas limit in one run (the idea of my old REQUIRE_GAS proposal).
  5. No strict CALLCODE.

Answers to the 2019 objections

  • “Niche”: see the list of use cases and invariants above.
  • “Can be done with require(gasleft() >= X)”: that ignores the 63/64 rule, and the correct check depends on the gas schedule.
  • “Gas costs will not go up”: they have, several times, and they need to. That is why contracts need a way to state their requirements that does not depend on prices.
  • “Opcode space”: three opcodes in the legacy space, see point 1.

Prototype

There is a prototype on top of the execution specs (post-Amsterdam development fork), with consensus tests that fill against it, including boundary cases (exact gas and one gas short, for all three variants and their counterparts) and account creation with and without a reservoir, and frame transactions with a state budget exactly at the requirement and one short: wighawag/execution-specs, branch eips/bogota/eip-1930.

Background reading: Ethereum, the concept of gas and its dangers (2020) and gnosis/safe-contracts#100.

Feedback very welcome, especially from client teams on opcode allocation and from contract and compiler developers on whether this is the primitive you would use.

1 Like

Thanks for reviving this. The core improvement is clear: STRICTCALL turns an uncertain gas forward into an explicit execution requirement, which should make failure reasons more predictable for smart accounts, relayers, bridges, and other delegated execution flows.

From a governance and operational risk perspective, the useful part is that a failed strict call has a clearer meaning: either the required gas could not be forwarded, or the callee failed with the requested gas. That should help protocol teams distinguish infrastructure or policy failures from application level failures.

One question: how do you see DAOs and protocol teams setting the required gas amount over time, especially if gas costs or execution workloads change? Would you expect this to be handled through policy thresholds, offchain monitoring, or future tooling?

It would be the same as now: estimate gas and provide the one that is enough for the inner call to succeed

1 Like

Thanks. That makes sense. So the main benefit is not a new gas policy layer, but a clearer and more enforceable minimum execution guarantee at the call boundary.

For DAOs and protocol teams, this could reduce ambiguity when a delegated execution, treasury action, or smart account call fails: they can better distinguish a gas forwarding failure from a failure inside the callee.

Would you expect tooling to eventually expose the required gas amount as a first class parameter in wallet, relayer, and automation interfaces, so operators can monitor changes in execution workloads over time?

Update: EIP-1930 now also covers EIP-8141 frame transactions.

EIP-8141 (Scheduled for Hegotá) gives each frame an explicit state budget, and state gas comes only from that budget, never from gas_left. That breaks an assumption in the previous draft: a requirement sized for an empty reservoir covered state gas only because, under the EIP-8037 reservoir model, state charges spill into gas_left. In a frame transaction, whoever signs the transaction picks the state budget. So with a meta-transaction submitted inside someone else’s frame transaction, the callee can get its full gas and still halt on its first state charge, and a strict call would report that as the callee’s own failure.

The fix is now in the PR (Update EIP-1930: Move to Draft by wighawag · Pull Request #12791 · ethereum/EIPs · GitHub):

  • STRICTCALL and STRICTDELEGATECALL take a second requirement, state_gas, right after gas.
  • In a frame transaction, the call also requires the frame’s state_gas_left to be at least state_gas (after the call’s own account-creation charge), and halts the calling frame otherwise. Outside frame transactions it is not checked, since state charges spill into the gas that is already guaranteed.
  • STRICTSTATICCALL is unchanged: a static callee cannot create state.
  • Contracts pass gas = execution + state and state_gas = state, which is correct in both kinds of transaction.

I also considered propagating state-pool exhaustion instead (no new argument: if the callee’s call tree runs out of the frame’s state pool, the strict caller halts too). I did not go with it because it would let a callee turn its own failure into a halt of its caller, which the reservoir model does not allow, and which matters for batch processing.

The prototype is updated too, with frame-transaction tests: a state budget exactly at the requirement, and one short: GitHub - wighawag/execution-specs at eips/bogota/eip-1930 · GitHub

This is also a reason to look at strict calls together with 8141, rather than after it.

I raised the related gaps on the 8141 thread: EIP-8141: Frame Transaction - #190 by wighawag