diff --git a/core/services/ccipcapability/launcher/diff.go b/core/services/ccipcapability/launcher/diff.go index 32f7fa3588..d56bf9dd12 100644 --- a/core/services/ccipcapability/launcher/diff.go +++ b/core/services/ccipcapability/launcher/diff.go @@ -97,8 +97,6 @@ func filterCCIPDONs( ) (map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo, error) { ccipDONs := make(map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo) for _, don := range state.IDsToDONs { - // CCIP DONs should only have one capability, CCIP. - var found bool for _, donCapabilities := range don.CapabilityConfigurations { hid, err := hashedCapabilityId(ccipCapability.LabelledName, ccipCapability.Version) if err != nil { @@ -106,13 +104,8 @@ func filterCCIPDONs( } if donCapabilities.CapabilityId == hid { ccipDONs[registrysyncer.DonID(don.Id)] = don - found = true } } - if found && len(don.CapabilityConfigurations) > 1 { - return nil, fmt.Errorf("found more than one capability (actual: %d) in the CCIP DON %d", - len(don.CapabilityConfigurations), don.Id) - } } return ccipDONs, nil diff --git a/core/services/ccipcapability/launcher/diff_test.go b/core/services/ccipcapability/launcher/diff_test.go index 2613e6cb26..c7a54cad2f 100644 --- a/core/services/ccipcapability/launcher/diff_test.go +++ b/core/services/ccipcapability/launcher/diff_test.go @@ -353,8 +353,20 @@ func Test_filterCCIPDONs(t *testing.T) { }, }, }, - map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{}, - true, + map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + 1: { + Id: 1, + CapabilityConfigurations: []kcr.CapabilitiesRegistryCapabilityConfiguration{ + { + CapabilityId: mustHashedCapabilityId("ccip", "v1.0.0"), + }, + { + CapabilityId: mustHashedCapabilityId("ccip", "v1.1.0"), + }, + }, + }, + }, + false, }, } for _, tt := range tests { diff --git a/core/services/ccipcapability/launcher/integration_test.go b/core/services/ccipcapability/launcher/integration_test.go index ff7e920148..bb16faf669 100644 --- a/core/services/ccipcapability/launcher/integration_test.go +++ b/core/services/ccipcapability/launcher/integration_test.go @@ -335,7 +335,7 @@ func TestIntegration_Launcher(t *testing.T) { ) gomega.NewWithT(t).Eventually(func() bool { - return len(launcher.runningDONs()) == 1 + return len(launcher.runningDONIDs()) == 1 }, testutils.WaitTimeout(t), testutils.TestInterval).Should(gomega.BeTrue()) } diff --git a/core/services/ccipcapability/launcher/launcher.go b/core/services/ccipcapability/launcher/launcher.go index 08c83f24e0..0a5621c156 100644 --- a/core/services/ccipcapability/launcher/launcher.go +++ b/core/services/ccipcapability/launcher/launcher.go @@ -92,7 +92,7 @@ func (l *launcher) getLatestState() registrysyncer.State { return l.latestState } -func (l *launcher) runningDONs() []registrysyncer.DonID { +func (l *launcher) runningDONIDs() []registrysyncer.DonID { l.lock.RLock() defer l.lock.RUnlock() var runningDONs []registrysyncer.DonID