Skip to content

Commit

Permalink
early exit from numSets == 1 case
Browse files Browse the repository at this point in the history
  • Loading branch information
etan-status committed Aug 16, 2024
1 parent 902ef74 commit 574a99d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions beacon_chain/gossip_processing/batch_validation.nim
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,10 @@ proc processBatch(
# may not be beneficial to use batch verification:
# https://github.com/status-im/nim-blscurve/blob/3956f63dd0ed5d7939f6195ee09e4c5c1ace9001/blscurve/bls_batch_verifier.nim#L390
if numSets == 1:
var r = true
var r: bool
for multiSet in batch[].multiSets.values():
r = r and blsVerify(multiSet.combine(verifier))
r = blsVerify(multiSet.combine(verifier))
break
r
elif batchCrypto[].taskpool.numThreads > 1 and numSets > 3:
await batchVerifyAsync(verifier, signal, batch)
Expand Down

0 comments on commit 574a99d

Please sign in to comment.