Disable Kademlia random walk when --reserved-nodes is passed (#7999)

* Disable Kademlia random walk when --reserved-nodes is passed

* Update client/network/src/discovery.rs

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
This commit is contained in:
Pierre Krieger
2021-02-02 14:52:09 +01:00
committed by GitHub
parent de4cf4c380
commit eeff8f3204
4 changed files with 68 additions and 35 deletions
+10 -2
View File
@@ -408,10 +408,17 @@ pub struct NetworkConfiguration {
pub transport: TransportConfig,
/// Maximum number of peers to ask the same blocks in parallel.
pub max_parallel_downloads: u32,
/// True if Kademlia random discovery should be enabled.
///
/// If true, the node will automatically randomly walk the DHT in order to find new peers.
pub enable_dht_random_walk: bool,
/// 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.
/// 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,
/// Size of Yamux receive window of all substreams. `None` for the default (256kiB).
@@ -461,6 +468,7 @@ impl NetworkConfiguration {
wasm_external_transport: None,
},
max_parallel_downloads: 5,
enable_dht_random_walk: true,
allow_non_globals_in_dht: false,
kademlia_disjoint_query_paths: false,
yamux_window_size: None,