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
+4
View File
@@ -423,6 +423,9 @@ pub struct NetworkConfiguration {
pub max_parallel_downloads: u32,
/// Should we insert non-global addresses into the DHT?
pub allow_non_globals_in_dht: bool,
/// Require iterative Kademlia DHT queries to use disjoint paths for increased resiliency in the
/// presence of potentially adversarial nodes.
pub kademlia_disjoint_query_paths: bool,
}
impl NetworkConfiguration {
@@ -454,6 +457,7 @@ impl NetworkConfiguration {
},
max_parallel_downloads: 5,
allow_non_globals_in_dht: false,
kademlia_disjoint_query_paths: false,
}
}