Enforce that validators use pubkey types from validator params#2714
Closed
ValarDragon wants to merge 13 commits intodevelopfrom
Closed
Enforce that validators use pubkey types from validator params#2714ValarDragon wants to merge 13 commits intodevelopfrom
ValarDragon wants to merge 13 commits intodevelopfrom
Conversation
Contributor
ValarDragon
commented
Oct 27, 2018
- Updated all relevant documentation in docs
- Updated all code comments where relevant
- Wrote tests
- Updated CHANGELOG_PENDING.md
melekes
reviewed
Oct 27, 2018
| lastHeightValsChanged := state.LastHeightValidatorsChanged | ||
| if len(abciResponses.EndBlock.ValidatorUpdates) > 0 { | ||
| err := updateValidators(nValSet, abciResponses.EndBlock.ValidatorUpdates) | ||
| err := updateValidators(nValSet, abciResponses.EndBlock.ValidatorUpdates, state.ConsensusParams.Validator) |
Contributor
There was a problem hiding this comment.
can we not mix validation and update logic? maybe extract validation into a separate function
if err := validateUpdates(abciResponses.EndBlock.ValidatorUpdates, state.ConsensusParams.Validator.ValidatorPubkeyTypes); err != nil {
return state, fmt.Errorf("Error in validator updates: %v", err)
}
Contributor
Author
There was a problem hiding this comment.
Great point! I was originally trying to avoid an extra iteration over the validator updates, but I think your right, separating concerns is better for code clarity.
Contributor
|
Contributor
Author
|
Sorry the commit history kinda became a mess, since this was forked off another branch which was then squash merged. |
Contributor
Author
|
Actually theres a weird protobuf change here as well, which idk where it came from. I'll just close this PR and open a new one. |
6 tasks
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.