Skip to content

Conversation

@emate
Copy link

@emate emate commented Jan 14, 2026

Implements a heartbeat service that aggregates blockchain synchronization metrics across multiple verifier nodes, enabling validators to identify lagging nodes and assess their health.

Heartbeat Request contains

  • SendTimestamp: Unix timestamp
  • ChainDetails.BlockHeightsByChain: map<chainSelector, blockHeight>

Response contains

  • ChainBenchmarks: Per-chain aggregated metrics
    • BlockHeight: Network maximum across all callers
    • Score: Adaptive MAD-based score (1.0 = healthy, >1.0 = lagging)

Metrics Added:

  • verifier_heartbeat_timestamp (gauge): Last heartbeat timestamp per verifier
  • verifier_heartbeats_total (counter): Total heartbeats received per verifier
  • verifier_heartbeat_chain_heads (gauge): Block height per verifier per chain
  • verifier_heartbeat_score (gauge): Adaptive lag score per verifier per chain

All metrics include caller_id and chain_selector labels for per-verifier, per-chain visibility.

@emate emate force-pushed the emate/ccip-8200-add-heartbeat-endpoint branch from 8b04d8c to fd28bec Compare January 14, 2026 14:14
@emate emate requested a review from carte7000 January 14, 2026 16:44
}

// CalculateAdaptiveScore computes the adaptive score based on the provided block height and all block heights.
// The score reflects how far behind the provided block height is compared to others using Median Absolute Deviation (MAD).
Copy link
Contributor

Choose a reason for hiding this comment

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

Pretty cool!

@emate emate force-pushed the emate/ccip-8200-add-heartbeat-endpoint branch from 9dcd461 to 2215909 Compare January 15, 2026 16:23
@emate emate force-pushed the emate/ccip-8200-add-heartbeat-endpoint branch from 669c6e4 to 2e7234a Compare January 15, 2026 17:54
@github-actions
Copy link

Code coverage report:

Package main emate/ccip-8200-add-heartbeat-endpoint diff
github.com/smartcontractkit/chainlink-ccv/aggregator 50.87% 48.76% -2.11%
github.com/smartcontractkit/chainlink-ccv/cmd 0.00% 0.00% +0.00%
github.com/smartcontractkit/chainlink-ccv/committee 100.00% 100.00% +0.00%
github.com/smartcontractkit/chainlink-ccv/common 0.00% 0.00% +0.00%
github.com/smartcontractkit/chainlink-ccv/executor 49.21% 49.21% +0.00%
github.com/smartcontractkit/chainlink-ccv/indexer 37.74% 37.74% +0.00%
github.com/smartcontractkit/chainlink-ccv/integration 44.02% 44.02% +0.00%
github.com/smartcontractkit/chainlink-ccv/pkg 100.00% 100.00% +0.00%
github.com/smartcontractkit/chainlink-ccv/pricer 56.67% 56.67% +0.00%
github.com/smartcontractkit/chainlink-ccv/protocol 54.98% 54.98% +0.00%
github.com/smartcontractkit/chainlink-ccv/verifier 57.65% 57.67% +0.02%

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