go-algorand icon indicating copy to clipboard operation
go-algorand copied to clipboard

perf: batch verification for agreement votes (phase 3)

Open algonautshant opened this issue 2 years ago • 3 comments

This is the phase 3 of batch verification for agreement votes This PR includes:

  • BatchVerifyOneTimeSignatures: which takes a collection of votes to verify the signature (each with 3 sigs) in one verification batch.
  • Channels the signature verification from the agreement to the exec pool through StreamToBatch to batch the signature checks.
  • Changes StreamToBatch to return context.Canceled` error with jobs and log an error in the event the exec pool returns the error.

The results compared to master are as follows: Screenshot 2023-04-12 at 6 19 50 PM Screenshot 2023-04-12 at 6 20 03 PM Screenshot 2023-04-12 at 6 19 36 PM

TODO: confirm tests exists for upstream users of the vote verification

algonautshant avatar Mar 22 '23 01:03 algonautshant

Codecov Report

Merging #5222 (68795d9) into master (8b19c62) will increase coverage by 0.10%. Report is 57 commits behind head on master. The diff coverage is 94.95%.

@@            Coverage Diff             @@
##           master    #5222      +/-   ##
==========================================
+ Coverage   54.95%   55.05%   +0.10%     
==========================================
  Files         463      464       +1     
  Lines       64476    64578     +102     
==========================================
+ Hits        35432    35554     +122     
+ Misses      26661    26649      -12     
+ Partials     2383     2375       -8     
Files Changed Coverage Δ
node/node.go 4.16% <0.00%> (ø)
agreement/vote.go 79.16% <80.95%> (-4.17%) :arrow_down:
util/execpool/stream.go 96.38% <91.30%> (-2.50%) :arrow_down:
agreement/asyncVoteVerifier.go 100.00% <100.00%> (+8.82%) :arrow_up:
agreement/bundle.go 88.09% <100.00%> (+1.58%) :arrow_up:
agreement/cryptoVerifier.go 72.43% <100.00%> (+0.83%) :arrow_up:
agreement/pseudonode.go 72.84% <100.00%> (-0.88%) :arrow_down:
agreement/service.go 85.98% <100.00%> (ø)
agreement/voteBatch.go 100.00% <100.00%> (ø)
crypto/onetimesig.go 80.50% <100.00%> (+4.34%) :arrow_up:
... and 1 more

... and 11 files with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Mar 24 '23 20:03 codecov[bot]

closed-opened to rerun licence/cla

algorandskiy avatar Apr 03 '23 15:04 algorandskiy

@algonautshant could you re-merge master?

algorandskiy avatar Jul 14 '23 16:07 algorandskiy

Can revisit later

cce avatar May 07 '24 16:05 cce