diff --git a/beacon_node/lighthouse_network/src/discovery/mod.rs b/beacon_node/lighthouse_network/src/discovery/mod.rs index 68e085683..44b95b985 100644 --- a/beacon_node/lighthouse_network/src/discovery/mod.rs +++ b/beacon_node/lighthouse_network/src/discovery/mod.rs @@ -959,12 +959,24 @@ impl NetworkBehaviour for Discovery { &mut self, peer_id: Option, _handler: Self::ProtocolsHandler, - _error: &DialError, + error: &DialError, ) { if let Some(peer_id) = peer_id { - // set peer as disconnected in discovery DHT - debug!(self.log, "Marking peer disconnected in DHT"; "peer_id" => %peer_id); - self.disconnect_peer(&peer_id); + match error { + DialError::Banned + | DialError::LocalPeerId + | DialError::InvalidPeerId + | DialError::ConnectionIo(_) + | DialError::NoAddresses + | DialError::Transport(_) => { + // set peer as disconnected in discovery DHT + debug!(self.log, "Marking peer disconnected in DHT"; "peer_id" => %peer_id); + self.disconnect_peer(&peer_id); + } + DialError::ConnectionLimit(_) + | DialError::DialPeerConditionFalse(_) + | DialError::Aborted => {} + } } } diff --git a/beacon_node/lighthouse_network/src/peer_manager/mod.rs b/beacon_node/lighthouse_network/src/peer_manager/mod.rs index decc1ccd1..fa33ea9ff 100644 --- a/beacon_node/lighthouse_network/src/peer_manager/mod.rs +++ b/beacon_node/lighthouse_network/src/peer_manager/mod.rs @@ -46,7 +46,7 @@ pub const MIN_OUTBOUND_ONLY_FACTOR: f32 = 0.3; /// requiring subnet peers. More specifically, if our target peer limit is 50, and our excess peer /// limit is 55, and we are at 55 peers, the following parameter provisions a few more slots of /// dialing priority peers we need for validator duties. -pub const PRIORITY_PEER_EXCESS: f32 = 0.05; +pub const PRIORITY_PEER_EXCESS: f32 = 0.1; /// The main struct that handles peer's reputation and connection status. pub struct PeerManager {