Skip to content

Commit

Permalink
aggressively printing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
divagant-martian committed Jul 25, 2023
1 parent 63d85ed commit 1232e6e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions beacon_node/lighthouse_network/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,19 @@ impl<AppReqId: ReqId, TSpec: EthSpec> Network<AppReqId, TSpec> {
error,
connection_id: _,
} => {
debug!(self.log, "Failed incoming connection"; "our_addr" => %local_addr, "from" => %send_back_addr, "error" => %error);
let error_repr = match error {
libp2p::swarm::ListenError::Aborted => "incoming connection aborted".to_string(),
libp2p::swarm::ListenError::WrongPeerId { obtained, endpoint } => format!("wrong peer id, obtained {obtained}, endpoint {endpoint:?}"),
libp2p::swarm::ListenError::LocalPeerId { endpoint } => format!("dialing local peer id {endpoint:?}"),
libp2p::swarm::ListenError::Denied { cause } => format!("connection was denied with cause {cause}"),
libp2p::swarm::ListenError::Transport(t) => {
match t {
libp2p::TransportError::MultiaddrNotSupported(m) => format!("transport error: multiaddr not supported: {m}"),
libp2p::TransportError::Other(e) => format!("transport error: other: {e}"),
}
},
};
debug!(self.log, "Failed incoming connection"; "our_addr" => %local_addr, "from" => %send_back_addr, "error" => error_repr);
None
}
SwarmEvent::OutgoingConnectionError {
Expand Down Expand Up @@ -1539,4 +1551,4 @@ impl<AppReqId: ReqId, TSpec: EthSpec> Network<AppReqId, TSpec> {
pub async fn next_event(&mut self) -> NetworkEvent<AppReqId, TSpec> {
futures::future::poll_fn(|cx| self.poll_network(cx)).await
}
}
}

0 comments on commit 1232e6e

Please sign in to comment.