EIP-8488 Versioned opcodes for gas repricing

No call decision · Fees & gas · EIP status Draft · created 2026-11-08

Introduces a V2 opcode set that applies the new gas schedules from EIP-8037/8038 only to newly deployed contracts, while existing deployed contracts keep the legacy gas rules unchanged.

Why it is needed

The Glamsterdam fork aims to change the gas-cost structure via EIP-8037 and EIP-8038 to curb state growth, but applying this to all contracts at once risks unexpectedly breaking or exposing existing contracts that were written assuming current gas-cost premises. Conversely, delaying the new schedule's introduction also delays its state-growth-curbing effect, making it harder to raise the gas limit. This EIP offers a third path. It forces the new gas schedule only on bytecode newly deployed after activation, leaving already-deployed contracts untouched. Upgradeable systems naturally move to the new schedule when their implementation is replaced, so over time the share of state growth under the legacy schedule shrinks, and the gas limit can be raised gradually by that design.

What changes

Today

After EIP-8488

Who is affected

In depth

V2 opcode set

A V2 counterpart is defined for every opcode whose gas cost or gas-accounting method changes under EIP-8037 or EIP-8038. Examples include SSTORE_V2, SLOAD_V2, CALL_V2, DELEGATECALL_V2, CREATE_V2, and CREATE2_V2. Each V2 opcode is identical to the original opcode except that its gas schedule follows EIP-8037/8038. However, opcodes whose main purpose is exposing internal gas metering, such as GAS (0x5a) and GASLIMIT (0x45), do not exist in the V2 set, and attempting to include them in V2 bytecode is rejected at deployment. All other behavior, including stack, memory, storage, call behavior, and refunds, remains unchanged unless EIP-8037/8038 explicitly changes it.

Deployment gate

When runtime bytecode is deposited via CREATE, CREATE2, or any other code-creation path after this EIP's activation, that bytecode is scanned. If it contains even one non-V2 opcode that has a V2 counterpart, or an excluded gas-inspection opcode, deployment (the create operation) fails and reverts. On success, the account's code_version field is set to 2. Legacy accounts remain with code_version at 0 or unset. This scan applies to the final runtime code to be stored, not to the initcode.

DELEGATECALL_V2

DELEGATECALL_V2 is identical to DELEGATECALL except that, after loading the target account but before handing over control, it fails immediately if the target's code_version is below 2. On failure, the success flag becomes 0, there is no state change on the callee's side, and unused gas is returned under the normal rules. This version check is just a single account-field read, so it incurs no additional gas beyond the usual call overhead. Ordinary CALL, STATICCALL, and legacy DELEGATECALL are unchanged and can target any code version. DELEGATECALL_V2 succeeds only against a target confirmed to contain only V2 opcodes by passing the V2 deployment gate.

Interaction with EIP-8037 dual-gas accounting

Execution of V2 opcodes uses the gas schedule of EIP-8037/8038, including its state-gas reservoir mechanism. Execution of legacy opcodes continues to use the pre-Glamsterdam schedule. Which schedule applies is determined solely by the opcode being executed itself.

Design rationale

Because opcodes are duplicated rather than redefined, the bytecode itself self-describes which gas schedule applies, so aside from the 1-bit code_version, there is no need to separately look up the deployment block or external version information. The deployment gate is the same kind of linear scan clients already perform under EIP-3541. Recording code_version at deployment time makes the DELEGATECALL_V2 check O(1), reusing work the gate has already done. Only delegatecall-family opcodes need this restriction because only they execute the target code in the caller's context; ordinary calls execute in the callee's own context with the callee's own opcode set.

Backward compatibility

Every contract deployed before activation keeps running exactly as before under the legacy gas schedule, and existing bytecode is in no way invalidated. Only new deployments and uses of DELEGATECALL_V2 are affected. If a proxy-based system upgrades its implementation after activation, the new schedule applies automatically to subsequent delegatecalls without needing to change the proxy itself.

Security considerations and status

The deployment gate must be applied consistently and without exception to every code-deposit path; missing even one would let legacy-opcode contracts keep being newly created even after the fork. A DELEGATECALL_V2 failure is indistinguishable from an ordinary call failure and introduces no new reentrancy or gas-griefing vector beyond what DELEGATECALL already has. Future next-generation opcodes, such as a V3, could reuse the same pattern (new opcodes, an updated gate, a version check requiring code_version >= N). This EIP is currently in Draft status and requires EIP-8037 and EIP-8038, so details may change depending on those EIPs' contents, and no decision has been made on whether to include the fork in the call log.

Original EIP · ← EIPs