From 0f686042e5748da76ab7ab2571bffd433ba01b88 Mon Sep 17 00:00:00 2001 From: Agnish Ghosh Date: Tue, 3 Jun 2025 02:36:29 +0530 Subject: [PATCH 1/7] resolved conflicts and rebased --- .../gossip_processing/gossip_validation.nim | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/beacon_chain/gossip_processing/gossip_validation.nim b/beacon_chain/gossip_processing/gossip_validation.nim index a53c78e637..598c8753f2 100644 --- a/beacon_chain/gossip_processing/gossip_validation.nim +++ b/beacon_chain/gossip_processing/gossip_validation.nim @@ -43,6 +43,16 @@ declareCounter beacon_sync_messages_dropped_queue_full, declareCounter beacon_contributions_dropped_queue_full, "Number of sync committee contributions dropped because queue is full" +declareCounter beacon_data_column_sidecar_processing_requests_total, + "Number of data column sidecars submitted for processing" + +declareCounter beacon_data_column_sidecar_processing_successes_total, + "Number of data column sidecars verified for gossip" + +declareHistogram beacon_data_column_sidecar_gossip_verification_seconds, + "Full runtime of data column sidecars gossip verification", + 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] + # This result is a little messy in that it returns Result.ok for # ValidationResult.Accept and an err for the others - this helps transport # an error message to callers but could arguably be done in an cleaner way. @@ -595,6 +605,11 @@ proc validateDataColumnSidecar*( template block_header: untyped = data_column_sidecar.signed_block_header.message + beacon_data_column_sidecar_processing_requests_total.inc() + + let + startTick = Moment.now() + # [REJECT] The sidecar's index is consistent with `NUMBER_OF_COLUMNS` # -- i.e. `data_column_sidecar.index < NUMBER_OF_COLUMNS` if not (data_column_sidecar.index < dag.cfg.NUMBER_OF_COLUMNS): @@ -705,6 +720,14 @@ proc validateDataColumnSidecar*( if r.isErr: return dag.checkedReject(r.error) + let + validationTick = Moment.now() + validationDur = validationTick - startTick + + beacon_data_column_sidecar_gossip_verification_seconds.observe(validationDur.toFloatSeconds()) + + beacon_data_column_sidecar_processing_successes_total.inc() + ok() # https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/phase0/p2p-interface.md#beacon_block From 39e49e1ea9def84588ada20849554bb3ef30c95d Mon Sep 17 00:00:00 2001 From: Ekaterina Riazantseva Date: Tue, 3 Jun 2025 10:36:51 +0200 Subject: [PATCH 2/7] 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 <80243668+agnxsh@users.noreply.github.com> --- .../gossip_processing/gossip_validation.nim | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/beacon_chain/gossip_processing/gossip_validation.nim b/beacon_chain/gossip_processing/gossip_validation.nim index 598c8753f2..e9e6dd7135 100644 --- a/beacon_chain/gossip_processing/gossip_validation.nim +++ b/beacon_chain/gossip_processing/gossip_validation.nim @@ -53,6 +53,10 @@ declareHistogram beacon_data_column_sidecar_gossip_verification_seconds, "Full runtime of data column sidecars gossip verification", 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] +declareHistogram beacon_data_column_sidecar_inclusion_proof_verification_seconds, + "Runtime of batched data column kzg verification", + 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] + # This result is a little messy in that it returns Result.ok for # ValidationResult.Accept and an err for the others - this helps transport # an error message to callers but could arguably be done in an cleaner way. @@ -716,10 +720,15 @@ proc validateDataColumnSidecar*( # [REJECT] The sidecar's column data is valid as # verified by `verify_data_column_kzg_proofs(sidecar)` block: - let r = check_data_column_sidecar_kzg_proofs(data_column_sidecar) + let + kzgStartTick = Moment.now() + r = check_data_column_sidecar_kzg_proofs(data_column_sidecar) + kzgValidationTick = Moment.now() + kzgValidationDur = kzgValidationTick - kzgStartTick + beacon_data_column_sidecar_inclusion_proof_verification_seconds.observe(kzgValidationDur.toFloatSeconds()) if r.isErr: return dag.checkedReject(r.error) - + let validationTick = Moment.now() validationDur = validationTick - startTick From 5ef6246156ca681fce66ae164e648ddb4a99c68c Mon Sep 17 00:00:00 2001 From: Ekaterina Riazantseva Date: Tue, 3 Jun 2025 10:38:08 +0200 Subject: [PATCH 3/7] Add peerDAS computation metric (#7205) --- beacon_chain/gossip_processing/eth2_processor.nim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/beacon_chain/gossip_processing/eth2_processor.nim b/beacon_chain/gossip_processing/eth2_processor.nim index 728986fff4..7eb7a0f41d 100644 --- a/beacon_chain/gossip_processing/eth2_processor.nim +++ b/beacon_chain/gossip_processing/eth2_processor.nim @@ -100,6 +100,10 @@ declareHistogram data_column_sidecar_delay, "Time(s) betweeen slot start and data column sidecar reception", buckets = delayBuckets +declareHistogram beacon_data_column_sidecar_computation_seconds, + "Time taken to compute data column sidecar, including cells and inclusion proof", + 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] + type DoppelgangerProtection = object broadcastStartEpoch*: Epoch ##\ @@ -381,11 +385,15 @@ proc validateDataColumnSidecarFromEL*( flat_proof.add(kzg.KzgProof(bytes: proof.data)) let + recover_start_time = Moment.now() recovered_columns = assemble_data_column_sidecars( forkyBlck, blobsEl.mapIt(kzg.KzgBlob(bytes: it.blob.data)), flat_proof) + recover_end_time = Moment.now() + recover_dur = recover_end_time - recover_start_time + beacon_data_column_sidecar_computation_seconds.observe(recover_dur.toFloatSeconds()) # Pop out the column sidecars as we have all columns from the EL discard self.dataColumnQuarantine[].popSidecars(block_root, From 1ab7186e13c7e490052cecb21114bf1d9f6a4e9f Mon Sep 17 00:00:00 2001 From: Ekaterina Riazantseva Date: Tue, 3 Jun 2025 13:47:17 +0200 Subject: [PATCH 4/7] Add peerDAS inclusion proof metric (#7153) * Add peerDAS gossip metrics (#7066) * Add peerDAS gossip metrics * Add formatting * Add peerDAS inclusion proof metric into gossip_validation * Fix inclusion proof metric time * fix kzg verification metric --------- Co-authored-by: Agnish Ghosh <80243668+agnxsh@users.noreply.github.com> --- .../gossip_processing/gossip_validation.nim | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/beacon_chain/gossip_processing/gossip_validation.nim b/beacon_chain/gossip_processing/gossip_validation.nim index e9e6dd7135..ae13a051e5 100644 --- a/beacon_chain/gossip_processing/gossip_validation.nim +++ b/beacon_chain/gossip_processing/gossip_validation.nim @@ -54,6 +54,10 @@ declareHistogram beacon_data_column_sidecar_gossip_verification_seconds, 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] declareHistogram beacon_data_column_sidecar_inclusion_proof_verification_seconds, + "Time taken to verify data column sidecar inclusion proof", + 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] + +declareHistogram beacon_kzg_verification_data_column_batch_seconds, "Runtime of batched data column kzg verification", 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] @@ -649,7 +653,12 @@ proc validateDataColumnSidecar*( # [REJECT] The sidecar's `kzg_commitments` inclusion proof is valid as verified by # `verify_data_column_sidecar_inclusion_proof(sidecar)`. block: - let v = check_data_column_sidecar_inclusion_proof(data_column_sidecar) + let + inclusionProofStartTick = Moment.now() + v = check_data_column_sidecar_inclusion_proof(data_column_sidecar) + inclusionProofValidationTick = Moment.now() + inclusionProofValidationDur = inclusionProofValidationTick - inclusionProofStartTick + beacon_data_column_sidecar_inclusion_proof_verification_seconds.observe(inclusionProofValidationDur.toFloatSeconds()) if v.isErr: return dag.checkedReject(v.error) @@ -725,10 +734,10 @@ proc validateDataColumnSidecar*( r = check_data_column_sidecar_kzg_proofs(data_column_sidecar) kzgValidationTick = Moment.now() kzgValidationDur = kzgValidationTick - kzgStartTick - beacon_data_column_sidecar_inclusion_proof_verification_seconds.observe(kzgValidationDur.toFloatSeconds()) + beacon_kzg_verification_data_column_batch_seconds.observe(kzgValidationDur.toFloatSeconds()) if r.isErr: return dag.checkedReject(r.error) - + let validationTick = Moment.now() validationDur = validationTick - startTick From 4918a5118005dcaef64067763822735531261ae6 Mon Sep 17 00:00:00 2001 From: Ekaterina Riazantseva Date: Mon, 9 Jun 2025 13:57:28 +0200 Subject: [PATCH 5/7] Add engine_getBlobsV2 metrics (#7207) --- .../gossip_processing/eth2_processor.nim | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/beacon_chain/gossip_processing/eth2_processor.nim b/beacon_chain/gossip_processing/eth2_processor.nim index 7eb7a0f41d..01918d70c6 100644 --- a/beacon_chain/gossip_processing/eth2_processor.nim +++ b/beacon_chain/gossip_processing/eth2_processor.nim @@ -104,6 +104,16 @@ declareHistogram beacon_data_column_sidecar_computation_seconds, "Time taken to compute data column sidecar, including cells and inclusion proof", 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] +declareCounter beacon_engine_getBlobsV2_requests_total, + "Total number of engine_getBlobsV2 requests sent" + +declareCounter beacon_engine_getBlobsV2_responses_total, + "Total number of engine_getBlobsV2 successful responses received" + +declareHistogram beacon_engine_getBlobsV2_runtime_seconds, + "Full runtime of engine_getBlobsV2 requests", + buckets = [0.001, 0.005, 0.01, 0.025, 0.05, 0.75, 0.1, 0.5, 1, 1.5, 2, 5, 10] + type DoppelgangerProtection = object broadcastStartEpoch*: Epoch ##\ @@ -366,12 +376,17 @@ proc validateDataColumnSidecarFromEL*( let columnless = o.unsafeGet() withBlck(columnless): when consensusFork >= ConsensusFork.Fulu: + beacon_engine_getBlobsV2_requests_total.inc() let start_time = Moment.now() - let blobsFromElOpt = - await elManager.sendGetBlobsV2(forkyBlck) + blobsFromElOpt = + await elManager.sendGetBlobsV2(forkyBlck) + getBlobsV2_end_time = Moment.now() + getBlobsV2_dur = getBlobsV2_end_time - start_time + beacon_engine_getBlobsV2_runtime_seconds.observe(getBlobsV2_dur.toFloatSeconds()) if blobsFromElOpt.isSome(): let blobsEl = blobsFromElOpt.get() + beacon_engine_getBlobsV2_responses_total.inc() # check lengths of array[BlobAndProofV2 with blobs # kzg commitments of the signed block From a02d510be921e5f1c349041de880d552fddf558d Mon Sep 17 00:00:00 2001 From: Ekaterina Riazantseva Date: Tue, 10 Jun 2025 16:26:12 +0200 Subject: [PATCH 6/7] Rename getBlobsV2 runtime metric (#7220) --- beacon_chain/gossip_processing/eth2_processor.nim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/beacon_chain/gossip_processing/eth2_processor.nim b/beacon_chain/gossip_processing/eth2_processor.nim index 01918d70c6..e2dc64a223 100644 --- a/beacon_chain/gossip_processing/eth2_processor.nim +++ b/beacon_chain/gossip_processing/eth2_processor.nim @@ -102,7 +102,7 @@ declareHistogram data_column_sidecar_delay, declareHistogram beacon_data_column_sidecar_computation_seconds, "Time taken to compute data column sidecar, including cells and inclusion proof", - 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] + 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, Inf] declareCounter beacon_engine_getBlobsV2_requests_total, "Total number of engine_getBlobsV2 requests sent" @@ -110,9 +110,9 @@ declareCounter beacon_engine_getBlobsV2_requests_total, declareCounter beacon_engine_getBlobsV2_responses_total, "Total number of engine_getBlobsV2 successful responses received" -declareHistogram beacon_engine_getBlobsV2_runtime_seconds, - "Full runtime of engine_getBlobsV2 requests", - buckets = [0.001, 0.005, 0.01, 0.025, 0.05, 0.75, 0.1, 0.5, 1, 1.5, 2, 5, 10] +declareHistogram beacon_engine_getBlobsV2_request_duration_seconds, + "Duration of engine_getBlobsV2 requests", + buckets = [0.01, 0.05, 0.1, 0.5, 1, 2.5, 5, 10] type DoppelgangerProtection = object @@ -383,7 +383,7 @@ proc validateDataColumnSidecarFromEL*( await elManager.sendGetBlobsV2(forkyBlck) getBlobsV2_end_time = Moment.now() getBlobsV2_dur = getBlobsV2_end_time - start_time - beacon_engine_getBlobsV2_runtime_seconds.observe(getBlobsV2_dur.toFloatSeconds()) + beacon_engine_getBlobsV2_request_duration_seconds.observe(getBlobsV2_dur.toFloatSeconds()) if blobsFromElOpt.isSome(): let blobsEl = blobsFromElOpt.get() beacon_engine_getBlobsV2_responses_total.inc() From 25deba8dd44e306965ba4d397d9ae6d1f0dc4ce1 Mon Sep 17 00:00:00 2001 From: Ekaterina Riazantseva Date: Wed, 11 Jun 2025 18:22:50 +0200 Subject: [PATCH 7/7] Fix _total for peerdas metrics (#7222) --- beacon_chain/gossip_processing/eth2_processor.nim | 8 ++++---- beacon_chain/gossip_processing/gossip_validation.nim | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/beacon_chain/gossip_processing/eth2_processor.nim b/beacon_chain/gossip_processing/eth2_processor.nim index e2dc64a223..0462686194 100644 --- a/beacon_chain/gossip_processing/eth2_processor.nim +++ b/beacon_chain/gossip_processing/eth2_processor.nim @@ -104,10 +104,10 @@ declareHistogram beacon_data_column_sidecar_computation_seconds, "Time taken to compute data column sidecar, including cells and inclusion proof", 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, Inf] -declareCounter beacon_engine_getBlobsV2_requests_total, +declareCounter beacon_engine_getBlobsV2_requests, "Total number of engine_getBlobsV2 requests sent" -declareCounter beacon_engine_getBlobsV2_responses_total, +declareCounter beacon_engine_getBlobsV2_responses, "Total number of engine_getBlobsV2 successful responses received" declareHistogram beacon_engine_getBlobsV2_request_duration_seconds, @@ -376,7 +376,7 @@ proc validateDataColumnSidecarFromEL*( let columnless = o.unsafeGet() withBlck(columnless): when consensusFork >= ConsensusFork.Fulu: - beacon_engine_getBlobsV2_requests_total.inc() + beacon_engine_getBlobsV2_requests.inc() let start_time = Moment.now() blobsFromElOpt = @@ -386,7 +386,7 @@ proc validateDataColumnSidecarFromEL*( beacon_engine_getBlobsV2_request_duration_seconds.observe(getBlobsV2_dur.toFloatSeconds()) if blobsFromElOpt.isSome(): let blobsEl = blobsFromElOpt.get() - beacon_engine_getBlobsV2_responses_total.inc() + beacon_engine_getBlobsV2_responses.inc() # check lengths of array[BlobAndProofV2 with blobs # kzg commitments of the signed block diff --git a/beacon_chain/gossip_processing/gossip_validation.nim b/beacon_chain/gossip_processing/gossip_validation.nim index ae13a051e5..b10853e28f 100644 --- a/beacon_chain/gossip_processing/gossip_validation.nim +++ b/beacon_chain/gossip_processing/gossip_validation.nim @@ -43,10 +43,10 @@ declareCounter beacon_sync_messages_dropped_queue_full, declareCounter beacon_contributions_dropped_queue_full, "Number of sync committee contributions dropped because queue is full" -declareCounter beacon_data_column_sidecar_processing_requests_total, +declareCounter beacon_data_column_sidecar_processing_requests, "Number of data column sidecars submitted for processing" -declareCounter beacon_data_column_sidecar_processing_successes_total, +declareCounter beacon_data_column_sidecar_processing_successes, "Number of data column sidecars verified for gossip" declareHistogram beacon_data_column_sidecar_gossip_verification_seconds, @@ -613,7 +613,7 @@ proc validateDataColumnSidecar*( template block_header: untyped = data_column_sidecar.signed_block_header.message - beacon_data_column_sidecar_processing_requests_total.inc() + beacon_data_column_sidecar_processing_requests.inc() let startTick = Moment.now() @@ -744,7 +744,7 @@ proc validateDataColumnSidecar*( beacon_data_column_sidecar_gossip_verification_seconds.observe(validationDur.toFloatSeconds()) - beacon_data_column_sidecar_processing_successes_total.inc() + beacon_data_column_sidecar_processing_successes.inc() ok()