-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
light-client: consider optimizing voting power calculation by stopping after verifying +1/3 or +2/3 #235
Labels
light-client
Issues/features which involve the light client
Comments
This was referenced Jun 11, 2020
10 tasks
brapse
pushed a commit
that referenced
this issue
Jun 19, 2020
* Fix `VotingPowerCalculator::voting_power_in`. - Provide two helper methods for checking validators overlap and if there is enough trust w.r.t. the trusted state. - Only count `Commit` signatures towards the voting power. - Do not rely on `signed_votes` method to get the votes. * Don't add voting power of the same validator multiple times * Cleanup and comments * Remove debug statements * Add a constant for a trust threshold of 2/3 * Fix clippy warnings * Mention #235 in TODO comment * Small refactor * Fix clippy warnings and a typo * Address Stevan's comments * Remove debug condition * Raise error when seeing duplicate validator in voting power computation
ebuchman
changed the title
lite_impl: Commit#voting_power_in func is suboptimal
light-client: consider optimizing voting power calculation by stopping after verifying +1/3 or +2/3
Aug 28, 2020
This will be especially relevant once #506 is done |
This could be further optimized by utilizing batch verification from dalek or zebra. |
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
voting_power_in(&self, validators: &Set)
tendermint-rs/tendermint/src/lite_impl/signed_header.rs
Line 15 in efadd8b
You don’t have to calculate all the voting power. What you want is to verify that trust threshold (⅔+ in sequential verification or configurable ⅓+ in skipping verification) signed this commit.
In Go Tendermint, Verify function returns as soon as threshold is reached. https://github.com/tendermint/tendermint/blob/7b717c72df1e9d38cdaf110cdbdaa57459272dc1/types/validator_set.go#L664
The text was updated successfully, but these errors were encountered: