Skip to content

Commit

Permalink
Improve peer performance for NAT'd nodes (#5345)
Browse files Browse the repository at this point in the history
* Merge latest unstable

* Reduce diff

* Reduce logic, discover up to max peers

* Peer discovery for Natd peers
  • Loading branch information
AgeManning authored Mar 7, 2024
1 parent 84a902a commit de91c77
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions beacon_node/lighthouse_network/src/peer_manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -880,8 +880,7 @@ impl<TSpec: EthSpec> PeerManager<TSpec> {
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()
{
Expand Down

0 comments on commit de91c77

Please sign in to comment.