@@ -26,6 +26,7 @@ import { ReentrancyGuard } from "lib/solady/src/utils/ReentrancyGuard.sol";
2626
2727import { IVerifier } from "interfaces/L1/proofs/IVerifier.sol " ;
2828import { ISemver } from "interfaces/universal/ISemver.sol " ;
29+ import { IProtocolVersions } from "interfaces/L1/IProtocolVersions.sol " ;
2930
3031contract AggregateVerifier is Clone , ReentrancyGuard , ISemver {
3132 ////////////////////////////////////////////////////////////////
@@ -113,6 +114,9 @@ contract AggregateVerifier is Clone, ReentrancyGuard, ISemver {
113114 /// @notice The game type ID.
114115 GameType internal immutable GAME_TYPE;
115116
117+ /// @notice The ProtocolVersions upgrade schedule contract.
118+ IProtocolVersions public immutable PROTOCOL_VERSIONS;
119+
116120 ////////////////////////////////////////////////////////////////
117121 // State Vars //
118122 ////////////////////////////////////////////////////////////////
@@ -162,6 +166,11 @@ contract AggregateVerifier is Clone, ReentrancyGuard, ISemver {
162166 /// @notice The number of proofs provided.
163167 uint8 public proofCount;
164168
169+ /// @notice The ProtocolVersions scheduleId snapshotted at game initialization.
170+ /// @dev Pinned once at init; every proof in this game commits to this value, binding it to the
171+ /// upgrade schedule in effect when the game was created.
172+ bytes32 public scheduleId;
173+
165174 ////////////////////////////////////////////////////////////////
166175 // Events //
167176 ////////////////////////////////////////////////////////////////
@@ -259,6 +268,7 @@ contract AggregateVerifier is Clone, ReentrancyGuard, ISemver {
259268 /// @param l2ChainId The chain ID of the L2 network.
260269 /// @param blockInterval The block interval.
261270 /// @param intermediateBlockInterval The intermediate block interval.
271+ /// @param protocolVersions The ProtocolVersions upgrade schedule contract.
262272 constructor (
263273 GameType gameType_ ,
264274 IAnchorStateRegistry anchorStateRegistry_ ,
@@ -270,7 +280,8 @@ contract AggregateVerifier is Clone, ReentrancyGuard, ISemver {
270280 bytes32 configHash ,
271281 uint256 l2ChainId ,
272282 uint256 blockInterval ,
273- uint256 intermediateBlockInterval
283+ uint256 intermediateBlockInterval ,
284+ IProtocolVersions protocolVersions
274285 ) {
275286 // Block interval and intermediate block interval must be positive and divisible.
276287 if (blockInterval == 0 || intermediateBlockInterval == 0 || blockInterval % intermediateBlockInterval != 0 ) {
@@ -291,6 +302,7 @@ contract AggregateVerifier is Clone, ReentrancyGuard, ISemver {
291302 L2_CHAIN_ID = l2ChainId;
292303 BLOCK_INTERVAL = blockInterval;
293304 INTERMEDIATE_BLOCK_INTERVAL = intermediateBlockInterval;
305+ PROTOCOL_VERSIONS = protocolVersions;
294306
295307 INITIALIZE_CALLDATA_SIZE = 0x8E + 0x20 * intermediateOutputRootsCount ();
296308 }
@@ -364,6 +376,10 @@ contract AggregateVerifier is Clone, ReentrancyGuard, ISemver {
364376 // Set the game as initialized.
365377 initialized = true ;
366378
379+ // Snapshot the scheduleId from ProtocolVersions. Every proof in this game commits to this
380+ // value, pinning them to the upgrade schedule in effect at the game's creation block.
381+ scheduleId = PROTOCOL_VERSIONS.scheduleId ();
382+
367383 // Set the game's starting timestamp.
368384 createdAt = Timestamp.wrap (uint64 (block .timestamp ));
369385
@@ -899,7 +915,8 @@ contract AggregateVerifier is Clone, ReentrancyGuard, ISemver {
899915 endingL2SequenceNumber,
900916 intermediateRoots,
901917 CONFIG_HASH,
902- TEE_IMAGE_HASH
918+ TEE_IMAGE_HASH,
919+ scheduleId
903920 )
904921 );
905922
@@ -933,7 +950,8 @@ contract AggregateVerifier is Clone, ReentrancyGuard, ISemver {
933950 endingL2SequenceNumber,
934951 intermediateRoots,
935952 CONFIG_HASH,
936- ZK_RANGE_HASH
953+ ZK_RANGE_HASH,
954+ scheduleId
937955 )
938956 );
939957
0 commit comments