feat: support custom code size limit#1965
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8203a2951e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (_newBatch.codeSizeLimit != s.codeSizeLimit) { | ||
| revert IncorrectBatchCodeSizeLimit(_newBatch.codeSizeLimit, s.codeSizeLimit); |
There was a problem hiding this comment.
Initialize codeSizeLimit on upgrade
For existing ZKsync OS chains that upgrade to this code, s.codeSizeLimit will default to zero because the new storage slot is appended and DiamondInit only runs on fresh deployments. The new equality check in Executor._commitOneBatchZKsyncOS (_newBatch.codeSizeLimit != s.codeSizeLimit) will therefore revert for any commit that uses the normal EIP‑170 limit (0x6000), effectively halting batch commits until an admin explicitly calls setCodeSizeLimit. If upgrades are expected to be seamless, this needs an initialization/migration path or a safe fallback when s.codeSizeLimit == 0.
Useful? React with 👍 / 👎.
| if (_codeSizeLimit > MAX_CODE_SIZE_LIMIT) { | ||
| revert CodeSizeLimitTooBig(_codeSizeLimit, MAX_CODE_SIZE_LIMIT); | ||
| } | ||
| s.codeSizeLimit = _codeSizeLimit; |
There was a problem hiding this comment.
Please always add events for functions that change the config on smart contract. It is the easiest way to monitor the smart contract.
nikitastupin-matterlabs
left a comment
There was a problem hiding this comment.
Please add tests. The code looks good to me 👍
What ❔
Why ❔
Checklist