-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
only retrieve pubkey once for all validators (partially fixes #4865) #4895
only retrieve pubkey once for all validators (partially fixes #4865) #4895
Conversation
👋 Thanks for creating a PR! Before we can merge this PR, please make sure that all the following items have been
Thank you for your contribution to Tendermint! 🚀 |
consensus/state.go
Outdated
@@ -1554,39 +1554,41 @@ func (cs *State) recordMetrics(height int64, block *types.Block) { | |||
var ( | |||
commitSize = block.LastCommit.Size() | |||
valSetLen = len(cs.LastValidators.Validators) | |||
address types.Address = types.Address{} |
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.
address types.Address = types.Address{} | |
address types.Address |
nit
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.
what's the standard here; fixes in the PR and squash on merge, or update my branch to have a single squashed commit?
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.
fixes in PR and then we squash on merge
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.
utACK
thanks for making the pr 😄
Thank you for the issue and the quick fix, @joe-bowman! Would you mind adding a changelog entry so we can credit you in the next release? |
It would also be cool to have some kind of regression test, but given the way you surfaced this, I'm not sure if that will be straightforward. Thoughts? |
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.
👍
done :) |
Co-authored-by: Marko <markobaricevic3778@gmail.com>
Description
in consensus/state.go, when calulating metrics, retrieve address (ergo, pubkey) once prior to iterating over validatorset to ensure we do not make excessive calls to signer.
Partially closes: #4865