Skip to content

Commit 39e49e1

Browse files
Add peerDAS kzg verification metrics (#7154)
* Add peerDAS gossip metrics (#7066) * Add peerDAS gossip metrics * Add formatting * Add peerDAS kzg batch verification metric into gossip_validation * Fix time --------- Co-authored-by: Agnish Ghosh <[email protected]>
1 parent 0f68604 commit 39e49e1

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

beacon_chain/gossip_processing/gossip_validation.nim

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ declareHistogram beacon_data_column_sidecar_gossip_verification_seconds,
5353
"Full runtime of data column sidecars gossip verification",
5454
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]
5555

56+
declareHistogram beacon_data_column_sidecar_inclusion_proof_verification_seconds,
57+
"Runtime of batched data column kzg verification",
58+
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]
59+
5660
# This result is a little messy in that it returns Result.ok for
5761
# ValidationResult.Accept and an err for the others - this helps transport
5862
# an error message to callers but could arguably be done in an cleaner way.
@@ -716,10 +720,15 @@ proc validateDataColumnSidecar*(
716720
# [REJECT] The sidecar's column data is valid as
717721
# verified by `verify_data_column_kzg_proofs(sidecar)`
718722
block:
719-
let r = check_data_column_sidecar_kzg_proofs(data_column_sidecar)
723+
let
724+
kzgStartTick = Moment.now()
725+
r = check_data_column_sidecar_kzg_proofs(data_column_sidecar)
726+
kzgValidationTick = Moment.now()
727+
kzgValidationDur = kzgValidationTick - kzgStartTick
728+
beacon_data_column_sidecar_inclusion_proof_verification_seconds.observe(kzgValidationDur.toFloatSeconds())
720729
if r.isErr:
721730
return dag.checkedReject(r.error)
722-
731+
723732
let
724733
validationTick = Moment.now()
725734
validationDur = validationTick - startTick

0 commit comments

Comments
 (0)