Skip to content

Commit

Permalink
fix no signer is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
guoshijiang committed Dec 26, 2024
1 parent 6a84cb3 commit 70a6614
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/bls/BLSApkRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,16 @@ contract BLSApkRegistry is Initializable, OwnableUpgradeable, IBLSApkRegistry, B
FinalityNonSignerAndSignature memory params
) public view returns (StakeTotals memory, bytes32) {
require(referenceBlockNumber < uint32(block.number), "BLSSignatureChecker.checkSignatures: invalid reference block");

BN254.G1Point memory signerApk = BN254.G1Point(0, 0);

bytes32[] memory nonSignersPubkeyHashes;

for (uint256 j = 0; j < params.nonSignerPubkeys.length; j++) {
nonSignersPubkeyHashes[j] = params.nonSignerPubkeys[j].hashG1Point();
signerApk = currentApk.plus(params.nonSignerPubkeys[j].negate());
if (params.nonSignerPubkeys.length > 0) {
for (uint256 j = 0; j < params.nonSignerPubkeys.length; j++) {
nonSignersPubkeyHashes[j] = params.nonSignerPubkeys[j].hashG1Point();
signerApk = currentApk.plus(params.nonSignerPubkeys[j].negate());
}
} else {
signerApk = currentApk;
}

(bool pairingSuccessful, bool signatureIsValid) = trySignatureAndApkVerification(msgHash, signerApk, params.apkG2, params.sigma);
require(pairingSuccessful, "BLSSignatureChecker.checkSignatures: pairing precompile call failed");
require(signatureIsValid, "BLSSignatureChecker.checkSignatures: signature is invalid");
Expand Down

0 comments on commit 70a6614

Please sign in to comment.