EIPs Explained

EIP-7903 · Stagnant · Core · 2025-03-05

EIP-7903: Remove Initcode Size Limit

A stagnant proposal to drop the 49,152-byte initcode cap from EIP-3860, so large logical contracts made of several sub-contracts can be deployed in a single transaction.

What problem does it solve?

Ethereum limits deployed (runtime) contract code to 24,576 bytes (EIP-170). One common argument for keeping that limit is that compilers and high-level languages can hide it: a big "logical" contract can be split into several "physical" sub-contracts behind the scenes.

EIP-3860 later added a second limit: creation code (initcode) may be at most 49,152 bytes, and it is charged 2 gas per 32-byte word for JUMPDEST analysis. That cap means a factory that wants to deploy many sub-contracts at once can run out of room, forcing a multi-transaction deployment and breaking the abstraction languages want to provide.

EIP-7903 argues the cap is unnecessary because the per-word gas charge already prices initcode fairly.

How it works

The change is small:

  • Remove the 49,152-byte maximum on initcode size for contract creation (creation transactions, CREATE and CREATE2).
  • Keep EIP-3860's per-word initcode gas charge unchanged.
  • Leave the EIP-170 limit on deployed runtime code untouched.

Initcode remains bounded in practice by the block gas limit and by the fact that it must already have been paid for as calldata or memory expansion. The author reports benchmarks where JUMPDEST analysis cost per byte stayed constant from 128 bytes up to about 15 MB of code.

Alternatives such as simply doubling the cap were considered and rejected as arbitrary.

Sample code

Pseudocode of the validity check before and after:

MAX_CODE_SIZE = 24576            # EIP-170, unchanged
MAX_INITCODE_SIZE = 2 * MAX_CODE_SIZE   # EIP-3860: 49152

def check_create(initcode, gas):
    # EIP-3860 today:
    # if len(initcode) > MAX_INITCODE_SIZE: fail
    # EIP-7903: the check above is removed.
    words = (len(initcode) + 31) // 32
    charge(gas, 2 * words)      # initcode word cost is kept
    runtime = execute(initcode)
    if len(runtime) > MAX_CODE_SIZE:
        fail()                  # deployed code limit still applies

A factory that would benefit, deploying several large sub-contracts in its constructor:

contract BigAppFactory {
    address public partA;
    address public partB;
    constructor() {
        // Each part may be close to 24 KB of runtime code; together the
        // factory's initcode exceeds 49,152 bytes, which EIP-3860 forbids.
        partA = address(new PartA());
        partB = address(new PartB());
    }
}

Things to know

  • Status: Stagnant. The proposal has not progressed and is not scheduled for any network upgrade.
  • It is purely a relaxation: no existing contract or transaction behaves differently.
  • It does not raise the deployed code limit. For proposals that touch that limit, see EIP-7907.

#evm #initcode #deployment #core #contract-size

Details

Authors
Charles Cooper (@charles-cooper)
Status
Stagnant
Type
Standards Track / Core
Created
2025-03-05
Requires

Machine-readable: Markdown · JSON