feat(`hardfork`): support EIP-7907: increase initcode and contract code size limit
Component
Forge
Describe the feature you would like
EIP: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7907.md
Some of the work could be done before it gets scheduled for inclusion (we should know in the next few weeks if it does).
While EIP 7907 is being tested, devs can use --ignore-eip-3860 which allows for builds above the current limits.
Changes required (wip):
forge build --sizesshould be updated to show the new max sizes (yellow/red colors and margin columns)forge test --gas-reportgas metering changes forcontract code size > 24KB
Relevant code (wip):
- https://github.com/foundry-rs/foundry/blob/f86a66ea206d5e3405dce7cdfffc7c843a8b43cf/crates/common/src/constants.rs#L15
Additional context
Current forge build --sizes example output
Happy to try to take a swing at this if no one is already. I'll open a wip PR with any progress I make, otherwise please let me know if there are any feedback/suggestions or additional changes required.
One question I have for forge maintainers:
Should the max sizes be released as default in lock step with Osaka fork? Should an --eip-7907 flag be introduce to forge (would apply gas metering to forge test and new limits to forge build? or should --max-initcode-size and --max-contract-size be introduced on forge build for custom limits (better for multichain support?)
Hi @jgresham I'm very excited for EIP-7907! Feel free to open a draft PR.
Regarding the max sizes, I can imagine we will default to using the new contract size limit as proposed. Based on the EVM version specified we enforce the corresponding size limits as defined by the version. This means L2s that do not yet support Osaka will use the old size limit. I imagine L2s will rapidly adopt this EIP as it has most positive impact to the developer experience on L2s.
Once confirmed to be included in Osaka we can move ahead with inclusion in Foundry.
RIP. 7907 is removed from Fusaka due to time constraints on testing team and possibly going for a better code chunking eip in the future https://github.com/ethereum/EIPs/pull/10026 cc @grandizzy