mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-23 11:57:18 +00:00
Fix pubkey used in validator metrics (#6246)
* Fix validator metrics pubkey * Merge branch 'master' into val-metrics
This commit is contained in:
parent
caf61bd824
commit
f6ecf66d1a
@ -73,6 +73,7 @@ func (v *validator) LogValidatorGainsAndLosses(ctx context.Context, slot uint64)
|
|||||||
v.prevBalance[pubKeyBytes] = params.BeaconConfig().MaxEffectiveBalance
|
v.prevBalance[pubKeyBytes] = params.BeaconConfig().MaxEffectiveBalance
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmtKey := fmt.Sprintf("%#x", pubKey)
|
||||||
truncatedKey := fmt.Sprintf("%#x", pubKey[:8])
|
truncatedKey := fmt.Sprintf("%#x", pubKey[:8])
|
||||||
if v.prevBalance[pubKeyBytes] > 0 {
|
if v.prevBalance[pubKeyBytes] > 0 {
|
||||||
newBalance := float64(resp.BalancesAfterEpochTransition[i]) / gweiPerEth
|
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),
|
"percentChange": fmt.Sprintf("%.5f%%", percentNet*100),
|
||||||
}).Info("Previous epoch voting summary")
|
}).Info("Previous epoch voting summary")
|
||||||
if v.emitAccountMetrics {
|
if v.emitAccountMetrics {
|
||||||
validatorBalancesGaugeVec.WithLabelValues(truncatedKey).Set(newBalance)
|
validatorBalancesGaugeVec.WithLabelValues(fmtKey).Set(newBalance)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user