Add metrics to track pending attestations (#13815)

This commit is contained in:
Potuz 2024-03-27 15:20:53 -03:00 committed by GitHub
parent 12482eeb40
commit 1b0e09369e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -150,6 +150,10 @@ var (
Help: "Time to verify gossiped blob sidecars",
},
)
pendingAttCount = promauto.NewCounter(prometheus.CounterOpts{
Name: "gossip_pending_attestations_total",
Help: "increased when receiving a new pending attestation",
})
// Sync committee verification performance.
syncMessagesForUnknownBlocks = promauto.NewCounter(

View File

@ -177,6 +177,7 @@ func (s *Service) savePendingAtt(att *ethpb.SignedAggregateAttestationAndProof)
_, ok := s.blkRootToPendingAtts[root]
if !ok {
pendingAttCount.Inc()
s.blkRootToPendingAtts[root] = []*ethpb.SignedAggregateAttestationAndProof{att}
return
}
@ -187,6 +188,7 @@ func (s *Service) savePendingAtt(att *ethpb.SignedAggregateAttestationAndProof)
return
}
}
pendingAttCount.Inc()
s.blkRootToPendingAtts[root] = append(s.blkRootToPendingAtts[root], att)
}