Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

client/network: Allow configuring Kademlia's disjoint query paths #7356

Merged
1 commit merged into from Oct 21, 2020

Conversation

mxinden
Copy link
Contributor

@mxinden mxinden commented Oct 19, 2020

The Rust libp2p-kad implementation can require iterative queries to use
disjoint paths for increased resiliency in the presence of potentially
adversarial nodes.

Allow Substrate users to enable this feature via the
--kademlia-disjoint-query-paths flag.

Release note suggestion:

Allow configuring Kademlia via the --kademlia-disjoint-query-paths flag to require iterative DHT queries to use disjoint paths for increased resiliency in the presence of potentially adversarial nodes.

The Rust libp2p-kad implementation can require iterative queries to use
disjoint paths for increased resiliency in the presence of potentially
adversarial nodes.

Allow Substrate users to enable this feature via the
`--kademlia-disjoint-query-paths` flag.
@mxinden mxinden added A0-please_review Pull request needs code review. B5-clientnoteworthy C1-low PR touches the given topic and has a low impact on builders. labels Oct 19, 2020
@mxinden mxinden requested review from romanb and cecton October 19, 2020 15:49
@@ -144,48 +141,71 @@ impl DiscoveryConfig {

/// Add discovery via Kademlia for the given protocol.
pub fn add_protocol(&mut self, id: ProtocolId) -> &mut Self {
let name = protocol_name_from_protocol_id(&id);
self.add_kademlia(id, name);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Creation of Kademlia instances is moved into fn finish. Otherwise users could first call add_protocol and then use_kademlia_disjoint_query_paths with the latter not taking any effect given that the Kademlias are already created.

Copy link
Contributor

@cecton cecton left a comment

Choose a reason for hiding this comment

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

Excellent

@mxinden
Copy link
Contributor Author

mxinden commented Oct 21, 2020

bot merge

@ghost
Copy link

ghost commented Oct 21, 2020

Trying merge.

@ghost ghost merged commit 5cad894 into paritytech:master Oct 21, 2020
@mxinden
Copy link
Contributor Author

mxinden commented Oct 21, 2020

Thanks for the reviews @romanb and @cecton!

This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants