From de91c77cb25efee5f923aea6c0225926cdef4f3d Mon Sep 17 00:00:00 2001 From: Age Manning Date: Thu, 7 Mar 2024 23:32:30 +1100 Subject: [PATCH] Improve peer performance for NAT'd nodes (#5345) * Merge latest unstable * Reduce diff * Reduce logic, discover up to max peers * Peer discovery for Natd peers --- beacon_node/lighthouse_network/src/peer_manager/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/beacon_node/lighthouse_network/src/peer_manager/mod.rs b/beacon_node/lighthouse_network/src/peer_manager/mod.rs index 0aaede3d4..92f876ee0 100644 --- a/beacon_node/lighthouse_network/src/peer_manager/mod.rs +++ b/beacon_node/lighthouse_network/src/peer_manager/mod.rs @@ -880,8 +880,7 @@ impl PeerManager { let outbound_only_peer_count = self.network_globals.connected_outbound_only_peers(); let wanted_peers = if peer_count < self.target_peers.saturating_sub(dialing_peers) { // We need more peers in general. - // Note: The maximum discovery query is bounded by `Discovery`. - self.target_peers.saturating_sub(dialing_peers) - peer_count + self.max_peers().saturating_sub(dialing_peers) - peer_count } else if outbound_only_peer_count < self.min_outbound_only_peers() && peer_count < self.max_outbound_dialing_peers() {