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

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.
This commit is contained in:
Max Inden
2020-10-21 13:08:39 +02:00
committed by GitHub
parent a062bc2f1d
commit 4e9256aba2
4 changed files with 72 additions and 38 deletions
+1
View File
@@ -292,6 +292,7 @@ impl<B: BlockT + 'static, H: ExHashT> NetworkWorker<B, H> {
config.discovery_limit(u64::from(params.network_config.out_peers) + 15);
config.add_protocol(params.protocol_id.clone());
config.allow_non_globals_in_dht(params.network_config.allow_non_globals_in_dht);
config.use_kademlia_disjoint_query_paths(params.network_config.kademlia_disjoint_query_paths);
match params.network_config.transport {
TransportConfig::MemoryOnly => {