-
Notifications
You must be signed in to change notification settings - Fork 3
feat(devenv/tcapi): bound persistent-network event scans, add delivery-only Run mode #1221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
a701bbc
01741ff
a4f5075
74e6c1a
5ed0842
19623eb
a274a65
b632cc2
aaf393c
89205f5
e5bd254
ff9f359
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -111,20 +111,15 @@ func (tc *v3TestCase) Run(ctx context.Context) error { | |
| } | ||
| messageID := sendMessageResult.MessageID | ||
|
|
||
| aggregatorClients, err := tc.lib.AllAggregators() | ||
| if err != nil { | ||
| return fmt.Errorf("failed to get aggregator clients: %w", err) | ||
| } | ||
| aggregatorClient := aggregatorClients[common.DefaultCommitteeVerifierQualifier] | ||
| if tc.aggregatorQualifier != "" && tc.aggregatorQualifier != common.DefaultCommitteeVerifierQualifier { | ||
| if client, ok := aggregatorClients[tc.aggregatorQualifier]; ok { | ||
| aggregatorClient = client | ||
| var aggregatorClient *ccv.AggregatorClient | ||
| var indexerMonitor *ccv.IndexerMonitor | ||
| if !tc.args.Run.OnchainAssertionOnly { | ||
| var setupErr error | ||
| aggregatorClient, indexerMonitor, setupErr = setupAggregatorAndIndexer(tc.lib, tc.aggregatorQualifier) | ||
| if setupErr != nil { | ||
| return setupErr | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: I had a similar idea to make aggregator/indexer assertions optional on environments where this information may not be available - was wondering if we should gate this purely based on presence (i.e. The main advantage I see to the presence-based approach is that you don't need to update the test code or write a new test in order to run it in different environments - but curious as to what your. thoughts are.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Valid point, |
||
| } | ||
| } | ||
| indexerMonitor, err := tc.lib.IndexerMonitor() | ||
| if err != nil { | ||
| return fmt.Errorf("failed to get indexer monitor: %w", err) | ||
| } | ||
| testCtx, cleanupFn := tcapi.NewTestingContext(ctx, chainMap, aggregatorClient, indexerMonitor) | ||
| defer cleanupFn() | ||
|
|
||
|
|
@@ -138,11 +133,13 @@ func (tc *v3TestCase) Run(ctx context.Context) error { | |
| if err != nil { | ||
| return fmt.Errorf("failed to assert message: %w", err) | ||
| } | ||
| if result.AggregatedResult == nil { | ||
| return fmt.Errorf("aggregated result is nil") | ||
| } | ||
| if len(result.IndexedVerifications.Results) != tc.numExpectedVerifications { | ||
| return fmt.Errorf("expected %d indexed verifications, got %d", tc.numExpectedVerifications, len(result.IndexedVerifications.Results)) | ||
| if !tc.args.Run.OnchainAssertionOnly { | ||
| if result.AggregatedResult == nil { | ||
| return fmt.Errorf("aggregated result is nil") | ||
| } | ||
| if len(result.IndexedVerifications.Results) != tc.numExpectedVerifications { | ||
| return fmt.Errorf("expected %d indexed verifications, got %d", tc.numExpectedVerifications, len(result.IndexedVerifications.Results)) | ||
| } | ||
| } | ||
|
|
||
| e, err := dst.ConfirmExecOnDest(ctx, tc.src, messageKey, execTimeout) | ||
|
|
@@ -161,6 +158,24 @@ func (tc *v3TestCase) HavePrerequisites(ctx context.Context) bool { | |
| return tc.ensureHydrated(ctx) == nil | ||
| } | ||
|
|
||
| func setupAggregatorAndIndexer(lib ccv.Lib, aggregatorQualifier string) (*ccv.AggregatorClient, *ccv.IndexerMonitor, error) { | ||
| aggregatorClients, err := lib.AllAggregators() | ||
| if err != nil { | ||
| return nil, nil, fmt.Errorf("failed to get aggregator clients: %w", err) | ||
| } | ||
| aggregatorClient := aggregatorClients[common.DefaultCommitteeVerifierQualifier] | ||
| if aggregatorQualifier != "" && aggregatorQualifier != common.DefaultCommitteeVerifierQualifier { | ||
| if client, ok := aggregatorClients[aggregatorQualifier]; ok { | ||
| aggregatorClient = client | ||
| } | ||
| } | ||
| indexerMonitor, err := lib.IndexerMonitor() | ||
| if err != nil { | ||
| return nil, nil, fmt.Errorf("failed to get indexer monitor: %w", err) | ||
| } | ||
| return aggregatorClient, indexerMonitor, nil | ||
| } | ||
|
|
||
| func getCommitteeCCV(resolver chainreg.AddressResolver, ds datastore.DataStore, srcChainSelector uint64, qualifier string) (protocol.CCV, error) { | ||
| addr, err := resolver.GetCommitteeCCV(ds, srcChainSelector, qualifier) | ||
| if err != nil { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kept as an independent constant rather than importing
sourcereader.DefaultMaxBlockRangeto avoid a devenv>verifier package dependency