From f6ecf66d1a4d990e13601a37d73d0e707c31a6cd Mon Sep 17 00:00:00 2001 From: Ivan Martinez Date: Sun, 14 Jun 2020 04:28:26 -0400 Subject: [PATCH] Fix pubkey used in validator metrics (#6246) * Fix validator metrics pubkey * Merge branch 'master' into val-metrics --- validator/client/validator_metrics.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/validator/client/validator_metrics.go b/validator/client/validator_metrics.go index e116427f4..48e51ddfd 100644 --- a/validator/client/validator_metrics.go +++ b/validator/client/validator_metrics.go @@ -73,6 +73,7 @@ func (v *validator) LogValidatorGainsAndLosses(ctx context.Context, slot uint64) v.prevBalance[pubKeyBytes] = params.BeaconConfig().MaxEffectiveBalance } + fmtKey := fmt.Sprintf("%#x", pubKey) truncatedKey := fmt.Sprintf("%#x", pubKey[:8]) if v.prevBalance[pubKeyBytes] > 0 { newBalance := float64(resp.BalancesAfterEpochTransition[i]) / gweiPerEth @@ -91,7 +92,7 @@ func (v *validator) LogValidatorGainsAndLosses(ctx context.Context, slot uint64) "percentChange": fmt.Sprintf("%.5f%%", percentNet*100), }).Info("Previous epoch voting summary") if v.emitAccountMetrics { - validatorBalancesGaugeVec.WithLabelValues(truncatedKey).Set(newBalance) + validatorBalancesGaugeVec.WithLabelValues(fmtKey).Set(newBalance) } }