EIP-1285 Raising the CALL stipend gas (Increase Gcallstipend gas in the CALL opcode)
No call decision · EVM & execution · EIP status Stagnant · created 2018-08-01
A proposal to increase the stipend, the free gas given to a receiving contract when ETH is sent via CALL, from 2,300 to 3,500, so that the fallback functions of proxy contracts can work properly.
Why it is needed
When ETH is sent via CALL on Ethereum, a separate stipend of 2,300 gas is granted so the receiving contract can execute its fallback function. This value is deliberately set low to prevent reentrancy attacks. However, the proxy pattern allows contract code to be deployed lightly while remaining upgradeable later. In this pattern, the proxy's fallback spends about 1,000 gas just calling the actual logic contract via DELEGATECALL. That leaves only about 1,300 gas for the logic contract's fallback to actually use, barely enough for a single LOG. Because of this, contracts using the proxy pattern struggle to perform proper processing when receiving ETH.
What changes
Today
- Sending ETH via CALL only supports 2,300 gas for the receiving contract's fallback function
- A proxy contract spends about 1,000 gas on the DELEGATECALL itself, leaving only about 1,300 gas for logic execution
- Even a simple record like LOG barely fits, and only with a single parameter
- A value deliberately set low to prevent reentrancy attacks
After EIP-1285
- The stipend increases to 3,500 gas
- Enough to cover DELEGATECALL (about 1,000) and SLOAD, plus a small margin
- The proxy pattern's fallback function can perform logic such as reading from storage
- Still kept too low to be used for writing storage changes or attacks
Who is affected
- Smart contract developers: When building upgradeable contracts using the proxy pattern, more processing becomes possible within the fallback function.
- Client (node software) teams: The CallStipend constant value must be changed at the protocol level in clients such as Geth.
- Already deployed contracts: If logic was built around the assumption of 2,300 gas, behavior may change, breaking backward compatibility.
In depth
What is the stipend
When a CALL operation is made with a nonzero value, the gas separately granted so the called contract can execute its fallback function is called Gcallstipend. The existing value is 2,300, deliberately set low so the called contract cannot exhaust the forwarded gas or carry out attacks such as reentrancy. However, it was set at a level that still allows cheap operations like LOG to execute.
What changes
This EIP proposes raising the Gcallstipend gas parameter of the CALL opcode from 2,300 to 3,500. From a client implementation standpoint, this is simply a matter of changing the CallStipend value stored as a constant, and the original text includes a link to an example implementation modifying this constant in the Geth client.
Why it falls short for the proxy pattern
The proxy pattern is used when building upgradeable contracts. This pattern executes the actual logic contract's code via DELEGATECALL inside the fallback function. Since this DELEGATECALL itself consumes an average of about 1,000 gas, out of the 2,300 gas stipend, only about 1,300 gas is actually usable by the logic contract's fallback. This is such a severe constraint that it can barely handle a single-parameter LOG, making it difficult for contracts receiving ETH through a proxy to have proper processing logic.
Basis for the 1,200 gas figure
The proposed increase of 1,200 gas comes from the cost of performing a DELEGATECALL and an SLOAD, plus a small margin. Even with this increase, the stipend remains relatively small, still insufficient for changing storage or altering state.
Security design intent
The purpose of increasing the stipend is to improve the usability of fallback logic in the proxy pattern without widening the attack surface on the calling contract's side. In other words, the goal is not to provide enough gas to be used for reentrancy attacks, but to enable the minimal processing commonly needed in proxy structures.
Backward compatibility and the need for a fork
Since Gcallstipend is a gas parameter of the Ethereum protocol itself, changing this value is a backward-incompatible change that all clients must adopt simultaneously. The original text explicitly states this as a backward incompatible change.
Current status
This EIP is Stagnant and has not actually been incorporated into the Ethereum mainnet protocol. Only example implementation code based on Geth remains linked; it has never been adopted as a standard or included in a fork.