diff --git a/zebra-network/src/peer_set/initialize.rs b/zebra-network/src/peer_set/initialize.rs index 6822fc25..1e0feb66 100644 --- a/zebra-network/src/peer_set/initialize.rs +++ b/zebra-network/src/peer_set/initialize.rs @@ -260,14 +260,34 @@ where } Err((addr, ref e)) => { handshake_error_total += 1; + // this is verbose, but it's better than just hanging with no output when there are errors - info!( - ?handshake_success_total, - ?handshake_error_total, - ?addr, - ?e, - "an initial peer connection failed" - ); + let mut expected_error = false; + if let Some(io_error) = e.downcast_ref::() { + // Some systems only have IPv4, or only have IPv6, + // so these errors are not particularly interesting. + if io_error.kind() == tokio::io::ErrorKind::AddrNotAvailable { + expected_error = true; + } + } + + if expected_error { + debug!( + successes = ?handshake_success_total, + errors = ?handshake_error_total, + ?addr, + ?e, + "an initial peer connection failed" + ); + } else { + info!( + successes = ?handshake_success_total, + errors = ?handshake_error_total, + ?addr, + %e, + "an initial peer connection failed" + ); + } } } diff --git a/zebra-network/src/peer_set/limit.rs b/zebra-network/src/peer_set/limit.rs index 0d2ff1af..6c2f1849 100644 --- a/zebra-network/src/peer_set/limit.rs +++ b/zebra-network/src/peer_set/limit.rs @@ -105,7 +105,7 @@ impl ConnectionTracker { fn new(counter: &mut ActiveConnectionCounter) -> Self { counter.count += 1; - info!(open_connections = ?counter.count, "opening a new peer connection"); + debug!(open_connections = ?counter.count, "opening a new peer connection"); Self { close_notification_tx: counter.close_notification_tx.clone(), diff --git a/zebra-state/src/service.rs b/zebra-state/src/service.rs index ab3713c8..1ee750f4 100644 --- a/zebra-state/src/service.rs +++ b/zebra-state/src/service.rs @@ -445,7 +445,7 @@ impl StateService { let chain_tip_height = if let Some((height, _)) = self.best_tip() { height } else { - tracing::info!( + tracing::debug!( response_len = ?0, "responding to peer GetBlocks or GetHeaders with empty state", ); diff --git a/zebrad/src/components/inbound.rs b/zebrad/src/components/inbound.rs index d5f2d393..f06b3f39 100644 --- a/zebrad/src/components/inbound.rs +++ b/zebrad/src/components/inbound.rs @@ -372,7 +372,8 @@ impl Service for Inbound { .map_ok(|_resp| zn::Response::Nil) .boxed() } else { - info!( + // Peers send a lot of these when we first connect to them. + debug!( "ignoring `AdvertiseTransactionIds` request from remote peer during network setup" ); async { Ok(zn::Response::Nil) }.boxed() @@ -385,7 +386,8 @@ impl Service for Inbound { { block_downloads.download_and_verify(hash); } else { - info!( + // Peers send a lot of these when we first connect to them. + debug!( ?hash, "ignoring `AdvertiseBlock` request from remote peer during network setup" );