From 5ea8fb691b00c7134864b39c201d070910b1bf71 Mon Sep 17 00:00:00 2001 From: Aleksandr Bukata Date: Wed, 15 Apr 2026 15:25:26 +0100 Subject: [PATCH 1/2] CCIP-9669 finality checker metrics interface --- build/devenv/evm/impl.go | 1 + executor/interfaces.go | 7 +++---- verifier/pkg/interfaces.go | 13 +++++++------ verifier/pkg/sourcereader/finality_checker.go | 4 ++-- verifier/pkg/vtypes/interfaces.go | 15 +++++++++------ 5 files changed, 22 insertions(+), 18 deletions(-) diff --git a/build/devenv/evm/impl.go b/build/devenv/evm/impl.go index 49634a389..d64205e15 100644 --- a/build/devenv/evm/impl.go +++ b/build/devenv/evm/impl.go @@ -666,6 +666,7 @@ func (m *CCIP17EVM) SendMessageWithNonce(ctx context.Context, dest uint64, field msg, ) if err != nil { + l.Error().Err(err).Str("rtr", rout.Address().String()).Msg("failed to send message") return cciptestinterfaces.MessageSentEvent{}, fmt.Errorf("failed to get fee: %w", err) } diff --git a/executor/interfaces.go b/executor/interfaces.go index ce5bde7d5..1f6bc551d 100644 --- a/executor/interfaces.go +++ b/executor/interfaces.go @@ -4,6 +4,7 @@ import ( "context" "time" + ccvcommon "github.com/smartcontractkit/chainlink-ccv/common" commonmetrics "github.com/smartcontractkit/chainlink-ccv/common/metrics" v1 "github.com/smartcontractkit/chainlink-ccv/indexer/pkg/api/handlers/v1" "github.com/smartcontractkit/chainlink-ccv/indexer/pkg/common" @@ -72,6 +73,8 @@ type Monitoring interface { // MetricLabeler provides all metric recording functionality for the indexer. type MetricLabeler interface { + ccvcommon.CurseCheckerMetrics + // With returns a new metrics labeler with the given key-value pairs. With(keyValues ...string) MetricLabeler // RecordMessageExecutionLatency records the duration of the full ExecuteMessage operation. @@ -106,8 +109,4 @@ type MetricLabeler interface { // has entered an unrecoverable failure state (e.g. the execution attempt // poller permanently failed). This should trigger an alert. IncrementDestinationReaderCriticalFailure(ctx context.Context, destChainSelector protocol.ChainSelector) - // SetRemoteChainCursed sets value 1 if source chain is cursed - SetRemoteChainCursed(ctx context.Context, localSelector, remoteSelector protocol.ChainSelector, cursed bool) - // SetLocalChainGlobalCursed sets value 1 if source chain is cursed - SetLocalChainGlobalCursed(ctx context.Context, localSelector protocol.ChainSelector, globalCurse bool) } diff --git a/verifier/pkg/interfaces.go b/verifier/pkg/interfaces.go index ae05600dd..2a0ce6541 100644 --- a/verifier/pkg/interfaces.go +++ b/verifier/pkg/interfaces.go @@ -5,10 +5,11 @@ import vtypes "github.com/smartcontractkit/chainlink-ccv/verifier/pkg/vtypes" // Type aliases - the actual definitions live in verifier/pkg/vtypes. // These aliases preserve backward compatibility for all existing consumers of verifier/pkg. type ( - MessageSigner = vtypes.MessageSigner - VerificationResult = vtypes.VerificationResult - Verifier = vtypes.Verifier - MessageLatencyTracker = vtypes.MessageLatencyTracker - Monitoring = vtypes.Monitoring - MetricLabeler = vtypes.MetricLabeler + MessageSigner = vtypes.MessageSigner + VerificationResult = vtypes.VerificationResult + Verifier = vtypes.Verifier + MessageLatencyTracker = vtypes.MessageLatencyTracker + Monitoring = vtypes.Monitoring + MetricLabeler = vtypes.MetricLabeler + FinalityCheckerMetrics = vtypes.FinalityCheckerMetrics ) diff --git a/verifier/pkg/sourcereader/finality_checker.go b/verifier/pkg/sourcereader/finality_checker.go index 2ece437f7..b911bd999 100644 --- a/verifier/pkg/sourcereader/finality_checker.go +++ b/verifier/pkg/sourcereader/finality_checker.go @@ -42,7 +42,7 @@ type FinalityViolationCheckerService struct { sourceReader chainaccess.SourceReader chainSelector protocol.ChainSelector lggr logger.Logger - metrics verifier.MetricLabeler + metrics verifier.FinalityCheckerMetrics // Stored finalized blocks (keyed by block number) finalizedBlocks map[uint64]protocol.BlockHeader @@ -59,7 +59,7 @@ func NewFinalityViolationCheckerService( sourceReader chainaccess.SourceReader, chainSelector protocol.ChainSelector, lggr logger.Logger, - metrics verifier.MetricLabeler, + metrics verifier.FinalityCheckerMetrics, ) (*FinalityViolationCheckerService, error) { if sourceReader == nil { return nil, fmt.Errorf("sourceReader cannot be nil") diff --git a/verifier/pkg/vtypes/interfaces.go b/verifier/pkg/vtypes/interfaces.go index daac0a610..429f2e78a 100644 --- a/verifier/pkg/vtypes/interfaces.go +++ b/verifier/pkg/vtypes/interfaces.go @@ -4,6 +4,7 @@ import ( "context" "time" + "github.com/smartcontractkit/chainlink-ccv/common" commonmetrics "github.com/smartcontractkit/chainlink-ccv/common/metrics" "github.com/smartcontractkit/chainlink-ccv/protocol" ) @@ -48,8 +49,16 @@ type Monitoring interface { commonmetrics.ServiceMetrics } +type FinalityCheckerMetrics interface { + // SetVerifierFinalityViolated sets value 1 if finality violated + SetVerifierFinalityViolated(ctx context.Context, selector protocol.ChainSelector, violated bool) +} + // MetricLabeler provides all metric recording functionality for the verifier. type MetricLabeler interface { + FinalityCheckerMetrics + common.CurseCheckerMetrics + // With returns a new metrics labeler with the given key-value pairs. With(keyValues ...string) MetricLabeler @@ -115,12 +124,6 @@ type MetricLabeler interface { RecordSourceChainSafeBlock(ctx context.Context, blockNum int64) // RecordReorgTrackedSeqNums records the number of sequence numbers being tracked due to reorg. RecordReorgTrackedSeqNums(ctx context.Context, count int64) - // SetVerifierFinalityViolated sets value 1 if finality violated - SetVerifierFinalityViolated(ctx context.Context, selector protocol.ChainSelector, violated bool) - // SetRemoteChainCursed sets value 1 if source chain is cursed - SetRemoteChainCursed(ctx context.Context, localSelector, remoteSelector protocol.ChainSelector, cursed bool) - // SetLocalChainGlobalCursed sets value 1 if source chain is cursed - SetLocalChainGlobalCursed(ctx context.Context, localSelector protocol.ChainSelector, globalCurse bool) // HTTP API metrics From 5bfe1b91f956e0769b85830f99b31d8af9099cbd Mon Sep 17 00:00:00 2001 From: Aleksandr Bukata <96521086+bukata-sa@users.noreply.github.com> Date: Tue, 21 Apr 2026 15:44:41 +0100 Subject: [PATCH 2/2] Update impl.go --- build/devenv/evm/impl.go | 1 - 1 file changed, 1 deletion(-) diff --git a/build/devenv/evm/impl.go b/build/devenv/evm/impl.go index d64205e15..49634a389 100644 --- a/build/devenv/evm/impl.go +++ b/build/devenv/evm/impl.go @@ -666,7 +666,6 @@ func (m *CCIP17EVM) SendMessageWithNonce(ctx context.Context, dest uint64, field msg, ) if err != nil { - l.Error().Err(err).Str("rtr", rout.Address().String()).Msg("failed to send message") return cciptestinterfaces.MessageSentEvent{}, fmt.Errorf("failed to get fee: %w", err) }