Skip to content

Commit 16a507a

Browse files
committed
refactor: improve comment
1 parent 118d449 commit 16a507a

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

src/interfaces/IBLSSignatureChecker.sol

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,20 +126,28 @@ interface IBLSSignatureChecker is IBLSSignatureCheckerErrors, IBLSSignatureCheck
126126
/* VIEW */
127127

128128
/*
129-
* @notice Verifies aggregated BLS signatures and stake information for message hash `msgHash` across `quorumNumbers` at block `referenceBlockNumber`.
130-
* @param msgHash The hash of the message that was signed.
129+
* @notice This function is called by disperser when it has aggregated all the signatures of the operators
130+
* that are part of the quorum for a particular taskNumber and is asserting them into onchain. The function
131+
* checks that the claim for aggregated signatures are valid.
132+
*
133+
* The thesis of this procedure entails:
134+
* 1. Getting the aggregated pubkey of all registered nodes at the time of pre-commit by the
135+
* disperser (represented by apk in the parameters)
136+
* 2. Subtracting the pubkeys of all non-signers (nonSignerPubkeys) and storing
137+
* the output in apk to get aggregated pubkey of all operators that are part of quorum
138+
* 3. Using this aggregated pubkey to verify the aggregated signature under BLS scheme
139+
*
140+
* @param msgHash The hash of the message that was signed. NOTE: Be careful to ensure msgHash is
141+
* collision-resistant! This method does not hash msgHash in any way, so if an attacker is able
142+
* to pass in an arbitrary value, they may be able to tamper with signature verification.
131143
* @param quorumNumbers The quorum numbers to verify signatures for, where each byte is an 8-bit integer.
132-
* @param referenceBlockNumber The block number to use for stake information.
144+
* @param referenceBlockNumber The block number at which the stake information is being verified
133145
* @param nonSignerStakesAndSignature Contains non-signer information and aggregated signature data.
134-
* @return Stake totals for each quorum and a hash of the verification data.
135-
* @dev The thesis of this procedure entails:
136-
* 1. Getting the aggregated pubkey of all registered nodes at the time of pre-commit
137-
* 2. Subtracting the pubkeys of all non-signers (nonSignerPubkeys)
138-
* 3. Using the resulting aggregated pubkey to verify the aggregated signature under BLS scheme
139-
* @dev Before signature verification, the function verifies:
140-
* 1. The reference block number is valid and recent enough
141-
* 2. Stake information is either most recent or latest before reference block
142-
* 3. The aggregated signature is valid under the BLS scheme
146+
* @return quorumStakeTotals The struct containing the total and signed stake for each quorum
147+
* @return signatoryRecordHash The hash of the signatory record, which is used for fraud proofs
148+
* @dev Before signature verification, the function verifies operator stake information. This includes
149+
* ensuring that the provided referenceBlockNumber is valid and recent enough, and that the stake is
150+
* either the most recent update for the total stake (of the operator) or latest before the referenceBlockNumber.
143151
*/
144152
function checkSignatures(
145153
bytes32 msgHash,

0 commit comments

Comments
 (0)