Skip to content

Commit

Permalink
Add PeerDAS gossip verification metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
KatyaRyazantseva committed Jan 15, 2025
1 parent 5f08559 commit fd14bdb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
19 changes: 19 additions & 0 deletions beacon-chain/sync/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,25 @@ var (
Help: "Count the number of times blobs have been found in the database.",
},
)

// Data column sidecar validation, beacon metrics specs
dataColumnSidecarVerificationRequestsCounter = promauto.NewCounter(prometheus.CounterOpts{
Name: "beacon_data_column_sidecar_processing_requests_total",
Help: "Count the number of data column sidecars submitted for verification",
})

dataColumnSidecarVerificationSuccessesCounter = promauto.NewCounter(prometheus.CounterOpts{
Name: "beacon_data_column_sidecar_processing_successes_total",
Help: "Count the number of data column sidecars verified for gossip",
})

dataColumnSidecarVerificationGossipHistogram = promauto.NewHistogram(
prometheus.HistogramOpts{
Name: "beacon_data_column_sidecar_gossip_verification_milliseconds",
Help: "Captures the time taken to verify data column sidecars.",
Buckets: []float64{100, 250, 500, 750, 1000, 1500, 2000, 4000, 8000, 12000, 16000},
},
)
)

func (s *Service) updateMetrics() {
Expand Down
6 changes: 5 additions & 1 deletion beacon-chain/sync/validate_data_column.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ import (
"github.com/sirupsen/logrus"
)

// https://github.com/ethereum/consensus-specs/blob/dev/specs/_features/eip7594/p2p-interface.md#the-gossip-domain-gossipsub
// https://github.com/ethereum/consensus-specs/blob/dev/specs/fulu/p2p-interface.md#the-gossip-domain-gossipsub
func (s *Service) validateDataColumn(ctx context.Context, pid peer.ID, msg *pubsub.Message) (pubsub.ValidationResult, error) {
dataColumnSidecarVerificationRequestsCounter.Inc();
receivedTime := prysmTime.Now()

// Always accept messages our own messages.
Expand Down Expand Up @@ -162,10 +163,13 @@ func (s *Service) validateDataColumn(ctx context.Context, pid peer.ID, msg *pubs
}

msg.ValidatorData = verifiedRODataColumns[0]
dataColumnSidecarVerificationSuccessesCounter.Inc()

sinceSlotStartTime := receivedTime.Sub(startTime)
validationTime := s.cfg.clock.Now().Sub(receivedTime)

dataColumnSidecarVerificationGossipHistogram.Observe(float64(validationTime.Milliseconds()))

peerGossipScore := s.cfg.p2p.Peers().Scorers().GossipScorer().Score(pid)

pidString := pid.String()
Expand Down

0 comments on commit fd14bdb

Please sign in to comment.