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

only retrieve pubkey once for all validators (partially fixes #4865) #4895

Merged
merged 7 commits into from
May 29, 2020

Conversation

joe-bowman
Copy link
Contributor

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

@joe-bowman joe-bowman requested review from melekes and tessr as code owners May 26, 2020 22:51
@auto-comment
Copy link

auto-comment bot commented May 26, 2020

👋 Thanks for creating a PR!

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Wrote tests
  • Updated CHANGELOG_PENDING.md
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Updated relevant documentation (docs/) and code comments
  • Re-reviewed Files changed in the Github PR explorer
  • Applied Appropriate Labels

Thank you for your contribution to Tendermint! 🚀

@@ -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{}
Copy link
Contributor

@tac0turtle tac0turtle May 26, 2020

Choose a reason for hiding this comment

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

Suggested change
address types.Address = types.Address{}
address types.Address

nit

Copy link
Contributor Author

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?

Copy link
Contributor

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

Copy link
Contributor

@tac0turtle tac0turtle left a 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 😄

@tac0turtle tac0turtle added C:consensus Component: Consensus T:validator Type: Validator related labels May 26, 2020
@joe-bowman joe-bowman requested a review from melekes May 27, 2020 07:59
@tessr
Copy link
Contributor

tessr commented May 27, 2020

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?

@tessr tessr added the R:minor Release: Minor label May 27, 2020
@tessr
Copy link
Contributor

tessr commented May 27, 2020

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?

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.

👍

@joe-bowman
Copy link
Contributor Author

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?

done :)

melekes and others added 2 commits May 29, 2020 09:44
@melekes melekes added the S:automerge Automatically merge PR when requirements pass label May 29, 2020
@mergify mergify bot merged commit 8b50ff6 into tendermint:master May 29, 2020
melekes pushed a commit that referenced this pull request Nov 10, 2020
…4895)

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
melekes pushed a commit that referenced this pull request Nov 10, 2020
…4895)

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
melekes pushed a commit that referenced this pull request Nov 16, 2020
…4895)

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
melekes pushed a commit that referenced this pull request Nov 16, 2020
…4895)

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:consensus Component: Consensus R:minor Release: Minor S:automerge Automatically merge PR when requirements pass T:validator Type: Validator related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Excessive calls to GetPubkey() on external signer
4 participants