Skip to content

Commit

Permalink
Check If Validator Is In Sync Committee (#11860)
Browse files Browse the repository at this point in the history
  • Loading branch information
nisdas authored Jan 11, 2023
1 parent 1e3a55c commit 2b5125c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions validator/client/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,17 @@ var (
"pubkey",
},
)
// ValidatorInSyncCommitteeGaugeVec used to track validator statuses by public key.
ValidatorInSyncCommitteeGaugeVec = promauto.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "validator",
Name: "in_sync_committee",
Help: "validator sync committee.New in Altair hardfork",
},
[]string{
"pubkey",
},
)
// ValidatorInactivityScoreGaugeVec used to track validator inactivity scores.
ValidatorInactivityScoreGaugeVec = promauto.NewGaugeVec(
prometheus.GaugeOpts{
Expand Down
3 changes: 3 additions & 0 deletions validator/client/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,9 @@ func (v *validator) logDuties(slot types.Slot, duties []*ethpb.DutiesResponse_Du
ValidatorNextAttestationSlotGaugeVec.WithLabelValues(validatorNotTruncatedKey).Set(float64(duty.AttesterSlot))
}
}
if v.emitAccountMetrics && duty.IsSyncCommittee {
ValidatorInSyncCommitteeGaugeVec.WithLabelValues(validatorNotTruncatedKey).Set(float64(1))
}

for _, proposerSlot := range duty.ProposerSlots {
proposerIndex := proposerSlot - slotOffset
Expand Down

0 comments on commit 2b5125c

Please sign in to comment.