Skip to content

*: add metric with sync message cohorts#4587

Open
KaloyanTanev wants to merge 1 commit into
mainfrom
kalo/sync-cohort-metric
Open

*: add metric with sync message cohorts#4587
KaloyanTanev wants to merge 1 commit into
mainfrom
kalo/sync-cohort-metric

Conversation

@KaloyanTanev

Copy link
Copy Markdown
Collaborator

Add a metric to showcase the different "cohorts" of sync message partial sigs. This will help us triage the nodes that usually drift from the majority. Note that this metric is assuming the majority are submitting the correct head, as it's checking each peer's submission against the majority.

Also improved the log for sync messages.

Those changes are visible in the mock "Grafana panel".

category: feature
ticket: none

Screenshot 2026-07-06 at 20 55 19

@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds observability for sync committee sync-message “head disagreement” by grouping peers into cohorts (by head block root) and exposing cohort rank as a Prometheus metric, plus improved logging around inconsistent sync messages to aid triage.

Changes:

  • Adds core_tracker_parsig_cohort_rank_total metric to count per-peer cohort-rank occurrences for sync messages.
  • Introduces cohort computation and reporting logic for sync-message duties, with a dedicated warning log when multiple head roots are observed.
  • Adds unit tests and a benchmark for cohort computation and cohort metric emission.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
docs/metrics.md Documents the new cohort-rank metric.
core/tracker/tracker.go Implements cohort computation + sync-message specific reporting/logging.
core/tracker/tracker_internal_test.go Adds tests/benchmark for cohort computation and reporting.
core/tracker/metrics.go Registers the new Prometheus counter vec for cohort rank.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/metrics.md
| `core_tracker_inclusion_delay` | Gauge | Cluster`s average attestation inclusion delay in slots. Available only when attestation_inclusion feature flag is enabled. | |
| `core_tracker_inclusion_missed_total` | Counter | Total number of broadcast duties never included in any block by type | `duty` |
| `core_tracker_inconsistent_parsigs_total` | Counter | Total number of duties that contained inconsistent partial signed data by duty type | `duty` |
| `core_tracker_parsig_cohort_rank_total` | Counter | Total sync committee partial signatures per peer per cohort rank (0=largest cohort), for detecting head disagreement | `duty, peer_idx, rank` |
Comment thread core/tracker/metrics.go
Namespace: "core",
Subsystem: "tracker",
Name: "parsig_cohort_rank_total",
Help: "Total sync committee partial signatures per peer per cohort rank (0=largest cohort), for detecting head disagreement",
@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.37%. Comparing base (8e3bd59) to head (723a772).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
core/tracker/tracker.go 85.71% 4 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4587      +/-   ##
==========================================
+ Coverage   57.34%   57.37%   +0.02%     
==========================================
  Files         245      245              
  Lines       33554    33610      +56     
==========================================
+ Hits        19243    19284      +41     
- Misses      11875    11885      +10     
- Partials     2436     2441       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants