fix(L1): seed imported schedule protocol version - #420
Open
jackchuma wants to merge 3 commits into
Open
Conversation
Require imported activations to initialize their minimum packed version atomically so nodes never read a scheduled upgrade with version zero. Co-authored-by: Cursor <cursoragent@cursor.com>
Collaborator
🟡 Heimdall Review Status
|
Rely on the atomic initializer for schedule validation and keep deployment-state verification in the integration test. Co-authored-by: Cursor <cursoragent@cursor.com>
Validate the imported schedule and minimum version before any broadcast so a bad config cannot strand a partially deployed deterministic system. Co-authored-by: Cursor <cursoragent@cursor.com>
leopoldjoy
reviewed
Aug 25, 2026
| revert IProtocolVersions.ProtocolVersions_InvalidProtocolVersion(); | ||
| } | ||
| if (_input.initialMinimumProtocolVersion == 0) { | ||
| for (uint256 i = 0; i < _input.initialUpgradeSchedule.length; i++) { |
Contributor
There was a problem hiding this comment.
Should we also validate that non-zero timestamps are ordered here, since an unordered schedule passes this preflight and only reverts in initialize after earlier deployment transactions have been broadcast?
| abi.encodeCall(IProtocolVersions.initialize, (address(0), cfg.protocolVersionsInitialSchedule())) | ||
| abi.encodeCall( | ||
| IProtocolVersions.initialize, | ||
| (address(0), cfg.protocolVersionsInitialSchedule(), cfg.protocolVersionsInitialMinimumVersion()) |
Contributor
There was a problem hiding this comment.
Should we mirror the imported schedule validation in _preflight() before startBroadcast(), otherwise an invalid schedule/minimum-version pair would revert only after the infrastructure and TEE transactions have been sent?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed? Why?
ProtocolVersions.initializeto set the minimum packed protocol version atomically with an imported schedule and reject non-zero activation timestamps when that version is zero.protocolVersionsInitialMinimumVersionthrough the standard and multiproof deployment paths, retaining the config parser's packed-version bound check.SystemDeploysends any broadcast transaction, preventing invalid configuration from stranding a partially deployed deterministic system.This keeps imported activation schedules immediately consumable by nodes, which reject positive activation timestamps paired with protocol version zero.
Notes to reviewers
minimumProtocolVersionremains outside thescheduleIdcommitment.SystemDeploymirrors the invariant only as a preflight because script broadcasts are separate transactions and a later revert cannot roll back earlier broadcasts.How has it been tested?
just testjust test --match-path test/deploy/SystemDeploy.t.soljust test --match-path test/L1/ProtocolVersions.t.soljust build-no-testsjust test --match-test test_cannotReinitialize_succeedsjust snapshotsforge fmt --checkjust lint-forge-tests-check-no-buildjust validate-spacers-no-build