mirror of
https://github.com/tendermint/tendermint.git
synced 2026-06-09 07:42:38 +00:00
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
This commit is contained in:
committed by
Anton Kaliaev
parent
8706d45f3d
commit
61ab6718e9
@@ -21,3 +21,4 @@ program](https://hackerone.com/tendermint).
|
||||
|
||||
### BUG FIXES:
|
||||
|
||||
- [consensus] [\#4895](https://github.com/tendermint/tendermint/pull/4895) Cache the address of the validator to reduce querying a remote KMS (@joe-bowman)
|
||||
|
||||
@@ -1463,7 +1463,13 @@ func (cs *ConsensusState) recordMetrics(height int64, block *types.Block) {
|
||||
var (
|
||||
missingValidators = 0
|
||||
missingValidatorsPower int64
|
||||
address types.Address
|
||||
)
|
||||
|
||||
if cs.privValidator != nil {
|
||||
address = cs.privValidator.GetPubKey().Address()
|
||||
}
|
||||
|
||||
for i, val := range cs.Validators.Validators {
|
||||
var vote *types.CommitSig
|
||||
if i < len(block.LastCommit.Precommits) {
|
||||
@@ -1474,7 +1480,7 @@ func (cs *ConsensusState) recordMetrics(height int64, block *types.Block) {
|
||||
missingValidatorsPower += val.VotingPower
|
||||
}
|
||||
|
||||
if cs.privValidator != nil && bytes.Equal(val.Address, cs.privValidator.GetPubKey().Address()) {
|
||||
if bytes.Equal(val.Address, address) {
|
||||
label := []string{
|
||||
"validator_address", val.Address.String(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user