CCIP-9669 finality checker metrics interface#1024
Merged
Conversation
4e44e15 to
46e3075
Compare
46e3075 to
5ea8fb6
Compare
|
Code coverage report:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors verifier/executor metrics interfaces to better separate ownership and narrow dependencies, especially around curse-checker and finality-checker metrics.
Changes:
- Verifier: Introduces
FinalityCheckerMetricsand embeds it (pluscommon.CurseCheckerMetrics) intoMetricLabeler. - Finality checker: Narrows dependency from
MetricLabelertoFinalityCheckerMetrics. - Shared verifier interfaces: Re-exports
FinalityCheckerMetricsviaverifier/pkg.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| verifier/pkg/vtypes/interfaces.go | Adds FinalityCheckerMetrics; updates MetricLabeler to embed finality + curse metrics interfaces. |
| verifier/pkg/sourcereader/finality_checker.go | Changes finality checker service dependency to FinalityCheckerMetrics. |
| verifier/pkg/interfaces.go | Re-exports FinalityCheckerMetrics for external consumers. |
| executor/interfaces.go | Updates executor MetricLabeler to embed ccvcommon.CurseCheckerMetrics and removes inlined curse methods. |
Comments suppressed due to low confidence (1)
verifier/pkg/sourcereader/finality_checker.go:69
NewFinalityViolationCheckerServiceacceptsmetricsbut doesn't validate it. If a nil implementation is passed, later calls toSetVerifierFinalityViolated(including inreset()and on violation detection) will panic. Consider either rejecting nil metrics in the constructor (consistent with other deps) or defaulting to a no-op implementation when nil is provided.
func NewFinalityViolationCheckerService(
sourceReader chainaccess.SourceReader,
chainSelector protocol.ChainSelector,
lggr logger.Logger,
metrics verifier.FinalityCheckerMetrics,
) (*FinalityViolationCheckerService, error) {
if sourceReader == nil {
return nil, fmt.Errorf("sourceReader cannot be nil")
}
if lggr == nil {
return nil, fmt.Errorf("logger cannot be nil")
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
carte7000
approved these changes
Apr 21, 2026
0xAustinWang
approved these changes
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor metric interfaces in executor and verifier to tighten ownership and separate checker-specific metrics.
Executor
MetricLabelernow embedsccvcommon.CurseCheckerMetrics.MetricLabeler.Verifier
FinalityCheckerMetricsinterface for finality violation metrics.MetricLabelernow embeds bothFinalityCheckerMetricsandcommon.CurseCheckerMetrics.MetricLabelerand into the dedicated interfaces.Finality checker service
FinalityViolationCheckerServicenow depends onFinalityCheckerMetricsinstead of the broaderMetricLabeler.Shared verifier interfaces
FinalityCheckerMetricsfromverifier/pkg