Skip to content

poc: std HeadTracker and RMNCurseReader conformance#1051

Draft
makramkd wants to merge 1 commit into
mainfrom
mk/std-accessor-tests
Draft

poc: std HeadTracker and RMNCurseReader conformance#1051
makramkd wants to merge 1 commit into
mainfrom
mk/std-accessor-tests

Conversation

@makramkd
Copy link
Copy Markdown
Collaborator

@makramkd makramkd commented Apr 27, 2026

This PR is a PoC of a suite of conformance tests for some accessor interfaces (currently just RMNCurseReader and HeadTracker).

This was me guiding the AI through a lot of it, but I think there can be improvements, mainly around e.g. the RMNCurseReader, since we might be able to use the standard CurseAdapter from the deployment API instead of the custom harness for this suite, but that would look a bit complex for the PoC.

I provided samples of how the conformance suites would be run for the existing EVM source reader.

@github-actions
Copy link
Copy Markdown

Code coverage report:

Package main mk/std-accessor-tests Diff
github.com/smartcontractkit/chainlink-ccv/aggregator 48.44% 48.46% +0.02%
github.com/smartcontractkit/chainlink-ccv/bootstrap 42.60% 42.60% +0.00%
github.com/smartcontractkit/chainlink-ccv/cli 65.13% 65.13% +0.00%
github.com/smartcontractkit/chainlink-ccv/cmd 64.75% 64.75% +0.00%
github.com/smartcontractkit/chainlink-ccv/common 50.74% 50.74% +0.00%
github.com/smartcontractkit/chainlink-ccv/executor 45.97% 45.97% +0.00%
github.com/smartcontractkit/chainlink-ccv/indexer 37.72% 37.72% +0.00%
github.com/smartcontractkit/chainlink-ccv/integration 46.82% 49.25% +2.43%
github.com/smartcontractkit/chainlink-ccv/pkg 84.62% 87.38% +2.76%
github.com/smartcontractkit/chainlink-ccv/pricer 0.00% 0.00% +0.00%
github.com/smartcontractkit/chainlink-ccv/protocol 65.19% 65.19% +0.00%
github.com/smartcontractkit/chainlink-ccv/verifier 32.47% 32.46% -0.01%
Total 45.90% 46.50% +0.60%

Files added (in mk/std-accessor-tests):

  • github.com/smartcontractkit/chainlink-ccv/pkg/chainaccess/headtrackerconformance/conformance.go
  • github.com/smartcontractkit/chainlink-ccv/pkg/chainaccess/rmncurseconformance/conformance.go

Comment on lines +17 to +30
type RMNCurseHarness interface {
// DeployRMN deploys or ensures an RMN Remote–equivalent and returns the
// address the [chainaccess.RMNCurseReader] under test must use. Second
// and later calls may return the same address if idempotent, or an error
// if a second deploy is not supported.
DeployRMN(ctx context.Context) (rmnAddress protocol.UnknownAddress, err error)
// CurseRMN curses the given subjects (e.g. chain selectors or global
// curse as [protocol.Bytes16]).
CurseRMN(ctx context.Context, subjects []protocol.Bytes16) error
// ClearRMNCurses removes all curses so a subsequent
// [chainaccess.RMNCurseReader.GetRMNCursedSubjects] returns the empty
// slice (or the chain’s pre-curse baseline). Safe to call when already clear.
ClearRMNCurses(ctx context.Context) error
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Can probably be replaced by CurseAdapter but this is just a PoC - real implementation would use CurseAdapter to reduce duplication.

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.

1 participant