EIP-3860: Expanding Initcode and Gas Costs for Smarter Contracts
The Ethereum ecosystem is evolving, and with it comes EIP-3860 — a pivotal proposal aiming to reshape the maximum initcode size and introduce proportional gas charges. Initiated as part of the Shanghai Upgrade, let’s dive into what this means for us as developers.
Crafted on July 16th, 2021, EIP-3860 targets critical changes to streamline our contract creation processes. The lack of an initcode size limit has sparked extensive debates, often delaying or altering EVM proposals. By establishing a maximum size limit, we can simplify EVM engines and set clear-cut boundaries like code size, offsets, and jumps within a 16-bit space.
Initcode represents the code executed when creating a new contract. While EIP-170 capped this at 24,576 bytes, our new proposal suggests doubling it to 49,152 bytes. This leap means more room for sophisticated functionality in contract design.
To ensure fairness in resource allocation, gas costs will now be tied closely to initcode length. For every byte of initcode used, an additional cost of 0.0625 gas will be incurred. There’s also a supplemental charge — 2 gas for each 32-byte segment of initcode — accounting specifically for jump destination analysis during deployment.
EIP-3860 introduces two core rules: INITCODEWORDCOST (a cost of 2) and MAXINITCODESIZE (twice the current limit). Transactions exceeding MAXINITCODESIZE will be invalidated — an essential step towards maintaining network efficiency. Additionally, insufficient gas to cover the program’s cost renders transactions invalid.
For CREATE and CREATE2 instructions, expect an extra pre-execution gas deduction based on performance benchmarks grounded in KECCAK256 hashing metrics from Geth v1.10.9 or later.
This proposal signifies not just an upgrade but a strategic optimization that aligns costs with actual usage while empowering us to build more robust contracts.
What are your thoughts on these changes? How will they impact your development processes?
Let’s discuss below!