-
Notifications
You must be signed in to change notification settings - Fork 409
feat: support custom code size limit #1965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: zksync-os-stable
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ import {L2_BOOTLOADER_ADDRESS, L2_SYSTEM_CONTEXT_SYSTEM_CONTRACT_ADDR, L2_TO_L1_ | |
| import {IChainTypeManager} from "../../IChainTypeManager.sol"; | ||
| import {PriorityOpsBatchInfo, PriorityTree} from "../../libraries/PriorityTree.sol"; | ||
| import {IL1DAValidator, L1DAValidatorOutput} from "../../chain-interfaces/IL1DAValidator.sol"; | ||
| import {IncorrectBatchChainId, BatchHashMismatch, BatchNumberMismatch, CanOnlyProcessOneBatch, CantExecuteUnprovenBatches, CantRevertExecutedBatch, HashMismatch, InvalidLogSender, InvalidMessageRoot, InvalidNumberOfBlobs, InvalidProof, InvalidProtocolVersion, InvalidSystemLogsLength, L2TimestampTooBig, LogAlreadyProcessed, MissingSystemLogs, NonIncreasingTimestamp, NonSequentialBatch, PriorityOperationsRollingHashMismatch, RevertedBatchNotAfterNewLastBatch, SystemLogsSizeTooBig, TimeNotReached, TimestampError, TxHashMismatch, UnexpectedSystemLog, UpgradeBatchNumberIsNotZero, ValueMismatch, VerifiedBatchesExceedsCommittedBatches, InvalidBatchNumber, EmptyPrecommitData, PrecommitmentMismatch, InvalidPackedPrecommitmentLength, NonZeroBlobToVerifyZKsyncOS, InvalidBlockRange} from "../../../common/L1ContractErrors.sol"; | ||
| import {IncorrectBatchChainId, IncorrectBatchCodeSizeLimit, BatchHashMismatch, BatchNumberMismatch, CanOnlyProcessOneBatch, CantExecuteUnprovenBatches, CantRevertExecutedBatch, HashMismatch, InvalidLogSender, InvalidMessageRoot, InvalidNumberOfBlobs, InvalidProof, InvalidProtocolVersion, InvalidSystemLogsLength, L2TimestampTooBig, LogAlreadyProcessed, MissingSystemLogs, NonIncreasingTimestamp, NonSequentialBatch, PriorityOperationsRollingHashMismatch, RevertedBatchNotAfterNewLastBatch, SystemLogsSizeTooBig, TimeNotReached, TimestampError, TxHashMismatch, UnexpectedSystemLog, UpgradeBatchNumberIsNotZero, ValueMismatch, VerifiedBatchesExceedsCommittedBatches, InvalidBatchNumber, EmptyPrecommitData, PrecommitmentMismatch, InvalidPackedPrecommitmentLength, NonZeroBlobToVerifyZKsyncOS, InvalidBlockRange} from "../../../common/L1ContractErrors.sol"; | ||
| import {CommitBasedInteropNotSupported, DependencyRootsRollingHashMismatch, InvalidBatchesDataLength, MessageRootIsZero, MismatchNumberOfLayer1Txs, MismatchL2DACommitmentScheme} from "../../L1StateTransitionErrors.sol"; | ||
|
|
||
| // While formally the following import is not used, it is needed to inherit documentation from it | ||
|
|
@@ -193,6 +193,9 @@ contract ExecutorFacet is ZKChainBase, IExecutor { | |
| if (_newBatch.chainId != s.chainId) { | ||
| revert IncorrectBatchChainId(_newBatch.chainId, s.chainId); | ||
| } | ||
| if (_newBatch.codeSizeLimit != s.codeSizeLimit) { | ||
| revert IncorrectBatchCodeSizeLimit(_newBatch.codeSizeLimit, s.codeSizeLimit); | ||
|
Comment on lines
+196
to
+197
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For existing ZKsync OS chains that upgrade to this code, Useful? React with 👍 / 👎.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @AntonD3 the comment is correct |
||
| } | ||
| if (_newBatch.daCommitmentScheme != s.l2DACommitmentScheme) { | ||
| revert MismatchL2DACommitmentScheme(uint256(_newBatch.daCommitmentScheme), uint256(s.l2DACommitmentScheme)); | ||
| } | ||
|
|
@@ -203,6 +206,7 @@ contract ExecutorFacet is ZKChainBase, IExecutor { | |
| bytes32 batchOutputHash = keccak256( | ||
| abi.encodePacked( | ||
| _newBatch.chainId, | ||
| _newBatch.codeSizeLimit, | ||
| _newBatch.firstBlockTimestamp, | ||
| _newBatch.lastBlockTimestamp, | ||
| uint256(_newBatch.daCommitmentScheme), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please always add events for functions that change the config on smart contract. It is the easiest way to monitor the smart contract.