Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions executor/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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)
}
13 changes: 7 additions & 6 deletions verifier/pkg/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
4 changes: 2 additions & 2 deletions verifier/pkg/sourcereader/finality_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand Down
15 changes: 9 additions & 6 deletions verifier/pkg/vtypes/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
Loading