Skip to content

Commit

Permalink
Merge pull request #65 from Layr-Labs/fix-loop-reset-nonSignerForQuor…
Browse files Browse the repository at this point in the history
…umIndex

update nonSignerForQuorumIndex outside of loop
  • Loading branch information
gpsanant authored Nov 16, 2023
2 parents b0dd616 + 7c8a7c9 commit d5d520e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/BLSSignatureChecker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,13 @@ contract BLSSignatureChecker is IBLSSignatureChecker {
stakeRegistry.getTotalStakeAtBlockNumberFromIndex(quorumNumber, referenceBlockNumber, nonSignerStakesAndSignature.totalStakeIndices[quorumNumberIndex]);
// copy total stake to signed stake
quorumStakeTotals.signedStakeForQuorum[quorumNumberIndex] = quorumStakeTotals.totalStakeForQuorum[quorumNumberIndex];

// keep track of the nonSigners index in the quorum
uint32 nonSignerForQuorumIndex = 0;

// loop through all nonSigners, checking that they are a part of the quorum via their quorumBitmap
// if so, load their stake at referenceBlockNumber and subtract it from running stake signed
for (uint32 i = 0; i < nonSignerStakesAndSignature.nonSignerPubkeys.length; i++) {
// keep track of the nonSigners index in the quorum
uint32 nonSignerForQuorumIndex = 0;
// if the nonSigner is a part of the quorum, subtract their stake from the running total
if (BitmapUtils.numberIsInBitmap(nonSignerQuorumBitmaps[i], quorumNumber)) {
quorumStakeTotals.signedStakeForQuorum[quorumNumberIndex] -=
Expand Down

0 comments on commit d5d520e

Please sign in to comment.