Skip to content

Commit 0f68604

Browse files
committed
resolved conflicts and rebased
1 parent 7497790 commit 0f68604

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

beacon_chain/gossip_processing/gossip_validation.nim

Lines changed: 23 additions & 0 deletions
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.
@@ -595,6 +605,11 @@ proc validateDataColumnSidecar*(
595605

596606
template block_header: untyped = data_column_sidecar.signed_block_header.message
597607

608+
beacon_data_column_sidecar_processing_requests_total.inc()
609+
610+
let
611+
startTick = Moment.now()
612+
598613
# [REJECT] The sidecar's index is consistent with `NUMBER_OF_COLUMNS`
599614
# -- i.e. `data_column_sidecar.index < NUMBER_OF_COLUMNS`
600615
if not (data_column_sidecar.index < dag.cfg.NUMBER_OF_COLUMNS):
@@ -705,6 +720,14 @@ proc validateDataColumnSidecar*(
705720
if r.isErr:
706721
return dag.checkedReject(r.error)
707722

723+
let
724+
validationTick = Moment.now()
725+
validationDur = validationTick - startTick
726+
727+
beacon_data_column_sidecar_gossip_verification_seconds.observe(validationDur.toFloatSeconds())
728+
729+
beacon_data_column_sidecar_processing_successes_total.inc()
730+
708731
ok()
709732

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

0 commit comments

Comments
 (0)