11// SPDX-License-Identifier: BUSL-1.1
2- pragma solidity ^ 0.8.27 ;
2+ pragma solidity >= 0.5.0 ;
33
44import {OperatorSet} from "../libraries/OperatorSetLib.sol " ;
55
66import "./IECDSATableCalculator.sol " ;
77import "./IBN254TableCalculator.sol " ;
88import "./IECDSACertificateVerifier.sol " ;
99import "./IBN254CertificateVerifier.sol " ;
10+ import "./IKeyRegistrar.sol " ;
1011import "./ICrossChainRegistry.sol " ;
1112
1213interface IOperatorTableUpdaterErrors {
14+ /// @notice Thrown when the global table root is in the future
15+ error GlobalTableRootInFuture ();
16+ /// @notice Thrown when the global table root is stale
17+ error GlobalTableRootStale ();
18+ /// @notice Thrown when the table root does not match what is in the certificate
19+ error TableRootNotInCertificate ();
1320 /// @notice Thrown when the GlobalTableRoot update fails
14- error GlobalTableRootUpdateFailed ();
21+ error CertificateInvalid ();
22+ /// @notice Thrown when the table has been updated for the timestamp
23+ error TableUpdateForPastTimestamp ();
24+ /// @notice Thrown when the global table root does not match what is in storage
25+ error InvalidGlobalTableRoot ();
26+ /// @notice Thrown when the operator set proof is invalid
27+ error InvalidOperatorSetProof ();
28+ /// @notice Thrown when the confirmation threshold is invalid
29+ error InvalidConfirmationThreshold ();
30+ /// @notice Thrown when the curve type is invalid
31+ error InvalidCurveType ();
1532}
1633
1734interface IOperatorTableUpdaterEvents {
@@ -20,14 +37,27 @@ interface IOperatorTableUpdaterEvents {
2037 * @param referenceTimestamp the timestamp of the global table root
2138 * @param globalTableRoot the root of the global table
2239 */
23- event NewglobalTableRoot (uint32 referenceTimestamp , bytes32 globalTableRoot );
40+ event NewGlobalTableRoot (uint32 indexed referenceTimestamp , bytes32 indexed globalTableRoot );
41+
42+ /**
43+ * @notice Emitted when the global root confirmer set is updated
44+ * @param operatorSet The operatorSet which certifies against global roots
45+ */
46+ event GlobalRootConfirmerSetUpdated (OperatorSet operatorSet );
47+
48+ /**
49+ * @notice Emitted when the global root confirmation threshold is updated
50+ * @param bps The threshold, in bps, for a global root to be signed off on and updated
51+ */
52+ event GlobalRootConfirmationThresholdUpdated (uint16 bps );
2453}
2554
2655interface IOperatorTableUpdater is
2756 IOperatorTableUpdaterErrors ,
2857 IOperatorTableUpdaterEvents ,
2958 IECDSACertificateVerifierTypes ,
3059 IBN254CertificateVerifierTypes ,
60+ IKeyRegistrarTypes ,
3161 ICrossChainRegistryTypes
3262{
3363 /**
@@ -63,45 +93,20 @@ interface IOperatorTableUpdater is
6393 ) external ;
6494
6595 /**
66- * @notice update a BN254 operator table in the CertificateVerifier
67- * @param referenceTimestamp the reference block number of the globalTableRoot
68- * @param globalTableRoot the new globalTableRoot
69- * @param operatorSetIndex the index of the given operatorSet being updated
70- * @param proof the proof of the leaf at index against the globalTableRoot
71- * @param operatorSet the operatorSet being proven
72- * @param operatorSetInfo the operatorSetInfo of the operator table
73- * @param config the configuration of the operatorSet
74- * @dev globalTableRoot must be confirmed majority certified by globalTableRootSet
75- */
76- function updateBN254OperatorTable (
77- uint32 referenceTimestamp ,
78- bytes32 globalTableRoot ,
79- uint32 operatorSetIndex ,
80- bytes calldata proof ,
81- OperatorSet calldata operatorSet ,
82- BN254OperatorSetInfo calldata operatorSetInfo ,
83- OperatorSetConfig calldata config
84- ) external ;
85-
86- /**
87- * @notice updates an ECDSA operator table in the CertificateVerifier
96+ * @notice Updates an operator table
8897 * @param referenceTimestamp the reference block number of the globalTableRoot
8998 * @param globalTableRoot the new globalTableRoot
9099 * @param operatorSetIndex the index of the given operatorSet being updated
91100 * @param proof the proof of the leaf at index against the globalTableRoot
92- * @param operatorSet the operatorSet being proven
93- * @param operatorInfos the operatorInfos of the operator table
94- * @param config the configuration of the operatorSet
95- * @dev globalTableRoot must be confirmed majority certified by globalTableRootSet
101+ * @param tableInfo the tableInfo of the operator table
102+ * @dev Depending on the decoded KeyType, the tableInfo will be decoded to a
96103 */
97- function updateECDSAOperatorTable (
104+ function updateOperatorTable (
98105 uint32 referenceTimestamp ,
99106 bytes32 globalTableRoot ,
100107 uint32 operatorSetIndex ,
101108 bytes calldata proof ,
102- OperatorSet calldata operatorSet ,
103- ECDSAOperatorInfo[] calldata operatorInfos ,
104- OperatorSetConfig calldata config
109+ bytes calldata tableInfo
105110 ) external ;
106111
107112 /**
@@ -115,7 +120,22 @@ interface IOperatorTableUpdater is
115120 * @param referenceTimestamp the timestamp of the table root
116121 * @return tableRoot the table root at the given timestamp
117122 */
118- function getTableRootByTimestamp (
123+ function getGlobalTableRootByTimestamp (
119124 uint32 referenceTimestamp
120125 ) external view returns (bytes32 tableRoot );
126+
127+ /**
128+ * @notice Get the operatorSet which certifies against global roots
129+ * @return The operatorSet which certifies against global roots
130+ */
131+ function getGlobalRootConfirmerSet () external view returns (OperatorSet memory );
132+
133+ /**
134+ * @notice Get the certificate verifier for a given key type
135+ * @param curveType The curve type
136+ * @return The certificate verifier for the given key type
137+ */
138+ function getCertificateVerifier (
139+ CurveType curveType
140+ ) external view returns (address );
121141}
0 commit comments