-
Notifications
You must be signed in to change notification settings - Fork 216
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
Refactor CommitValidator and port over code from the lite_impl
module
#358
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🙌
// | ||
// It returns `ImplementationSpecific` error if it detects a signer | ||
// that is not present in the validator set | ||
fn validate_full( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it makes sense to decouple these and have a separate validate_full
method instead 👍
.validate(signed_header, validators) | ||
.map_err(|e| VerificationError::InvalidCommit(e.to_string()))?; | ||
commit_validator.validate(signed_header, validators)?; | ||
commit_validator.validate_full(signed_header, validators)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there actually a place now where commit_validator.validate
is used without validate_full
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No there's not. We currently perform both checks, and I don't see the need/place for doing just validate
since we do 2/3 full verification of every block by that point. But perhaps that's not right, and we need to only to validate_full
somewhere here: https://github.com/informalsystems/tendermint-rs/pull/358/files/b1aee8d1f4b42d56a5e43dda9fc52572455ff4ea#diff-1911c69336354ecbef5a4524721976faR236-R263
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we do #377, we can prob get rid of validate_full, especially since we're trying not to rely on the underlying validator_address. though I suppose so long as it is there it should be checked.
Close: #341
Ref: #342