Skip to content

Add remote capability dedupe against local capabilities - #23932

Open
amit-momin wants to merge 8 commits into
developfrom
cre/prefer-local-capabilities-over-duplicate-remote-capability
Open

amit-momin wants to merge 8 commits into
developfrom
cre/prefer-local-capabilities-over-duplicate-remote-capability

Conversation

@amit-momin

@amit-momin amit-momin commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

✅ No conflicts with other open PRs targeting develop

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

I see you updated files related to core. Please run make gocs in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@trunk-io

trunk-io Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Static Badge   Static Badge   Static Badge

View Full Report ↗︎ ⋅ Docs

@amit-momin
amit-momin marked this pull request as ready for review October 22, 2026 14:57
@amit-momin
amit-momin requested review from a team as code owners October 22, 2026 14:57

@ilija42 ilija42 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this approach would still take down the chain cap though?

ilija42
ilija42 previously approved these changes Oct 22, 2026
Comment thread core/capabilities/launcher.go Outdated
// Prefer capabilities hosted locally over remote ones. If this node serves a capability ID as
// part of a capability DON, never set up a remote shim for the same ID. This is a safety mechanism
// to prevent duplicate capability configs taking down the capability altogether.
remoteCapabilityDONs = filterLocalCapabilitiesFromRemote(remoteCapabilityDONs, myCapabilityDONs)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@amit-momin Is it possible for the current don to be public and still experience the issue? remoteCapabilityDONs comes from publicDONs so I think that's true.

I think you can fix this by using myDONs instead

Comment thread core/capabilities/launcher.go Outdated
// filterLocalCapabilitiesFromRemote returns remoteDONs with every capability ID that is hosted by one
// of myCapabilityDONs removed from their capability configurations. The inputs are not mutated.
// This method still leaves room for the same capability to exist on different remote DONs.
func filterLocalCapabilitiesFromRemote(remoteDONs, myCapabilityDONs []registry.DON) []registry.DON {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be better to have this sort of policy logic in addRemoteCapabilities instead, that's where we make other policy decisions atm -- iterate over remoteDON.CapabilityConfigurations, check whether myDON has a matching capability, and refuse to add a remote cap if that's true

@cl-sonarqube-production

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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.

3 participants