diff --git a/validator/client/validator_aggregate.go b/validator/client/validator_aggregate.go index df040604c..a7d91ae58 100644 --- a/validator/client/validator_aggregate.go +++ b/validator/client/validator_aggregate.go @@ -48,7 +48,7 @@ func (v *validator) SubmitAggregateAndProof(ctx context.Context, slot uint64, pu defer span.End() span.AddAttributes(trace.StringAttribute("validator", fmt.Sprintf("%#x", pubKey))) - fmtKey := fmt.Sprintf("%#x", pubKey[:8]) + fmtKey := fmt.Sprintf("%#x", pubKey[:]) duty, err := v.duty(pubKey) if err != nil { diff --git a/validator/client/validator_attest.go b/validator/client/validator_attest.go index 46ded815c..0ab1fb23d 100644 --- a/validator/client/validator_attest.go +++ b/validator/client/validator_attest.go @@ -54,7 +54,7 @@ func (v *validator) SubmitAttestation(ctx context.Context, slot uint64, pubKey [ defer span.End() span.AddAttributes(trace.StringAttribute("validator", fmt.Sprintf("%#x", pubKey))) - fmtKey := fmt.Sprintf("%#x", pubKey[:8]) + fmtKey := fmt.Sprintf("%#x", pubKey[:]) log := log.WithField("pubKey", fmt.Sprintf("%#x", bytesutil.Trunc(pubKey[:]))).WithField("slot", slot) duty, err := v.duty(pubKey) if err != nil { diff --git a/validator/client/validator_metrics.go b/validator/client/validator_metrics.go index 00a9f4bd3..ccc917646 100644 --- a/validator/client/validator_metrics.go +++ b/validator/client/validator_metrics.go @@ -65,10 +65,11 @@ func (v *validator) LogValidatorGainsAndLosses(ctx context.Context, slot uint64) for _, pkey := range pubKeys { pubKey := fmt.Sprintf("%#x", pkey[:8]) log := log.WithField("pubKey", pubKey) + fmtKey := fmt.Sprintf("%#x", pkey[:]) if missingValidators[bytesutil.ToBytes48(pkey)] { log.Info("Validator not in beacon chain") if v.emitAccountMetrics { - validatorBalancesGaugeVec.WithLabelValues(pubKey).Set(0) + validatorBalancesGaugeVec.WithLabelValues(fmtKey).Set(0) } continue } @@ -92,7 +93,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(pubKey).Set(newBalance) + validatorBalancesGaugeVec.WithLabelValues(fmtKey).Set(newBalance) } } diff --git a/validator/client/validator_propose.go b/validator/client/validator_propose.go index 083026ad3..c0efe555a 100644 --- a/validator/client/validator_propose.go +++ b/validator/client/validator_propose.go @@ -56,7 +56,7 @@ func (v *validator) ProposeBlock(ctx context.Context, slot uint64, pubKey [48]by } ctx, span := trace.StartSpan(ctx, "validator.ProposeBlock") defer span.End() - fmtKey := fmt.Sprintf("%#x", pubKey[:8]) + fmtKey := fmt.Sprintf("%#x", pubKey[:]) span.AddAttributes(trace.StringAttribute("validator", fmt.Sprintf("%#x", pubKey))) log := log.WithField("pubKey", fmt.Sprintf("%#x", bytesutil.Trunc(pubKey[:])))