From d2ff995eb264addb82d08181cf68aa0afc0669e8 Mon Sep 17 00:00:00 2001 From: m3diumrare <127280934+m3diumrare@users.noreply.github.com> Date: Mon, 7 Aug 2023 07:19:02 -0700 Subject: [PATCH] Fix reported effective balance for unknown/pending validators (#12693) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Radosław Kapka --- validator/client/metrics.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/validator/client/metrics.go b/validator/client/metrics.go index 086f6bc5a..13837f644 100644 --- a/validator/client/metrics.go +++ b/validator/client/metrics.go @@ -255,9 +255,11 @@ func (v *validator) LogValidatorGainsAndLosses(ctx context.Context, slot primiti } if v.emitAccountMetrics { + // There is no distinction between unknown and pending validators here. + // The balance is recorded as 0, as this metric is the effective balance of a participating validator. for _, missingPubKey := range resp.MissingValidators { fmtKey := fmt.Sprintf("%#x", missingPubKey) - ValidatorBalancesGaugeVec.WithLabelValues(fmtKey).Set(float64(params.BeaconConfig().MaxEffectiveBalance) / float64(params.BeaconConfig().GweiPerEth)) + ValidatorBalancesGaugeVec.WithLabelValues(fmtKey).Set(0) } }