Skip to content

Gossip Extensions feature flag#443

Merged
lucassaldanha merged 4 commits intolibp2p:developfrom
lucassaldanha:extensions_feature_flag
Feb 19, 2026
Merged

Gossip Extensions feature flag#443
lucassaldanha merged 4 commits intolibp2p:developfrom
lucassaldanha:extensions_feature_flag

Conversation

@lucassaldanha
Copy link
Collaborator

Main change

The main idea behind this change is to ensure backwards compatibility with anyone already using GossipRouter.

Introduce a new GossipExtensionConfig data class that is used to set which extensions should be enabled.

The GossipRouter has been updated to receive a new constructor parameter gossipExtensionsConfig that is used to initialise the object GossipExtensionsState. GossipRouterBuilder was updated to receive a GossipExtensionsConfig; this way, the application can decide what extensions to enable when creating a router.

When processing extensions messages on processExtensions, the router uses the flags from GossipExtentionState to determine if:

  1. The local node has a particular extension enabled
  2. The peer who sent this message has notified our node that it supports that extension (via ControlExtension message)

Other changes
Had to rename a bunch of methods and variables because it wasn't consistent with the spec. We have ControlExtensions (and not ExtensionsControl), etc.

Copy link
Collaborator

@StefanBratanov StefanBratanov left a comment

Choose a reason for hiding this comment

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

LGTM

@lucassaldanha lucassaldanha merged commit 00e7419 into libp2p:develop Feb 19, 2026
2 checks passed
@lucassaldanha lucassaldanha deleted the extensions_feature_flag branch February 19, 2026 19:40
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.

2 participants