Skip to content

Commit

Permalink
Temporary Sync Work-Around (#1615)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
AgeManning committed Sep 13, 2020
1 parent c6abc56 commit c9596fc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions beacon_node/network/src/sync/range_sync/chain_collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,17 @@ impl<T: BeaconChainTypes> ChainCollection<T> {
// 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
Expand Down

0 comments on commit c9596fc

Please sign in to comment.