From c9596fcf0ee3a17bfb1df48e23ed6339c3791457 Mon Sep 17 00:00:00 2001 From: Age Manning Date: Sun, 13 Sep 2020 23:58:49 +0000 Subject: [PATCH] Temporary Sync Work-Around (#1615) ## Issue Addressed #1590 ## Proposed Changes This is a temporary workaround that prevents finalized chain sync from swapping chains. I'm merging this in now until the full solution is ready. --- .../network/src/sync/range_sync/chain_collection.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/beacon_node/network/src/sync/range_sync/chain_collection.rs b/beacon_node/network/src/sync/range_sync/chain_collection.rs index 86d31e636bd..3ccbb351b70 100644 --- a/beacon_node/network/src/sync/range_sync/chain_collection.rs +++ b/beacon_node/network/src/sync/range_sync/chain_collection.rs @@ -248,15 +248,17 @@ impl ChainCollection { // Check if any chains become the new syncing chain if let Some(index) = self.finalized_syncing_index() { // There is a current finalized chain syncing - let syncing_chain_peer_count = self.finalized_chains[index].peer_pool.len(); + let _syncing_chain_peer_count = self.finalized_chains[index].peer_pool.len(); // search for a chain with more peers if let Some((new_index, chain)) = self.finalized_chains .iter_mut() .enumerate() - .find(|(iter_index, chain)| { - *iter_index != index && chain.peer_pool.len() > syncing_chain_peer_count + .find(|(_iter_index, _chain)| { + false + // && *iter_index != index + // && chain.peer_pool.len() > syncing_chain_peer_count }) { // A chain has more peers. Swap the syncing chain