You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* RegistryCoordinator owner can either enforce or not that operator stakes are staler
50
-
* than the delegation.minWithdrawalDelayBlocks() window.
51
-
* @param value to toggle staleStakesForbidden
52
-
*/
33
+
/// @inheritdoc IBLSSignatureChecker
53
34
function setStaleStakesForbidden(
54
35
boolvalue
55
36
) external onlyCoordinatorOwner {
56
37
_setStaleStakesForbidden(value);
57
38
}
58
39
59
-
struct NonSignerInfo {
60
-
uint256[] quorumBitmaps;
61
-
bytes32[] pubkeyHashes;
62
-
}
40
+
/// VIEW
63
41
64
-
/**
65
-
* @notice This function is called by disperser when it has aggregated all the signatures of the operators
66
-
* that are part of the quorum for a particular taskNumber and is asserting them into onchain. The function
67
-
* checks that the claim for aggregated signatures are valid.
68
-
*
69
-
* The thesis of this procedure entails:
70
-
* - getting the aggregated pubkey of all registered nodes at the time of pre-commit by the
71
-
* disperser (represented by apk in the parameters),
72
-
* - subtracting the pubkeys of all the signers not in the quorum (nonSignerPubkeys) and storing
73
-
* the output in apk to get aggregated pubkey of all operators that are part of quorum.
74
-
* - use this aggregated pubkey to verify the aggregated signature under BLS scheme.
75
-
*
76
-
* @dev Before signature verification, the function verifies operator stake information. This includes ensuring that the provided `referenceBlockNumber`
77
-
* is correct, i.e., ensure that the stake returned from the specified block number is recent enough and that the stake is either the most recent update
78
-
* for the total stake (of the operator) or latest before the referenceBlockNumber.
79
-
* @param msgHash is the hash being signed
80
-
* @dev NOTE: Be careful to ensure `msgHash` is collision-resistant! This method does not hash
81
-
* `msgHash` in any way, so if an attacker is able to pass in an arbitrary value, they may be able
82
-
* to tamper with signature verification.
83
-
* @param quorumNumbers is the bytes array of quorum numbers that are being signed for
84
-
* @param referenceBlockNumber is the block number at which the stake information is being verified
85
-
* @param params is the struct containing information on nonsigners, stakes, quorum apks, and the aggregate signature
86
-
* @return quorumStakeTotals is the struct containing the total and signed stake for each quorum
87
-
* @return signatoryRecordHash is the hash of the signatory record, which is used for fraud proofs
88
-
*/
42
+
/// @inheritdoc IBLSSignatureChecker
89
43
function checkSignatures(
90
44
bytes32msgHash,
91
45
bytescalldataquorumNumbers,
@@ -253,15 +207,7 @@ contract BLSSignatureChecker is IBLSSignatureChecker {
253
207
return (stakeTotals, signatoryRecordHash);
254
208
}
255
209
256
-
/**
257
-
* trySignatureAndApkVerification verifies a BLS aggregate signature and the veracity of a calculated G1 Public key
258
-
* @param msgHash is the hash being signed
259
-
* @param apk is the claimed G1 public key
260
-
* @param apkG2 is provided G2 public key
261
-
* @param sigma is the G1 point signature
262
-
* @return pairingSuccessful is true if the pairing precompile call was successful
263
-
* @return siganatureIsValid is true if the signature is valid
264
-
*/
210
+
/// @inheritdoc IBLSSignatureChecker
265
211
function trySignatureAndApkVerification(
266
212
bytes32msgHash,
267
213
BN254.G1Point memoryapk,
@@ -300,8 +246,4 @@ contract BLSSignatureChecker is IBLSSignatureChecker {
/// @notice Returns the address of the registry coordinator contract.
82
+
/// @return The address of the registry coordinator.
83
+
/// @dev This value is immutable and set during contract construction.
65
84
function registryCoordinator() externalviewreturns (IRegistryCoordinator);
66
85
86
+
/// @notice Returns the address of the stake registry contract.
87
+
/// @return The address of the stake registry.
88
+
/// @dev This value is immutable and set during contract construction.
67
89
function stakeRegistry() externalviewreturns (IStakeRegistry);
68
-
90
+
91
+
/// @notice Returns the address of the BLS APK registry contract.
92
+
/// @return The address of the BLS APK registry.
93
+
/// @dev This value is immutable and set during contract construction.
69
94
function blsApkRegistry() externalviewreturns (IBLSApkRegistry);
70
-
95
+
96
+
/// @notice Returns the address of the delegation manager contract.
97
+
/// @return The address of the delegation manager.
98
+
/// @dev This value is immutable and set during contract construction.
71
99
function delegation() externalviewreturns (IDelegationManager);
72
-
100
+
101
+
/// @notice Returns whether stale stakes are forbidden in signature verification.
102
+
/// @return True if stale stakes are forbidden, false otherwise.
73
103
function staleStakesForbidden() externalviewreturns (bool);
74
104
75
105
// ACTIONS
76
106
77
-
function setStaleStakesForbidden(boolvalue) external;
107
+
/// @notice Sets `value` as the new staleStakesForbidden flag.
108
+
/// @param value True to forbid stale stakes, false to allow them.
109
+
/// @dev Access restricted to the registry coordinator owner.
110
+
function setStaleStakesForbidden(
111
+
boolvalue
112
+
) external;
78
113
79
114
/// VIEW
80
115
81
-
/**
82
-
* @notice This function is called by disperser when it has aggregated all the signatures of the operators
83
-
* that are part of the quorum for a particular taskNumber and is asserting them into onchain. The function
84
-
* checks that the claim for aggregated signatures are valid.
85
-
*
86
-
* The thesis of this procedure entails:
87
-
* - getting the aggregated pubkey of all registered nodes at the time of pre-commit by the
88
-
* disperser (represented by apk in the parameters),
89
-
* - subtracting the pubkeys of all the signers not in the quorum (nonSignerPubkeys) and storing
90
-
* the output in apk to get aggregated pubkey of all operators that are part of quorum.
91
-
* - use this aggregated pubkey to verify the aggregated signature under BLS scheme.
92
-
*
93
-
* @dev Before signature verification, the function verifies operator stake information. This includes ensuring that the provided `referenceBlockNumber`
94
-
* is correct, i.e., ensure that the stake returned from the specified block number is recent enough and that the stake is either the most recent update
95
-
* for the total stake (or the operator) or latest before the referenceBlockNumber.
96
-
*/
116
+
/// @notice Verifies aggregated BLS signatures and stake information for message hash `msgHash` across `quorumNumbers` at block `referenceBlockNumber`.
117
+
/// @param msgHash The hash of the message that was signed.
118
+
/// @param quorumNumbers The quorum numbers to verify signatures for, where each byte is an 8-bit integer.
119
+
/// @param referenceBlockNumber The block number to use for stake information.
120
+
/// @param nonSignerStakesAndSignature Contains non-signer information and aggregated signature data.
121
+
/// @return Stake totals for each quorum and a hash of the verification data.
122
+
/// @dev The thesis of this procedure entails:
123
+
/// 1. Getting the aggregated pubkey of all registered nodes at the time of pre-commit
124
+
/// 2. Subtracting the pubkeys of all non-signers (nonSignerPubkeys)
125
+
/// 3. Using the resulting aggregated pubkey to verify the aggregated signature under BLS scheme
126
+
/// @dev Before signature verification, the function verifies:
127
+
/// 1. The reference block number is valid and recent enough
128
+
/// 2. Stake information is either most recent or latest before reference block
129
+
/// 3. The aggregated signature is valid under the BLS scheme
0 commit comments