From cf659f437494e1807013afd6920121511d6f1130 Mon Sep 17 00:00:00 2001 From: Lion - dapplion <35266934+dapplion@users.noreply.github.com> Date: Wed, 12 Jul 2023 18:35:07 +0200 Subject: [PATCH] feat: track attestationInBlockParticipants (#5749) Track attestationInBlockParticipants --- packages/beacon-node/src/metrics/metrics/lodestar.ts | 5 +++++ packages/beacon-node/src/metrics/validatorMonitor.ts | 3 +++ 2 files changed, 8 insertions(+) diff --git a/packages/beacon-node/src/metrics/metrics/lodestar.ts b/packages/beacon-node/src/metrics/metrics/lodestar.ts index fb2d540abb45..082f3680e161 100644 --- a/packages/beacon-node/src/metrics/metrics/lodestar.ts +++ b/packages/beacon-node/src/metrics/metrics/lodestar.ts @@ -850,6 +850,11 @@ export function createLodestarMetrics( help: "The excess slots (beyond the minimum delay) between the attestation slot and the block slot", buckets: [0.1, 0.25, 0.5, 1, 2, 5, 10], }), + attestationInBlockParticipants: register.histogram({ + name: "validator_monitor_attestation_in_block_participants", + help: "The total participants in attestations of monitored validators included in blocks", + buckets: [1, 5, 20, 50, 100, 200], + }), syncSignatureInAggregateTotal: register.gauge({ name: "validator_monitor_sync_signature_in_aggregate_total", help: "Number of times a sync signature has been seen in an aggregate", diff --git a/packages/beacon-node/src/metrics/validatorMonitor.ts b/packages/beacon-node/src/metrics/validatorMonitor.ts index 5b0a5e1d5089..83d0647ea7fc 100644 --- a/packages/beacon-node/src/metrics/validatorMonitor.ts +++ b/packages/beacon-node/src/metrics/validatorMonitor.ts @@ -529,12 +529,14 @@ export function createValidatorMonitor( const inclusionDistance = Math.max(parentSlot - data.slot, 0) + 1; const delay = inclusionDistance - MIN_ATTESTATION_INCLUSION_DELAY; const epoch = computeEpochAtSlot(data.slot); + const participants = indexedAttestation.attestingIndices.length; for (const index of indexedAttestation.attestingIndices) { const validator = validators.get(index); if (validator) { metrics.validatorMonitor.attestationInBlockTotal.inc(); metrics.validatorMonitor.attestationInBlockDelaySlots.observe(delay); + metrics.validatorMonitor.attestationInBlockParticipants.observe(participants); const summary = getEpochSummary(validator, epoch); summary.attestationBlockInclusions += 1; @@ -566,6 +568,7 @@ export function createValidatorMonitor( committeeIndex: data.index, inclusionDistance, correctHead, + participants, }); } }