perf: optimize CBLSSignature::VerifySecureAggregated in 2 times#110
Draft
knst wants to merge 3 commits into
Draft
perf: optimize CBLSSignature::VerifySecureAggregated in 2 times#110knst wants to merge 3 commits into
knst wants to merge 3 commits into
Conversation
Deserialization is very heavy because FromBytes also validates if G1 / G2 elements are valid. It is computation expensive. Much better to keep pointer to original object. Also simplified using of helper HashPubKeys
Author
|
probably DNM as it is because missing validation of public key inside library. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current implementation of
CoreMPL::VerifySecuredoes serialization and deserialization of G1 element.Deserialization is very heavy because FromBytes() also validates that G1 is valid.
This validation is very expensive for computation power but useless because we already know that object is valid.
Much better to keep pointer to original object.
This PR to dashbls speeds up validation of quorum commitment in Dash Core in 2 times which make indexing and validating new blocks overall 11% faster.
The performance improvement is most noticeable on blocks that have rotation quorum commitment, because one block has 32 commitments.
Benchmarks has been done on 15000 last blocks.
Dash Core with this PR:

Dash Core with current master:
