Skip to content
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

Enforce that validators use pubkey types from validator params #2714

Closed
wants to merge 13 commits into from

Conversation

ValarDragon
Copy link
Contributor

  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Updated CHANGELOG_PENDING.md

Copy link
Contributor

@melekes melekes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍓🍌🥛 Awesome

Just one note regarding better separation of concerns

@@ -373,7 +391,7 @@ func updateState(
// Update the validator set with the latest abciResponses.
lastHeightValsChanged := state.LastHeightValidatorsChanged
if len(abciResponses.EndBlock.ValidatorUpdates) > 0 {
err := updateValidators(nValSet, abciResponses.EndBlock.ValidatorUpdates)
err := updateValidators(nValSet, abciResponses.EndBlock.ValidatorUpdates, state.ConsensusParams.Validator)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ebuchman
Copy link
Contributor

@ValarDragon ValarDragon changed the base branch from dev/add_validator_pubkey_type_consensus_param to develop November 1, 2018 04:07
@ValarDragon
Copy link
Contributor Author

Sorry the commit history kinda became a mess, since this was forked off another branch which was then squash merged.

@ValarDragon
Copy link
Contributor Author

ValarDragon commented Nov 1, 2018

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.

@ValarDragon ValarDragon closed this Nov 1, 2018
@ValarDragon ValarDragon deleted the dev/enforce_validators_use_ed25519 branch November 1, 2018 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants