Skip to content

Commit 6de64f4

Browse files
Add peerDAS gossip metrics (#7066)
* Add peerDAS gossip metrics * Add formatting
1 parent dfc5970 commit 6de64f4

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

beacon_chain/gossip_processing/gossip_validation.nim

+23
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@ declareCounter beacon_sync_messages_dropped_queue_full,
4343
declareCounter beacon_contributions_dropped_queue_full,
4444
"Number of sync committee contributions dropped because queue is full"
4545

46+
declareCounter beacon_data_column_sidecar_processing_requests_total,
47+
"Number of data column sidecars submitted for processing"
48+
49+
declareCounter beacon_data_column_sidecar_processing_successes_total,
50+
"Number of data column sidecars verified for gossip"
51+
52+
declareHistogram beacon_data_column_sidecar_gossip_verification_seconds,
53+
"Full runtime of data column sidecars gossip verification",
54+
buckets = [0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1.0, 2.5, 5.0, 7.5, 10.0, Inf]
55+
4656
# This result is a little messy in that it returns Result.ok for
4757
# ValidationResult.Accept and an err for the others - this helps transport
4858
# an error message to callers but could arguably be done in an cleaner way.
@@ -543,6 +553,11 @@ proc validateDataColumnSidecar*(
543553

544554
template block_header: untyped = data_column_sidecar.signed_block_header.message
545555

556+
beacon_data_column_sidecar_processing_requests_total.inc()
557+
558+
let
559+
startTick = Moment.now()
560+
546561
# [REJECT] The sidecar's index is consistent with `NUMBER_OF_COLUMNS`
547562
# -- i.e. `data_column_sidecar.index < NUMBER_OF_COLUMNS`
548563
if not (data_column_sidecar.index < NUMBER_OF_COLUMNS):
@@ -657,6 +672,14 @@ proc validateDataColumnSidecar*(
657672
if not(isNil(dataColumnQuarantine.onDataColumnSidecarCallback)):
658673
dataColumnQuarantine.onDataColumnSidecarCallback(data_column_sidecar)
659674

675+
let
676+
validationTick = Moment.now()
677+
validationDur = validationTick - startTick
678+
679+
beacon_data_column_sidecar_gossip_verification_seconds.observe(validationDur.toFloatSeconds())
680+
681+
beacon_data_column_sidecar_processing_successes_total.inc()
682+
660683
ok()
661684

662685
# https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/phase0/p2p-interface.md#beacon_block

0 commit comments

Comments
 (0)