EIP-7907: Unlocking Larger Contracts and Improving Developer Experience on Ethereum

EIP-7907: Unlocking Larger Contracts and Improving Developer Experience on Ethereum

🚀 Our proposed EIP-7907 is a candidate in Ethereum's Glamsterdam Upgrade!

EIP-7907, co-authored by Qi Zhou, founder of EthStorage, is now officially a candidate for Ethereum's upcoming Glamsterdam upgrade. This marks a major milestone for the broader Ethereum community. Qi Zhou has been one of the most active contributors in the Ethereum ecosystem.

By addressing a long-standing bottleneck in developing contracts, this EIP takes a critical step toward improving the developer experience on Ethereum.

Why We Need EIP-7907

Before EIP-170: Unlimited Size, Unlimited Risk

In Ethereum's early days, there was no limit on the size of a smart contract. This meant that as the contract size increased, the resource consumption—CPU, storage, and memory—would grow linearly. Reading large code from storage became expensive, but Ethereum charged a fixed gas cost of 2600, regardless of contract size.

This created a vulnerability: attackers could deploy extremely large contracts and exploit the mismatch between resource usage and gas fee, creating potential Denial-of-Service (DoS) vectors.

For example, an attacker could create a transaction that tries to call all large contracts, with each call costing only 2,600 gas. Given the current block gas as being ~35M and the average large contract ~256KB, this could force an EVM client to read up to 35M/2600*256KB=3.2GB of contract data within a single block - an operation might take 12–16 seconds on a commodity PC with 200MB/s read speed.  As a result, producing such a block on the Ethereum mainnet can easily exceed the 12s time budget of a block and put the consensus at risk.

This is like paying the same fare whether your Uber ride is just around the corner — say 2 km — or all the way to the airport — say 50 km away. The longer the trip, the more resources the driver spends — but the fare remains flat. This inefficiency and unfairness resulted in DoS vulnerabilities.

EIP-170: The 24KB Contract Size Limit

To fix this, EIP-170 introduced a 24KB contract size limit to reduce DoS risk. At the time, this worked fine for simple dApps. However, as the ecosystem matured and more sophisticated applications like DEXs and lending protocols emerged, smart contracts became increasingly complex and often exceeded the 24KB limit easily.

Developers were now forced to split larger contracts into multiple sub-contracts, each of which must be below 24KB. 

This led to:

  • Higher development and maintenance costs
  • More complicated architecture
  • Increased security concerns
This perfectly captures how frustrating the 24KB contract size limit has been for developers across the ecosystem.

Introducing EIP-7907

EIP-7907 removes the 24KB limit and allows a much larger contract limit up to 48KB or 256KB, depending on constraints in the Ethereum protocol, allowing for the creation of significantly larger contracts.

The Key Idea: Dynamic Gas Metering

EIP-7907 introduces dynamic gas metering based on contract size, effectively mitigating DoS risks while improving developer experience.

  • For contracts ≤ 24KB, the gas cost remains unchanged at 2600.
  • For contracts > 24KB, additional gas is calculated as: (size - 24KB) × 2 ÷ 32.

This approach ensures that gas costs scale proportionally with contract size — discouraging abuse while supporting more advanced, complicated use cases.

This approach is similar to how ride-sharing services like Uber estimate the fare based on distance before confirming the trip — allowing for predictable, fair, and efficient resource usage.


What’s More?

There is also significant potential for EIP-7907 to work synergistically with other Ethereum EIPs, such as the cold/warm state model introduced in EIP-2929, which reduces gas costs for repeated storage access. 

In the case of EIP-7907, the cold/warm state in EIP-2929 is applied to contract code, which reduces gas costs for repeated access to large contracts, it can further enhance efficiency and developer experience. In this way, EIP-7907 contributes to a more robust and developer-friendly Ethereum.


Videos on EIP-7907

  • Qi Zhou’s Interview with PeepanEIP Link
  • Anthurine’s EIP-7907 Explanation @ EthPrague 2025 Link

References


If you have any questions, please visit our community channels for support and more information.