Skip to content

Conversation

@lexnv
Copy link
Collaborator

@lexnv lexnv commented Jun 3, 2025

This PR adds the ability to register notification protocols and request-response protocols at runtime.

This is beneficial for users who don't have the full set of protocols during the node initialization. Instead, the protocols will be known at runtime, potentially after calling into the substrate runtime itself.

The counterpart on the substrate side must take into account that each protocol instance has a channel of communication with the rest of the protocols. This might complicate things on the substrate side, but in theory, it's possible to pass a new channel.

Signed-off-by: Alexandru Vasile <[email protected]>
@lexnv lexnv self-assigned this Jun 3, 2025
Copy link
Collaborator

@dmitry-markin dmitry-markin left a comment

Choose a reason for hiding this comment

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

Nice one 👍

/// Bandwidth sink.
bandwidth_sink: BandwidthSink,

/// The keep-alive timeout for protocols.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// The keep-alive timeout for protocols.
/// The executor & keep-alive timeout for protocols.

keep_alive_timeout: std::time::Duration,

/// Executor used to run protocols.
executor: Arc<dyn crate::executor::Executor>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: IMO executor deserves a dedicated field in Litep2p, and may be we don't need a new struct then.

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