From 11bba01b93479e87ad3e4786d60657d305568f14 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Thu, 6 Feb 2020 12:15:52 +0200 Subject: [PATCH] Do not truncate the list of peers for propagation The vector obtained from Topology::view is sorted by node ID, so truncations make the network biased toward nodes with low IDs. Let the client connections rotate "naturally", allowing some churn. A limit on the view size should be implemented in Poldercast: https://github.com/primetype/poldercast/issues/6 --- jormungandr/src/network/mod.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/jormungandr/src/network/mod.rs b/jormungandr/src/network/mod.rs index c27f3da8c5..2b1eb550b3 100644 --- a/jormungandr/src/network/mod.rs +++ b/jormungandr/src/network/mod.rs @@ -351,7 +351,6 @@ fn handle_propagation_msg( // the item. send_to_peers.then(move |res| { if let Err(mut unreached_nodes) = res { - unreached_nodes.truncate(state.config.max_client_connections); debug!( state.logger(), "will try to connect to {} of the peers not immediately reachable for propagation", @@ -418,7 +417,6 @@ fn send_gossip(state: GlobalStateR, channels: Channels) -> impl Future