-
Notifications
You must be signed in to change notification settings - Fork 1.9k
core/services: resolve CRE org ID for limits #20933
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
base: develop
Are you sure you want to change the base?
Conversation
|
I see you updated files related to
|
438196d to
5747b31
Compare
|
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.
🔴 Test Results: Missing OrgResolver Setup
Affected tests:
- Test_workflowRegisteredHandler/success_with_active_workflow_registered (Workflow Run: Core Tests (go_core_tests))
- Test_workflowRegisteredHandler (Workflow Run: Core Tests (go_core_tests))
What Broke
These tests fail because the orgResolver field of eventHandler is not properly initialized in the Test_workflowRegisteredHandler setup. This omission leads to nil pointer dereferences when createWorkflowSpec or h.orgResolver.Get attempts to access the uninitialized orgResolver.
Proposed Fixes
Add a mock OrgResolver to the test setup in Test_workflowRegisteredHandler to ensure the eventHandler is fully initialized and prevent nil pointer dereferences.
func newMockFetcher(m map[string]mockFetchResp) *mockFetcher {
return &mockFetcher{responseMap: m, calledMap: map[string]int{}}
}
+
+ type mockOrgResolver struct {
+ orgID string
+ }
+
+ func (m *mockOrgResolver) Get(ctx context.Context, owner string) (string, error) {
+ return m.orgID, nil
+ }
+
+ func (m *mockOrgResolver) Close() error {
+ return nil
+ }
+
+ func (m *mockOrgResolver) Start(ctx context.Context) error {
+ return nil
+ }
+
+ func (m *mockOrgResolver) Ready() error {
+ return nil
+ }
+
+ func (m *mockOrgResolver) HealthReport() map[string]error {
+ return nil
+ }
+
+ func (m *mockOrgResolver) Name() string {
+ return "mockOrgResolver"
+ }
type mockEngine struct {
CloseErr error if tc.engineFactoryFn != nil {
opts = append(opts, WithEngineFactoryFn(tc.engineFactoryFn))
}
+ mockOrgResolver := &mockOrgResolver{orgID: "test-org-id"}
+ opts = append(opts, WithOrgResolver(mockOrgResolver))
store := store.NewInMemoryStore(lggr, clockwork.NewFakeClock())
registry := capabilities.NewRegistry(lggr)Autofix Options
You can apply the proposed fixes directly to your branch. Try the following:
- Comment
/trunk stack-fix FrKH5NFMto generate a stacked PR with the proposed fixes. - Use MCP in your IDE to fix the issue. Try
Help me fix CI failures from FrKH5NFMto get started.
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.
🔴 Test Results: OCR2 Test Setup
Affected tests:
- TestIntegration_OCR2_plugins (Workflow Run: Core Tests (go_core_tests_integration))
What Broke
The OCR2 integration test environment is not providing the orgID that the updated secretsFetcher now expects during application initialization.
Proposed Fixes
Update the OCR2 integration test environment to provide a dummy orgID to the secretsFetcher during application initialization by setting the ResolveOrg function in the chainlink.Config.
In features_ocr2_helper.go:158
c.EVM[0].Transactions.ForwardersEnabled = &useForwarder
+ c.ResolveOrg = func(ctx context.Context) (string, error) { return "testOrgID", nil }
})Autofix Options
You can apply the proposed fixes directly to your branch. Try the following:
- Comment
/trunk stack-fix 8PIWUPNGto generate a stacked PR with the proposed fixes. - Use MCP in your IDE to fix the issue. Try
Help me fix CI failures from 8PIWUPNGto get started.
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.
🔴 Test Results: OCR2 Integration Failure
Affected tests:
What Broke
The integration test failed due to the new orgresolver caching and the explicit orgID resolution and propagation within the CRE context in core workflow services.
Proposed Fixes
Configure a dummy CRE linking service URL in the OCR2 integration test setup to ensure the OrgResolver is properly initialized and prevent a nil pointer dereference.
In features_ocr2_helper.go:159
\t\tc.EVM[0].Transactions.ForwardersEnabled = &useForwarder
+ \t\tc.CRE.Linking.URL = ptr(commonconfig.URL{Scheme: "http", Host: "localhost:8080"})
\t})Autofix Options
You can apply the proposed fixes directly to your branch. Try the following:
- Comment
/trunk stack-fix RNfZFU8Uto generate a stacked PR with the proposed fixes. - Use MCP in your IDE to fix the issue. Try
Help me fix CI failures from RNfZFU8Uto get started.
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.
🔴 Test Results: Unrelated Failure
Affected failures:
- TestIntegration_MercuryV2_Plugin/receives_at_least_one_report_per_feed_from_each_oracle_when_EAs_are_at_100%_reliability (Workflow Run: Core Tests (go_core_tests_integration))
- TestIntegration_MercuryV2_Plugin (Workflow Run: Core Tests (go_core_tests_integration))
- Workflow Run: Run CCIP integration In Memory Tests For PR / smoke/ccip/ccip_ton_messaging_test.go:Test_CCIPMessaging_TON2EVM
- Workflow Run: Integration Tests
What Broke
These failures are primarily caused by incompatibilities or unexpected behaviors introduced by the updated github.com/smartcontractkit/chainlink-common dependency. This update has led to unhandled errors during organization ID resolution, prevented event filter registration causing test timeouts, and introduced incompatibilities with the libocr/ragep2p library, resulting in peer discovery failures and issues with Mercury V2 plugin report generation and processing.
Proposed Fixes
Correct the TestEngine_OrganizationIdLogger test by setting the OrgResolver field directly in EngineConfig instead of ResolveOrg to ensure proper organization ID resolution and prevent test timeouts.
- cfg.ResolveOrg = func(ctx context.Context) (
- return mockOrgResolver.Get(ctx, cfg.WorkflowOwner)
- }
+ cfg.OrgResolver = mockOrgResolverAutofix Options
You can apply the proposed fixes directly to your branch. Try the following:
- Comment
/trunk stack-fix epTkzacoto generate a stacked PR with the proposed fixes. - Use MCP in your IDE to fix the issue. Try
Help me fix CI failures from epTkzacoto get started.
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.
🔴 Test Results: Org ID Resolution Failure
Affected failures:
- TestScripts/health/multi-chain-loopp (Workflow Run: Core Tests (go_core_tests_integration))
- Workflow Run: Run CCIP integration In Memory Tests For PR / smoke/ccip/ccip_token_transfer_test.go:*_LOOPP
What Broke
These failures stem from issues with organization ID resolution within the workflow engine, primarily due to an updated 'chainlink-common' dependency. This can lead to an incorrectly generated OCR3 candidate configuration or the OrgResolver failing to correctly resolve organization IDs during service initialization.
Proposed Fixes
Modify the workflow engine to explicitly fail if an organization ID cannot be resolved during initialization or execution. Additionally, update the TestEngine_OrganizationIdLogger test to correctly assign the mockOrgResolver to the EngineConfig's OrgResolver field.
orgID, gerr := e.cfg.OrgResolver.Get(ctx, e.cfg.WorkflowOwner)
- if gerr != nil {
- e.logger().Warnw("Failed to resolve organization ID, continuing without it", "workflowOwner", e.cfg.WorkflowOwner, "err", gerr)
- } else {
+ if gerr != nil {
+ return fmt.Errorf("failed to resolve organization ID for workflow owner %s: %w", e.cfg.WorkflowOwner, gerr)
+ }
organizationID = orgID+ var executionStatus string // Moved from line 646
triggerEvent := wrappedTriggerEvent.event.Event
executionID, err := events.GenerateExecutionID(e.cfg.WorkflowID, triggerEvent.ID)
if err != nil {
e.logger().Errorw("Failed to generate execution ID", "err", err, "triggerID", wrappedTriggerEvent.triggerCapID)
+ executionStatus = store.StatusErrored
+ e.cfg.Hooks.OnExecutionError(err.Error())
return
}
// Fetch organization ID for this execution
creCtx := contexts.CREValue(ctx)
if e.cfg.OrgResolver != nil {
orgID, gerr := e.cfg.OrgResolver.Get(ctx, e.cfg.WorkflowOwner)
- if gerr != nil {
- e.logger().Warnw("Failed to resolve organization ID, continuing without it", "workflowOwner", e.cfg.WorkflowOwner, "err", gerr)
- } else {
+ if gerr != nil {
+ e.logger().Errorw("Failed to resolve organization ID, stopping execution", "workflowOwner", e.cfg.WorkflowOwner, "err", gerr)
+ executionStatus = store.StatusErrored
+ e.cfg.Hooks.OnExecutionError(gerr.Error())
+ return
+ }
creCtx.Org = orgID
ctx = contexts.WithCRE(ctx, creCtx)- cfg.ResolveOrg = func(ctx context.Context) (string, error) {
- return mockOrgResolver.Get(ctx, cfg.WorkflowOwner)
- }
+ cfg.OrgResolver = mockOrgResolverAutofix Options
You can apply the proposed fixes directly to your branch. Try the following:
- Comment
/trunk stack-fix UUc3NfQTto generate a stacked PR with the proposed fixes. - Use MCP in your IDE to fix the issue. Try
Help me fix CI failures from UUc3NfQTto get started.
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.
🔴 Test Results: Chainlink-common Dependency Panic
Affected failures:
- Workflow Run: Run CCIP integration In Memory Tests For PR / smoke/ccip/ccip_messaging_test.go:Test_CCIPMessaging_Solana2EVM_LOOPP
- Workflow Run: Run CCIP integration In Memory Tests For PR / smoke/ccip/ccip_messaging_test.go:Test_CCIPMessaging_EVM2Solana_LOOPP
What Broke
These failures stem from issues introduced by an updated github.com/smartcontractkit/chainlink-common dependency. The problems manifest as a panic or nil pointer dereference during service shutdown, specifically within the StopRChan.CtxCancel.func1 function.
Proposed Fixes
Revert the chainlink-common dependency to a previous stable version and ensure the httpOrgResolver is correctly registered as a service, initializing orgResolver to a NullOrgResolver when not configured to prevent nil pointer dereferences.
In go.mod:49
- github.com/smartcontractkit/chainlink-common v0.9.6-0.20260126232212-92ec485fe121
+ github.com/smartcontractkit/chainlink-common v0.9.6-0.20260122165924-94e0fad14fe8In go.sum:1630
- github.com/smartcontractkit/chainlink-common v0.9.6-0.20260126232212-92ec485fe121 h1:cnbetn74KzCqf2kEQKd+pZ+ezsd7EUnNVebIwU+Rqss=
- github.com/smartcontractkit/chainlink-common v0.9.6-0.20260126232212-92ec485fe121/go.mod h1:Eg5rz/fQINjR9H0TxHw7j+zGZeYxprUpEQZzC5JGHG4=
+ github.com/smartcontractkit/chainlink-common v0.9.6-0.20260122165924-94e0fad14fe8 h1:kDHw2ta45azZGdfLldVloLAbo+JS3zIXXRlAIO8f1js=
+ github.com/smartcontractkit/chainlink-common v0.9.6-0.20260122165924-94e0fad14fe8/go.mod h1:Eg5rz/fQINjR9H0TxHw7j+zGZeYxprUpEQZzC5JGHG4=In go.mod:46
- github.com/smartcontractkit/chainlink-common v0.9.6-0.20260126232212-92ec485fe121
+ github.com/smartcontractkit/chainlink-common v0.9.6-0.20260122165924-94e0fad14fe8In go.sum:1367
- github.com/smartcontractkit/chainlink-common v0.9.6-0.20260126232212-92ec485fe121 h1:cnbetn74KzCqf2kEQKd+pZ+ezsd7EUnNVebIwU+Rqss=
- github.com/smartcontractkit/chainlink-common v0.9.6-0.20260126232212-92ec485fe121/go.mod h1:Eg5rz/fQINjR9H0TxHw7j+zGZeYxprUpEQZzC5JGHG4=
+ github.com/smartcontractkit/chainlink-common v0.9.6-0.20260122165924-94e0fad14fe8 h1:kDHw2ta45azZGdfLldVloLAbo+JS3zIXXRlAIO8f1js=
+ github.com/smartcontractkit/chainlink-common v0.9.6-0.20260122165924-94e0fad14fe8/go.mod h1:Eg5rz/fQINjR9H0TxHw7j+zGZeYxprUpEQZzC5JGHG4=In go.mod:89
- github.com/smartcontractkit/chainlink-common v0.9.6-0.20260126232212-92ec485fe121
+ github.com/smartcontractkit/chainlink-common v0.9.6-0.20260122165924-94e0fad14fe8In go.sum:1181
- github.com/smartcontractkit/chainlink-common v0.9.6-0.20260126232212-92ec485fe121 h1:cnbetn74KzCqf2kEQKd+pZ+ezsd7EUnNVebIwU+Rqss=
- github.com/smartcontractkit/chainlink-common v0.9.6-0.20260126232212-92ec485fe121/go.mod h1:Eg5rz/fQINjR9H0TxHw7j+zGZeYxprUpEQZzC5JGHG4=
+ github.com/smartcontractkit/chainlink-common v0.9.6-0.20260122165924-94e0fad14fe8 h1:kDHw2ta45azZGdfLldVloLAbo+JS3zIXXRlAIO8f1js=
+ github.com/smartcontractkit/chainlink-common v0.9.6-0.20260122165924-94e0fad14fe8/go.mod h1:Eg5rz/fQINjR9H0TxHw7j+zGZeYxprUpEQZzC5JGHG4=In go.mod:54
- github.com/smartcontractkit/chainlink-common v0.9.6-0.20260126232212-92ec485fe121
+ github.com/smartcontractkit/chainlink-common v0.9.6-0.20260122165924-94e0fad14fe8In go.sum:1611
- github.com/smartcontractkit/chainlink-common v0.9.6-0.20260126232212-92ec485fe121 h1:cnbetn74KzCqf2kEQKd+pZ+ezsd7EUnNVebIwU+Rqss=
- github.com/smartcontractkit/chainlink-common v0.9.6-0.20260126232212-92ec485fe121/go.mod h1:Eg5rz/fQINjR9H0TxHw7j+zGZeYxprUpEQZzC5JGHG4=
+ github.com/smartcontractkit/chainlink-common v0.9.6-0.20260122165924-94e0fad14fe8 h1:kDHw2ta45azZGdfLldVloLAbo+JS3zIXXRlAIO8f1js=
+ github.com/smartcontractkit/chainlink-common v0.9.6-0.20260122165924-94e0fad14fe8/go.mod h1:Eg5rz/fQINjR9H0TxHw7j+zGZeYxprUpEQZzC5JGHG4=In go.mod:35
- github.com/smartcontractkit/chainlink-common v0.9.6-0.20260126232212-92ec485fe121
+ github.com/smartcontractkit/chainlink-common v0.9.6-0.20260122165924-94e0fad14fe8In go.sum:1589
- github.com/smartcontractkit/chainlink-common v0.9.6-0.20260126232212-92ec485fe121 h1:cnbetn74KzCqf2kEQKd+pZ+ezsd7EUnNVebIwU+Rqss=
- github.com/smartcontractkit/chainlink-common v0.9.6-0.20260126232212-92ec485fe121/go.mod h1:Eg5rz/fQINjR9H0TxHw7j+zGZeYxprUpEQZzC5JGHG4=
+ github.com/smartcontractkit/chainlink-common v0.9.6-0.20260122165924-94e0fad14fe8 h1:kDHw2ta45azZGdfLldVloLAbo+JS3zIXXRlAIO8f1js=
+ github.com/smartcontractkit/chainlink-common v0.9.6-0.20260122165924-94e0fad14fe8/go.mod h1:Eg5rz/fQINjR9H0TxHw7j+zGZeYxprUpEQZzC5JGHG4=In go.mod:35
- github.com/smartcontractkit/chainlink-common v0.9.6-0.20260126232212-92ec485fe121
+ github.com/smartcontractkit/chainlink-common v0.9.6-0.20260122165924-94e0fad14fe8In go.sum:1596
- github.com/smartcontractkit/chainlink-common v0.9.6-0.20260126232212-92ec485fe121 h1:cnbetn74KzCqf2kEQKd+pZ+ezsd7EUnNVebIwU+Rqss=
- github.com/smartcontractkit/chainlink-common v0.9.6-0.20260126232212-92ec485fe121/go.mod h1:Eg5rz/fQINjR9H0TxHw7j+zGZeYxprUpEQZzC5JGHG4=
+ github.com/smartcontractkit/chainlink-common v0.9.6-0.20260122165924-94e0fad14fe8 h1:kDHw2ta45azZGdfLldVloLAbo+JS3zIXXRlAIO8f1js=
+ github.com/smartcontractkit/chainlink-common v0.9.6-0.20260122165924-94e0fad14fe8/go.mod h1:Eg5rz/fQINjR9H0TxHw7j+zGZeYxprUpEQZzC5JGHG4=In go.mod:55
- github.com/smartcontractkit/chainlink-common v0.9.6-0.20260126232212-92ec485fe121
+ github.com/smartcontractkit/chainlink-common v0.9.6-0.20260122165924-94e0fad14fe8In go.sum:1793
- github.com/smartcontractkit/chainlink-common v0.9.6-0.20260126232212-92ec485fe121 h1:cnbetn74KzCqf2kEQKd+pZ+ezsd7EUnNVebIwU+Rqss=
- github.com/smartcontractkit/chainlink-common v0.9.6-0.20260126232212-92ec485fe121/go.mod h1:Eg5rz/fQINjR9H0TxHw7j+zGZeYxprUpEQZzC5JGHG4=
+ github.com/smartcontractkit/chainlink-common v0.9.6-0.20260122165924-94e0fad14fe8 h1:kDHw2ta45azZGdfLldVloLAbo+JS3zIXXRlAIO8f1js=
+ github.com/smartcontractkit/chainlink-common v0.9.6-0.20260122165924-94e0fad14fe8/go.mod h1:Eg5rz/fQINjR9H0TxHw7j+zGZeYxprUpEQZzC5JGHG4=- orgResolver, err := orgresolver.NewHTTPClient(globalLogger, *cfg.CRE.LinkingServiceURL, *cfg.CRE.OrgResolverCacheTTL)
+ httpOrgResolver, err := orgresolver.NewHTTPClient(globalLogger, *cfg.CRE.LinkingServiceURL, *cfg.CRE.OrgResolverCacheTTL)
if err != nil {
return nil, fmt.Errorf("failed to create org resolver: %w", err)
}
- orgResolver = orgresolver.NewCache(orgResolver)
- srvcs = append(srvcs, orgResolver)
+ srvcs = append(srvcs, httpOrgResolver)
+ orgResolver = orgresolver.NewCache(httpOrgResolver)
} else {
globalLogger.Warn("OrgResolver not created - no linking service URL configured")
+ orgResolver = &orgresolver.NullOrgResolver{}Autofix Options
You can apply the proposed fixes directly to your branch. Try the following:
- Comment
/trunk stack-fix SGVWqFF1to generate a stacked PR with the proposed fixes. - Use MCP in your IDE to fix the issue. Try
Help me fix CI failures from SGVWqFF1to get started.
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.
🔴 Test Results: Blocking OrgResolver Call
Affected failures:
- Workflow Run: Run CCIP integration In Memory Tests For PR / smoke/ccip/ccip_ton_messaging_test.go:Test_CCIPMessaging_EVM2TON
What Broke
The root cause is a blocking call to the orgresolver.Get method during workflow registration within the Test_CCIPMessaging_EVM2TON integration test.
Proposed Fixes
Modify createWorkflowSpec in core/services/workflows/syncer/v2/handler.go to handle orgResolver.Get errors gracefully by logging a warning and proceeding with an empty organization ID, preventing workflow registration from blocking.
- orgID, err := h.orgResolver.Get(ctx, owner)
+ orgID, err := h.orgResolver.Get(ctx, owner)
if err != nil {
- //TODO fail open
- return nil, fmt.Errorf("failed to get organization ID from org resolver: %w", err)
+ h.lggr.Warnw("Failed to get organization ID from org resolver during workflow spec creation, proceeding without it", "workflowOwner", owner, "error", err)
+ orgID = "" // Proceed with empty orgID
}
ctx = contexts.WithCRE(ctx, contexts.CRE{Org: orgID, Owner: owner, Workflow: wfID})Autofix Options
You can apply the proposed fixes directly to your branch. Try the following:
- Comment
/trunk stack-fix CgUujrfVto generate a stacked PR with the proposed fixes. - Use MCP in your IDE to fix the issue. Try
Help me fix CI failures from CgUujrfVto get started.
Tip
Get Better Results: This CI job is not uploading test reports. Adding structured test reports enables more precise, test-level analysis with better root cause identification and more targeted fix recommendations.
👉🏻 Learn how to upload test results.
|




https://smartcontract-it.atlassian.net/browse/CRE-1707
Requires: