feat(L1): bake the Cobalt speedup activation into AggregateVerifier - #433
Closed
0xth4nh wants to merge 1 commit into
Closed
feat(L1): bake the Cobalt speedup activation into AggregateVerifier#4330xth4nh wants to merge 1 commit into
0xth4nh wants to merge 1 commit into
Conversation
Replace the ProtocolVersions schedule lookup in `_firstFastBlock()` with an immutable activation timestamp supplied at construction. `ProtocolVersions` is not being activated for Cobalt — it runs in metrics-only mode on sepolia and mainnet — so index 12 of `getSchedule()` will never be written there. The old lookup fails open: an unwritten entry returns `type(uint256).max`, which keeps every game on the slow-block intervals while L2 runs at 200ms, silently. `PROTOCOL_VERSIONS` is retained for `activatedScheduleId` scheduleId pinning. Co-Authored-By: Claude <noreply@anthropic.com>
Collaborator
🟡 Heimdall Review Status
|
Contributor
Author
|
Closing — we're keeping ProtocolVersions as the single source for the activation time rather than introducing a second one. |
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.
Follow-up to #431 (merged).
What changed?
AggregateVerifierno longer reads the fast-block activation fromProtocolVersions.ScheduleConfiggainsuint64 fastBlockActivationTimestamp, exposed asuint64 public immutable FAST_BLOCK_ACTIVATION_TIMESTAMP.FAST_BLOCK_UPGRADE_INDEX(the hardcodedgetSchedule()[12]lookup) is deleted._firstFastBlock()now derives the boundary from the immutable and the L2 genesis/block-time immutables.0means "speedup unscheduled" — every game uses the slow-block intervals. This lets the implementation ship before the activation time is agreed, at the cost of a redeploy once it is.multiproofFastBlockActivationTimestampconfig key (defaults to0), plumbed throughDeployConfig→SystemDeploywith auint64overflow check.0.2.0→0.3.0;snapshots/semver-lock.jsonregenerated (only theAggregateVerifierentry moves).PROTOCOL_VERSIONSis deliberately retained —activatedScheduleId(claimTimestamp)still drives scheduleId pinning. Only the interval selection stops depending on the registry.Why?
ProtocolVersionswill not be activated for Cobalt. It runs in metrics-only mode on sepolia and mainnet (--upgrade-signal.mode), so index 12 ofgetSchedule()is never written on those chains.The old lookup fails open: an index past the end of the schedule returns
type(uint256).max, so_firstFastBlock()sits beyond every real block number and the verifier keeps handing out slow-block intervals forever. On a chain that has already switched to 200ms blocks, that is a silent mismatch between the proposer's cadence and the verifier's expectation — no revert, no event, just wrong intervals.An immutable also removes a class of race the registry has: every game backed by a given implementation resolves the same boundary, and there is no mutation that can move an in-flight game across it. Changing the activation means deploying a new implementation, which is a new game type in the factory, so it can never apply retroactively.
How to test?
The new case is the one that pins the behaviour change:
It writes a
ProtocolVersionsschedule that stops one entry short of index 12 — i.e. a chain that never signalled the speedup — assertsgetSchedule().length == 12, then deploys a verifier withfastBlockActivationTimestamp = L2_GENESIS_TIMESTAMP + 100and checks the boundary lands at block 50 (divUp(100, 2)): block 49 gets the slow interval pair, block 50 gets the fast pair. Onmainthis test cannot pass — with the registry short of index 12 the verifier stays slow at every block.Full suite on this branch:
1232 passed, 0 failed, 1 skipped.Deploy-time check:
multiproofFastBlockActivationTimestampis absent from every existing config, soreadUintOr(..., 0)yields0and existing deployments keep slow intervals —forge test --match-contract SystemDeploycovers that path unchanged.