fix(L1): pin AggregateVerifier to a max supported upgrade id#381
Open
PelleKrab wants to merge 1 commit into
Open
fix(L1): pin AggregateVerifier to a max supported upgrade id#381PelleKrab wants to merge 1 commit into
PelleKrab wants to merge 1 commit into
Conversation
Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-019f8c5e-0bd1-73c0-8dda-efda794a0e6d
Collaborator
🟡 Heimdall Review Status
|
jackchuma
reviewed
Jul 23, 2026
| } | ||
|
|
||
| /// @notice The ProtocolVersions registry and the highest upgrade id the prover image supports. | ||
| struct ScheduleConfig { |
Contributor
There was a problem hiding this comment.
Is this added to avoid a stack-too-deep error in the constructor?
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.
Problem
The prover image only knows the upgrades compiled into its binary, but
AggregateVerifier snapshotted the live tail
scheduleId(). Registering a newupgrade onchain (even unscheduled) moved the tail, so the contract and prover
ScheduleIDs diverged unless both were updated in lockstep.
Solution
AggregateVerifier now takes a
MAX_UPGRADE_ID(via aScheduleConfigstruct)and snapshots
scheduleId(MAX_UPGRADE_ID), pinning games to the scheduleprefix the prover image supports:
registry can grow independently of deployed proof contracts.
upgrades the prover must honor still invalidate stale proofs.
registry has not registered up to it.
Deploy scripts seed the registry with unscheduled (
registerUpgrade(0, 0))entries through
multiproofMaxUpgradeIdso the constructor check passes;governance schedules activations later. The config value is intentionally
mandatory (no default) since it must match the prover image's
BaseUpgrade::CONTRACT_VARIANTS.Operational invariant
Nothing onchain ties L2 activation of upgrades beyond a game type's pin to
retiring that game type. Governance must switch the respected game type to an
implementation pinned at or above a new upgrade id before its activation
timestamp passes.