Skip to content

*: add metric with sync message cohorts#4587

Merged
KaloyanTanev merged 2 commits into
mainfrom
kalo/sync-cohort-metric
Jul 7, 2026
Merged

*: add metric with sync message cohorts#4587
KaloyanTanev merged 2 commits 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

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
Comment thread core/tracker/metrics.go
@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.27451% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.49%. Comparing base (80ddd49) to head (bece19c).

Files with missing lines Patch % Lines
core/tracker/tracker.go 85.71% 4 Missing and 4 partials ⚠️
app/health/checker.go 86.95% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4587      +/-   ##
==========================================
+ Coverage   57.40%   57.49%   +0.08%     
==========================================
  Files         245      245              
  Lines       33560    33653      +93     
==========================================
+ Hits        19265    19348      +83     
- Misses      11856    11859       +3     
- Partials     2439     2446       +7     

☔ 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.

@KaloyanTanev KaloyanTanev force-pushed the kalo/sync-cohort-metric branch from 33bed1e to bece19c Compare July 7, 2026 12:17
@sonarqubecloud

sonarqubecloud Bot commented Jul 7, 2026

Copy link
Copy Markdown

@KaloyanTanev KaloyanTanev enabled auto-merge (squash) July 7, 2026 12:27
@KaloyanTanev KaloyanTanev merged commit b2d71e6 into main Jul 7, 2026
12 checks passed
@KaloyanTanev KaloyanTanev deleted the kalo/sync-cohort-metric branch July 7, 2026 12:29
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.

3 participants