EIP-7903: Remove Initcode Size Limit

discussion topic for Add EIP: Remove Initcode Size Limit by charles-cooper · Pull Request #9452 · ethereum/EIPs · GitHub

2 Likes

Is Pectra off the table for this?

:smiley:

benchmarks (tl;dr: jumpdest analysis shows a strong linear correlation to initcodesize, at sizes ranging from 128 bytes to 15MB):

It is not explicitly mentioned in the benchmark summary what implementation is measured, but I’m guessing this is the C++ code in the same repo. I believe this would be more meaningful if existing implementations (e.g. geth, revm, nethermind). Also the benchmarks don’t necessarily target the worst cases. Depending on the implementation, the worst cases is some combination of PUSH1, PUSH2 and JUMPDEST.

This must be coordinated with EIP-7825 (discussed in Eip 7825: Transaction Gas Limit Cap) which is going to put its own limits on the both initcode and deploy code sizes.

1 Like

Can you specify what the worst case is? Happy to accept a pull request if some important case has been missed.

As @chfast mentioned this might need an update due to EIP-7825: Transaction Gas Limit Cap introduced in Fusaka. This limits the gas limit per tx to 16777216. When deploying contracts, 200 gas per byte has to be paid for the deployment costs (and this does not cover extra costs like tx intrinsic costs, memory expansion costs, etc.). So this already puts a hard limit of maximum code size of 16777216 // 200 = 83886 bytes per transaction. Note that Pectra also got EIP-7623 (Increase calldata cost) which makes the initcode more expensive, which would also interact with the goal here.

If EIP-7907 would go live in this draft form: EIPs/EIPS/eip-7907.md at a053474ee1e38b8eaa5058c6a3a5d51098599725 · charles-cooper/EIPs · GitHub (which increases initcodesize limit to 128 KiB and the max code size to 64 KiB), would this be sufficient? Would the 128 KiB initcode size and the max code size of 64 KiB (for now) be enough to also take into account the highest bytes to deploy with EIP-7825 is 83_886 bytes?

My personal line of thought would go like this: EIP-7825 puts a hard limit on code size currently. It is possible to deploy ~3-4 maximally sized contracts (of 24 KiB) after Fusaka. It is likely that if one wants to deploy 2 or more contracts then one is hindered by the initcode. I am then wondering: because of this new tx gas limit in EIP-7825 it is already somewhat clear that for multi-contract setups one should likely send multiple txs for this (this is now baked into the protocol). Is this EIP-7903 then still necessary in Glamsterdam (or a later fork?). And what if EIP-7907 would get shipped as the draft above in Glamsterdam (max code size 64 KiB and initcode size 128 KiB), would this then also alter the necessity of EIP-7903 in Glamsterdam?

1 Like