HorizenOfficial / zend_oo

This repository is archived, Zendoo is out of beta and has been included in https://github.com/HorizenOfficial/zen.
https://github.com/HorizenOfficial/zen
Other
34 stars 22 forks source link

Sidechains integration step4 batch verification improvement #130

Closed ptagl closed 3 years ago

ptagl commented 3 years ago

This PR makes Zendoo take advantage of the optimizations of the CCTP library about the handling of failures during the verification of certificate and CSW transaction proofs.

The CScAsyncProofVerifier now works like this:

  1. Performs a batch verification
  2. If there is a failure and the CCTP library returns the ID of failing proofs, they are removed from the queue
  3. Performs a new batch verification with the remaining proofs
  4. If still there is a failure, the CCTP library for sure is not able to return the failing IDs, so as last chance the proofs are processed one by one

During the implementation of such changes, some refactoring has been made to simplify the proof verification classes and to reduce duplication: