Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
Improve Logging
Merged fintohaps opened 3 months ago

This patch evaluates the radicle-node family of crates that emit logs.

They are each evaluated for their use of warn! and error! and whether these can be downgraded to a lower log level.

This will make the logs of the running radicle-node less busy and work towards surfacing only interesting information.

22 files changed +150 -167 d860ec15 6d1abd28
modified crates/radicle-fetch/src/git/packfile.rs
@@ -26,7 +26,7 @@ impl Keepfile {
impl Drop for Keepfile {
    fn drop(&mut self) {
        if let Err(e) = fs::remove_file(&self.path) {
-
            log::warn!(target: "fetch", "Failed to remove {:?}: {e}", self.path);
+
            log::warn!("Failed to remove {:?}: {e}", self.path);
        }
    }
}
modified crates/radicle-fetch/src/lib.rs
@@ -88,7 +88,6 @@ where
        .map_err(Error::Protocol);

    log::debug!(
-
        target: "fetch",
        "Finished pull of {} ({}ms)",
        handle.repository().id(),
        start.elapsed().as_millis()
@@ -123,16 +122,10 @@ where

    match &result {
        Ok(_) => {
-
            log::debug!(
-
                target: "fetch",
-
                "Finished clone of {rid} from {remote} ({elapsed}ms)",
-
            );
+
            log::debug!("Finished clone of {rid} from {remote} ({elapsed}ms)",);
        }
        Err(e) => {
-
            log::debug!(
-
                target: "fetch",
-
                "Clone of {rid} from {remote} failed with '{e}' ({elapsed}ms)",
-
            );
+
            log::debug!("Clone of {rid} from {remote} failed with '{e}' ({elapsed}ms)",);
        }
    }
    result
@@ -150,16 +143,11 @@ where
}

fn handle_handshake_err(err: handshake::Error) -> HandshakeError {
-
    let err = match err {
+
    match err {
        handshake::Error::Transport(error) => match error {
            gix_transport::client::Error::Io(error) => HandshakeError::Io(error),
            err => HandshakeError::Gix(handshake::Error::Transport(err)),
        },
-
        err => {
-
            log::warn!(target: "fetch", "Failed to perform handshake: {err}");
-
            HandshakeError::Gix(err)
-
        }
-
    };
-
    log::warn!(target: "fetch", "{err}");
-
    err
+
        err => HandshakeError::Gix(err),
+
    }
}
modified crates/radicle-fetch/src/policy.rs
@@ -20,7 +20,7 @@ impl Allowed {
            .map_err(|err| error::Policy::FailedPolicy { rid, err })?;
        match entry.policy {
            SeedingPolicy::Block => {
-
                log::error!(target: "fetch", "Attempted to fetch non-seeded repo {rid}");
+
                log::info!("Attempted to fetch non-seeded repo {rid}");
                Err(error::Policy::BlockedPolicy { rid })
            }
            SeedingPolicy::Allow { scope: Scope::All } => Ok(Self::All),
@@ -37,7 +37,7 @@ impl Allowed {
                    let node = match node {
                        Ok(policy) => policy,
                        Err(err) => {
-
                            log::error!(target: "fetch", "Failed to read follow policy for {rid}: {err}");
+
                            log::debug!("Failed to read follow policy for {rid}: {err}");
                            continue;
                        }
                    };
@@ -81,7 +81,7 @@ impl BlockList {
            let entry = match entry {
                Ok(entry) => entry,
                Err(err) => {
-
                    log::error!(target: "fetch", "Failed to read follow policy: {err}");
+
                    log::debug!("Failed to read follow policy: {err}");
                    continue;
                }
            };
modified crates/radicle-fetch/src/state.rs
@@ -231,7 +231,7 @@ impl FetchState {
                .collect::<Vec<_>>(),
            None => vec![],
        };
-
        log::trace!(target: "fetch", "Received refs {refs:?}");
+
        log::trace!("Received refs {refs:?}");
        step.pre_validate(&refs)?;

        let wants_haves = step.wants_haves(handle.repository(), &refs)?;
@@ -242,7 +242,7 @@ impl FetchState {
                    .fetch(wants_haves, handle.interrupt.clone(), handshake)?;
            self.keepfiles.extend(keepfile);
        } else {
-
            log::trace!(target: "fetch", "Nothing to fetch")
+
            log::trace!("Nothing to fetch")
        };

        let mut fetched = BTreeSet::new();
@@ -308,7 +308,7 @@ impl FetchState {
                    blocked: handle.blocked.clone(),
                    limit: limit.special,
                };
-
                log::trace!(target: "fetch", "{sigrefs_at:?}");
+
                log::trace!("{sigrefs_at:?}");
                self.run_stage(handle, handshake, &sigrefs_at)?;
                let remotes = refs_at.iter().map(|r| &r.remote);

@@ -317,7 +317,7 @@ impl FetchState {
            }
            None => {
                let followed = handle.allowed();
-
                log::trace!(target: "fetch", "Followed nodes {followed:?}");
+
                log::trace!("Followed nodes {followed:?}");
                let special_refs = stage::SpecialRefs {
                    blocked: handle.blocked.clone(),
                    remote,
@@ -326,7 +326,7 @@ impl FetchState {
                    threshold,
                    limit: limit.special,
                };
-
                log::trace!(target: "fetch", "{special_refs:?}");
+
                log::trace!("{special_refs:?}");
                let fetched = self.run_stage(handle, handshake, &special_refs)?;

                let signed_refs = sigrefs::RemoteRefs::load(
@@ -378,7 +378,7 @@ impl FetchState {
                limit: limit.special,
            },
        )?;
-
        log::debug!(target: "fetch", "Fetched rad/id ({}ms)", start.elapsed().as_millis());
+
        log::debug!("Fetched rad/id ({}ms)", start.elapsed().as_millis());

        // N.b. The error case here should not happen. In the case of
        // a `clone` we have asked for refs/rad/id and ensured it was
@@ -399,7 +399,7 @@ impl FetchState {
            .map(|did| PublicKey::from(*did))
            .collect::<BTreeSet<_>>();

-
        log::trace!(target: "fetch", "Identity delegates {delegates:?}");
+
        log::trace!("Identity delegates {delegates:?}");

        // The local peer does not need to count towards the threshold
        // since they must be valid already.
@@ -418,7 +418,6 @@ impl FetchState {
            refs_at,
        )?;
        log::debug!(
-
            target: "fetch",
            "Fetched data for {} remote(s) ({}ms)",
            signed_refs.len(),
            start.elapsed().as_millis()
@@ -431,7 +430,6 @@ impl FetchState {
        };
        self.run_stage(handle, handshake, &data_refs)?;
        log::debug!(
-
            target: "fetch",
            "Fetched data refs for {} remotes ({}ms)",
            data_refs.remotes.len(),
            start.elapsed().as_millis()
@@ -441,9 +439,9 @@ impl FetchState {
        // We're finished fetching on this side, and all that's left
        // is validation.
        match handle.transport.done() {
-
            Ok(()) => log::debug!(target: "fetch", "Sent done signal to remote {remote}"),
+
            Ok(()) => log::debug!("Sent done signal to remote {remote}"),
            Err(err) => {
-
                log::warn!(target: "fetch", "Attempted to send done to remote {remote}: {err}")
+
                log::debug!("Failed to signal EOF to {remote}: {err}")
            }
        }

@@ -472,7 +470,7 @@ impl FetchState {
        // private function.
        for remote in signed_refs.keys() {
            if handle.is_blocked(remote) {
-
                log::trace!(target: "fetch", "Skipping blocked remote {remote}");
+
                log::trace!("Skipping blocked remote {remote}");
                continue;
            }

@@ -480,12 +478,12 @@ impl FetchState {
                .load(&self.as_cached(handle))?;
            match remote {
                sigrefs::DelegateStatus::NonDelegate { remote, data: None } => {
-
                    log::debug!(target: "fetch", "Pruning non-delegate {remote} tips, missing 'rad/sigrefs'");
+
                    log::debug!("Pruning non-delegate {remote} tips, missing 'rad/sigrefs'");
                    failures.push(sigrefs::Validation::MissingRadSigRefs(remote));
                    self.prune(&remote);
                }
                sigrefs::DelegateStatus::Delegate { remote, data: None } => {
-
                    log::warn!(target: "fetch", "Pruning delegate {remote} tips, missing 'rad/sigrefs'");
+
                    log::debug!("Pruning delegate {remote} tips, missing 'rad/sigrefs'");
                    failures.push(sigrefs::Validation::MissingRadSigRefs(remote));
                    self.prune(&remote);
                    // This delegate has removed their `rad/sigrefs`.
@@ -518,7 +516,6 @@ impl FetchState {
                    let cache = self.as_cached(handle);
                    if let Some(warns) = sigrefs::validate(&cache, sigrefs)?.as_mut() {
                        log::debug!(
-
                            target: "fetch",
                            "Pruning non-delegate {remote} tips, due to validation failures"
                        );
                        self.prune(&remote);
@@ -536,7 +533,10 @@ impl FetchState {
                    {
                        let ancestry = repository::ancestry(handle.repository(), at, sigrefs.at)?;
                        if matches!(ancestry, repository::Ancestry::Behind) {
-
                            log::trace!(target: "fetch", "Advertised `rad/sigrefs` {} is behind {at} for {remote}", sigrefs.at);
+
                            log::trace!(
+
                                "Advertised `rad/sigrefs` {} is behind {at} for {remote}",
+
                                sigrefs.at
+
                            );
                            self.prune(&remote);
                            continue;
                        } else if matches!(ancestry, repository::Ancestry::Diverged) {
@@ -552,7 +552,7 @@ impl FetchState {
                    let mut fails =
                        sigrefs::validate(&cache, sigrefs)?.unwrap_or(Validations::default());
                    if !fails.is_empty() {
-
                        log::warn!(target: "fetch", "Pruning delegate {remote} tips, due to validation failures");
+
                        log::debug!("Pruning delegate {remote} tips, due to validation failures");
                        self.prune(&remote);
                        valid_delegates.remove(&remote);
                        failed_delegates.insert(remote);
@@ -565,7 +565,6 @@ impl FetchState {
            }
        }
        log::debug!(
-
            target: "fetch",
            "Validated {} remote(s) ({}ms)",
            remotes.len(),
            start.elapsed().as_millis()
@@ -581,7 +580,7 @@ impl FetchState {
                    .into_values()
                    .flat_map(|ups| ups.into_iter()),
            )?;
-
            log::debug!(target: "fetch", "Applied updates ({}ms)", start.elapsed().as_millis());
+
            log::debug!("Applied updates ({}ms)", start.elapsed().as_millis());
            Ok(FetchResult::Success {
                applied,
                remotes,
@@ -589,7 +588,6 @@ impl FetchState {
            })
        } else {
            log::debug!(
-
                target: "fetch",
                "Fetch failed: {} failure(s) ({}ms)",
                failures.len(),
                start.elapsed().as_millis()
modified crates/radicle-fetch/src/transport.rs
@@ -91,7 +91,7 @@ where
    /// Perform the handshake with the server side.
    #[allow(clippy::result_large_err)]
    pub(crate) fn handshake(&mut self) -> Result<handshake::Outcome, handshake::Error> {
-
        log::trace!(target: "fetch", "Performing handshake for {}", self.repo);
+
        log::trace!("Performing handshake for {}", self.repo);
        let (read, write) = self.stream.open();
        gix_protocol::fetch::handshake(
            &mut Connection::new(read, write, self.repo.clone()),
@@ -129,7 +129,6 @@ where
        handshake: &handshake::Outcome,
    ) -> Result<Option<Keepfile>, Error> {
        log::trace!(
-
            target: "fetch",
            "Running fetch wants={:?}, haves={:?}",
            wants_haves.wants,
            wants_haves.haves
@@ -328,8 +327,8 @@ fn agent_name() -> String {
        Ok(version) => version,
        Err(err) => {
            use radicle::git::VERSION_REQUIRED;
-
            log::warn!(target: "fetch", "The git version could not be determined: {err}");
-
            log::warn!(target: "fetch", "Pretending that we are on git version {VERSION_REQUIRED}.");
+
            log::debug!("The git version could not be determined: {err}");
+
            log::debug!("Pretending that we are on git version {VERSION_REQUIRED}.");
            VERSION_REQUIRED
        }
    };
modified crates/radicle-fetch/src/transport/fetch.rs
@@ -159,7 +159,7 @@ where
    R: io::Read,
    W: io::Write,
{
-
    log::trace!(target: "fetch", "Performing fetch");
+
    log::trace!("Performing fetch");

    if wants_haves.wants.is_empty() {
        return Err(Error::ReadRemainingBytes(io::Error::new(
@@ -214,6 +214,6 @@ where
        .and_then(packfile::Keepfile::new);
    out.pack = Some(pack_out);

-
    log::trace!(target: "fetch", "fetched refs: {:?}", out.refs);
+
    log::trace!("fetched refs: {:?}", out.refs);
    Ok(out)
}
modified crates/radicle-fetch/src/transport/ls_refs.rs
@@ -38,7 +38,7 @@ where
    R: io::Read,
    W: io::Write,
{
-
    log::trace!(target: "fetch", "Performing ls-refs: {:?}", config.prefixes);
+
    log::trace!("Performing ls-refs: {:?}", config.prefixes);
    let handshake::Outcome {
        server_protocol_version: protocol,
        capabilities,
modified crates/radicle-node/src/control.rs
@@ -50,7 +50,7 @@ where

                thread::spawn(&nid, "control", move || {
                    if let Err((e, mut stream)) = command(stream, handle) {
-
                        log::error!(target: "control", "Command returned error: {e}");
+
                        log::debug!(target: "control", "Command returned error: {e}");

                        CommandResult::error(e).to_writer(&mut stream).ok();

@@ -59,7 +59,7 @@ where
                    }
                });
            }
-
            Err(e) => log::error!(target: "control", "Failed to accept incoming connection: {e}"),
+
            Err(e) => log::warn!(target: "control", "Failed to accept incoming connection: {e}"),
        }
    }
    log::debug!(target: "control", "Exiting control loop..");
modified crates/radicle-node/src/main.rs
@@ -327,7 +327,7 @@ fn execute(options: Options) -> Result<(), ExecutionError> {
    #[cfg(windows)]
    let signals = {
        let (_, signals) = chan::bounded(1);
-
        log::warn!(target: "node", "Signal handlers not installed.");
+
        log::info!(target: "node", "No signal handlers were installed, because this is not available on Windows.");
        signals
    };

modified crates/radicle-node/src/reactor.rs
@@ -399,7 +399,7 @@ impl<H: ReactionHandler> Runtime<H> {
            }

            if let Err(err) = res {
-
                log::error!(target: "reactor", "Error during polling: {err}");
+
                log::warn!(target: "reactor", "Failure during polling: {err}");
                self.service.handle_error(Error::Poll(err));
            }

@@ -483,7 +483,7 @@ impl<H: ReactionHandler> Runtime<H> {
                    deregistered.push(token);
                }
            } else if !deregistered.contains(&token) {
-
                log::warn!(target: "reactor", token=token.0; "Event from unknown token {}: {:?}", token.0, event);
+
                log::debug!(target: "reactor", token=token.0; "Event from unknown token {}: {:?}", token.0, event);
            }
        }

@@ -497,7 +497,7 @@ impl<H: ReactionHandler> Runtime<H> {
            // Deadlock may happen here if the service will generate events over and over
            // in the handle_* calls we may never get out of this loop
            if let Err(err) = self.handle_action(action, instant) {
-
                log::error!(target: "reactor", "Error: {err}");
+
                log::warn!(target: "reactor", "Failure: {err}");
                self.service.handle_error(err);
            }
        }
@@ -558,7 +558,7 @@ impl<H: ReactionHandler> Runtime<H> {
                        }
                    }
                } else {
-
                    log::error!(target: "reactor", token=token.0; "No transport with token {token:?} is known!");
+
                    log::debug!(target: "reactor", token=token.0; "No transport with token {token:?} is known!");
                }
            }
            Action::SetTimer(duration) => {
@@ -576,12 +576,12 @@ impl<H: ReactionHandler> Runtime<H> {

    fn deregister_listener(&mut self, token: Token) -> Option<H::Listener> {
        let Some(mut source) = self.listeners.remove(&token) else {
-
            log::warn!(target: "reactor", token=token.0; "Deregistering non-registered listener with token {}", token.0);
+
            log::debug!(target: "reactor", token=token.0; "Deregistering non-registered listener with token {}", token.0);
            return None;
        };

        if let Err(err) = self.poll.registry().deregister(&mut source) {
-
            log::warn!(target: "reactor", token=token.0; "Failed to deregister listener with token {} from mio: {err}", token.0);
+
            log::debug!(target: "reactor", token=token.0; "Failed to deregister listener with token {} from mio: {err}", token.0);
        }

        Some(source)
@@ -589,12 +589,12 @@ impl<H: ReactionHandler> Runtime<H> {

    fn deregister_transport(&mut self, token: Token) -> Option<H::Transport> {
        let Some(mut source) = self.transports.remove(&token) else {
-
            log::warn!(target: "reactor", token=token.0; "Deregistering non-registered transport with token {}", token.0);
+
            log::debug!(target: "reactor", token=token.0; "Deregistering non-registered transport with token {}", token.0);
            return None;
        };

        if let Err(err) = self.poll.registry().deregister(&mut source) {
-
            log::warn!(target: "reactor", token=token.0; "Failed to deregister transport with token {} from mio: {err}", token.0);
+
            log::debug!(target: "reactor", token=token.0; "Failed to deregister transport with token {} from mio: {err}", token.0);
        }

        Some(source)
modified crates/radicle-node/src/reactor/transport.rs
@@ -148,7 +148,7 @@ impl<S: Session> Transport<S> {

    fn handle_io(&mut self, interest: Interest) -> Option<SessionEvent<S>> {
        if self.state == TransportState::Terminated {
-
            log::warn!(target: "transport", "Transport {self} is terminated, ignoring I/O event");
+
            log::debug!(target: "transport", "Transport {self} is terminated, ignoring I/O event");
            return None;
        }

@@ -206,7 +206,7 @@ impl<S: Session> Transport<S> {
        }
        match self.flush() {
            Ok(_) => None,
-
            // In this case, the write could not complete. Leave `needs_flush` set
+
            // In this case, the write could not complete. Leave `write_intent` set
            // to be notified when the socket is ready to write again.
            Err(err)
                if matches!(
@@ -217,7 +217,7 @@ impl<S: Session> Transport<S> {
                        | io::ErrorKind::Interrupted
                ) =>
            {
-
                log::warn!(target: "transport", "Resource {} was not able to consume any data even though it has announced its write readiness", self.display());
+
                log::debug!(target: "transport", "Resource {} was not able to consume any data even though it has announced its write readiness", self.display());
                self.write_intent = true;
                None
            }
@@ -241,7 +241,7 @@ impl<S: Session> Transport<S> {
                // when there's data on the socket. We leave it here in case external
                // conditions change.

-
                log::warn!(target: "transport",
+
                log::trace!(target: "transport",
                    "WOULD_BLOCK on resource which had read intent - probably normal thing to happen"
                );
                None
@@ -261,11 +261,11 @@ impl<S: Session> Transport<S> {
                    | io::ErrorKind::OutOfMemory
                    | io::ErrorKind::WriteZero
                    | io::ErrorKind::Interrupted => {
-
                        log::warn!(target: "transport", "Resource {} kernel buffer is full (system message is '{err}')", self.display());
+
                        log::trace!(target: "transport", "Resource {} kernel buffer is full (system message is '{err}')", self.display());
                        Ok(0)
                    },
                    _ => {
-
                        log::error!(target: "transport", "Resource {} failed write operation with message '{err}'", self.display());
+
                        log::warn!(target: "transport", "Resource {} failed write operation with message '{err}'", self.display());
                        Err(err)
                    },
                }
modified crates/radicle-node/src/wire.rs
@@ -247,7 +247,7 @@ impl Peers {

    fn insert(&mut self, token: Token, peer: Peer) {
        if self.0.insert(token, peer).is_some() {
-
            log::warn!(target: "wire", token=token.0; "Replacing existing peer");
+
            log::debug!(target: "wire", token=token.0; "Replacing existing peer");
        }
    }

@@ -361,7 +361,7 @@ where
            }
            Entry::Occupied(mut e) => match e.get_mut() {
                Peer::Disconnecting { nid, link, .. } => {
-
                    log::error!(target: "wire", token=token.0; "Peer is already disconnecting");
+
                    log::debug!(target: "wire", token=token.0; "Peer is already disconnecting");

                    nid.map(|n| (n, *link))
                }
@@ -395,7 +395,7 @@ where

        let nid = task.remote;
        let Some((fd, peer)) = self.peers.lookup_mut(&nid) else {
-
            log::warn!(target: "wire", "Peer {nid} not found; ignoring fetch result");
+
            log::debug!(target: "wire", "Peer {nid} not found; ignoring fetch result");
            return;
        };

@@ -420,7 +420,7 @@ where
        } else {
            // If the peer disconnected, we'll get here, but we still want to let the service know
            // about the fetch result, so we don't return here.
-
            log::warn!(target: "wire", "Peer {nid} is not connected; ignoring fetch result");
+
            log::debug!(target: "wire", "Peer {nid} is not connected; ignoring fetch result");
            return;
        };

@@ -443,11 +443,11 @@ where

    fn flush(&mut self, remote: NodeId, stream: StreamId) {
        let Some((fd, peer)) = self.peers.lookup_mut(&remote) else {
-
            log::warn!(target: "wire", "Peer {remote} is not known; ignoring flush");
+
            log::debug!(target: "wire", "Peer {remote} is not known; ignoring flush");
            return;
        };
        let Peer::Connected { streams, link, .. } = peer else {
-
            log::warn!(target: "wire", "Peer {remote} is not connected; ignoring flush");
+
            log::debug!(target: "wire", "Peer {remote} is not connected; ignoring flush");
            return;
        };
        let Some(s) = streams.get_mut(&stream) else {
@@ -527,7 +527,7 @@ where
            Ok((connection, peer)) => {
                let remote = NetAddr::from(peer);
                let InetHost::Ip(ip) = remote.host else {
-
                    log::error!(target: "wire", "Unexpected host type for inbound connection {remote}; dropping..");
+
                    log::debug!(target: "wire", "Unexpected host type for inbound connection {remote}; dropping..");
                    drop(connection);

                    return;
@@ -551,7 +551,7 @@ where
                let transport = match Transport::with_session(session, Link::Inbound) {
                    Ok(transport) => transport,
                    Err(err) => {
-
                        log::error!(target: "wire", "Failed to create transport for accepted connection: {err}");
+
                        log::warn!(target: "wire", "Failed to create transport for accepted connection: {err}");
                        return;
                    }
                };
@@ -581,7 +581,7 @@ where
        } else if self.inbound.contains(&token) {
            log::debug!(target: "wire", token=token.0; "Inbound peer resource registered");
        } else {
-
            log::warn!(target: "wire", token=token.0; "Unknown peer registered");
+
            log::debug!(target: "wire", token=token.0; "Unknown peer registered");
        }
    }

@@ -592,7 +592,7 @@ where
                let nid: NodeId = state.remote_static_key.unwrap();
                // Make sure we don't try to connect to ourselves by mistake.
                if &nid == self.signer.public_key() {
-
                    log::error!(target: "wire", "Self-connection detected, disconnecting..");
+
                    log::warn!(target: "wire", "Self-connection detected, disconnecting..");
                    self.disconnect(token, DisconnectReason::SelfConnection);

                    return;
@@ -606,7 +606,7 @@ where
                    assert_eq!(nid, peer.nid);
                    (peer.addr, Link::Outbound)
                } else {
-
                    log::error!(target: "wire", token=token.0; "Session for {nid} not found");
+
                    log::debug!(target: "wire", token=token.0; "Session for {nid} not found");
                    return;
                };
                log::debug!(
@@ -664,14 +664,14 @@ where
                            (Outbound, Outbound, _) => token.max(c_token),
                        };

-
                        log::warn!(
+
                        log::trace!(
                            target: "wire", "Established session with token {} conflicts with existing session with token {} for {nid}. Disconnecting session with token {}.", token.0, c_token.0, close.0
                        );
                        disconnect.push(close);
                    }
                }
                for id in &disconnect {
-
                    log::warn!(
+
                    log::info!(
                        target: "wire", token=token.0; "Closing conflicting session with {nid}.."
                    );
                    // Disconnect and return the associated NID of the peer, if available.
@@ -701,8 +701,8 @@ where
                    metrics.received_bytes += data.len();

                    if inbox.input(&data).is_err() {
-
                        log::error!(target: "wire", "Maximum inbox size ({MAX_INBOX_SIZE}) reached for peer {nid}");
-
                        log::error!(target: "wire", "Unable to process messages fast enough for peer {nid}; disconnecting..");
+
                        log::warn!(target: "wire", "Maximum inbox size ({MAX_INBOX_SIZE}) reached for peer {nid}");
+
                        log::warn!(target: "wire", "Unable to process messages fast enough for peer {nid}; disconnecting..");
                        self.disconnect(
                            token,
                            DisconnectReason::Session(session::Error::Misbehavior),
@@ -726,7 +726,7 @@ where
                                    ChannelsConfig::new(FETCH_TIMEOUT)
                                        .with_reader_limit(reader_limit),
                                ) else {
-
                                    log::warn!(target: "wire", "Peer attempted to open already-open stream stream {stream}");
+
                                    log::debug!(target: "wire", "Peer attempted to open already-open stream stream {stream}");
                                    continue;
                                };

@@ -739,7 +739,7 @@ where
                                    channels,
                                };
                                if let Err(e) = self.worker.try_send(task) {
-
                                    log::error!(
+
                                    log::warn!(
                                        target: "wire",
                                        "Worker pool failed to accept incoming fetch request: {e}"
                                    );
@@ -753,7 +753,7 @@ where
                                    log::debug!(target: "wire", "Received `end-of-file` on stream {stream} from {nid}");

                                    if s.channels.send(ChannelEvent::Eof).is_err() {
-
                                        log::error!(target: "wire", "Worker is disconnected; cannot send `EOF`");
+
                                        log::debug!(target: "wire", "Worker is disconnected; cannot send `EOF`");
                                    }
                                } else {
                                    log::debug!(target: "wire", "Ignoring frame on closed or unknown stream {stream}");
@@ -790,7 +790,7 @@ where
                                    metrics.received_git_bytes += data.len();

                                    if s.channels.send(ChannelEvent::Data(data)).is_err() {
-
                                        log::error!(target: "wire", "Worker is disconnected; cannot send data");
+
                                        log::warn!(target: "wire", "Worker is disconnected; cannot send data");
                                    }
                                } else {
                                    log::debug!(target: "wire", "Ignoring frame on closed or unknown stream {stream}");
@@ -801,7 +801,7 @@ where
                                break;
                            }
                            Err(e) => {
-
                                log::error!(target: "wire", "Invalid gossip message from {nid}: {e}");
+
                                log::warn!(target: "wire", "Invalid gossip message from {nid}: {e}");

                                if !inbox.is_empty() {
                                    log::debug!(target: "wire", "Dropping read buffer for {nid} with {} bytes", inbox.len());
@@ -815,7 +815,7 @@ where
                        }
                    }
                } else {
-
                    log::warn!(target: "wire", token=token.0; "Dropping message from unconnected peer");
+
                    log::debug!(target: "wire", token=token.0; "Dropping message from unconnected peer");
                }
            }
            SessionEvent::Terminated(err) => {
@@ -874,7 +874,7 @@ where
    }

    fn handover_listener(&mut self, token: Token, _listener: Self::Listener) {
-
        log::error!(target: "wire", token=token.0; "Listener handover is not supported");
+
        log::warn!(target: "wire", token=token.0; "Listener handover is not supported");
    }

    fn handover_transport(&mut self, token: Token, transport: Self::Transport) {
@@ -932,7 +932,7 @@ where
                            continue;
                        }
                        None => {
-
                            log::error!(target: "wire", "Dropping {} message(s) to {node_id}: unknown peer", msgs.len());
+
                            log::debug!(target: "wire", "Dropping {} message(s) to {node_id}: unknown peer", msgs.len());
                            continue;
                        }
                    };
@@ -952,7 +952,7 @@ where
                }
                Io::Connect(node_id, addr) => {
                    if self.peers.connected().any(|(_, id)| id == &node_id) {
-
                        log::error!(
+
                        log::debug!(
                            target: "wire",
                            "Attempt to connect to already connected peer {node_id}"
                        );
@@ -1006,7 +1006,7 @@ where
                            self.metrics.peer(nid).disconnects += 1;
                        }
                    } else {
-
                        log::warn!(target: "wire", "Peer {nid} is not connected: ignoring disconnect");
+
                        log::debug!(target: "wire", "Peer {nid} is not connected: ignoring disconnect");
                    }
                }
                Io::Wakeup(d) => {
@@ -1028,7 +1028,7 @@ where
                        // is in the service's i/o buffer. Since the service may not purge the
                        // buffer on disconnect, we should just ignore i/o actions that don't
                        // have a connected peer.
-
                        log::error!(target: "wire", "Peer {remote} is not connected: dropping fetch");
+
                        log::debug!(target: "wire", "Peer {remote} is not connected: dropping fetch");
                        continue;
                    };
                    let (stream, channels) =
@@ -1054,7 +1054,7 @@ where
                        );
                    }
                    if let Err(e) = self.worker.try_send(task) {
-
                        log::error!(
+
                        log::warn!(
                            target: "wire",
                            "Worker pool failed to accept outgoing fetch request: {e}"
                        );
@@ -1231,7 +1231,7 @@ mod logger {
            | NotConnected => {
                log::info!(target: "wire", "Could not establish connection to {addr}: {err}")
            }
-
            _ => log::error!(target: "wire", "Error establishing connection to {addr}: {err}"),
+
            _ => log::warn!(target: "wire", "Failed to establish connection to {addr}: {err}"),
        }
    }
}
modified crates/radicle-node/src/worker.rs
@@ -240,7 +240,7 @@ impl Worker {
            // N.b. ensure that `git gc` works in debug mode.
            debug_assert!(false, "`git gc` failed: {e}");

-
            log::warn!(target: "worker", "Failed to run `git gc`: {e}");
+
            log::debug!(target: "worker", "Failed to run `git gc`: {e}");
        }
        Ok(result)
    }
modified crates/radicle-node/src/worker/fetch.rs
@@ -96,7 +96,7 @@ impl Handle {
        };

        for rejected in result.rejected() {
-
            log::warn!(target: "worker", "Rejected update for {}", rejected.refname())
+
            log::debug!(target: "worker", "Rejected update for {}", rejected.refname())
        }

        match result {
@@ -106,7 +106,7 @@ impl Handle {
                validations,
            } => {
                for fail in validations.iter() {
-
                    log::error!(target: "worker", "Validation error: {fail}");
+
                    log::warn!(target: "worker", "Validation error: {fail}");
                }
                Err(error::Fetch::Validation {
                    threshold,
@@ -119,7 +119,7 @@ impl Handle {
                validations,
            } => {
                for warn in validations {
-
                    log::warn!(target: "worker", "Validation error: {warn}");
+
                    log::debug!(target: "worker", "Validation error: {warn}");
                }

                // N.b. We do not go through handle for this since the cloning handle
@@ -133,7 +133,7 @@ impl Handle {
                        }
                    }
                    Err(RepositoryError::Quorum(e)) => {
-
                        log::warn!(target: "worker", "Fetch could not set HEAD: {e}")
+
                        log::warn!(target: "worker", "Fetch could not set HEAD for {rid}: {e}")
                    }
                    Err(e) => return Err(e.into()),
                }
@@ -141,7 +141,7 @@ impl Handle {
                let canonical = match set_canonical_refs(&repo, &applied) {
                    Ok(updates) => updates.unwrap_or_default(),
                    Err(e) => {
-
                        log::warn!(target: "worker", "Failed to set canonical references: {e}");
+
                        log::warn!(target: "worker", "Failed to set canonical references for {rid}: {e}");
                        UpdatedCanonicalRefs::default()
                    }
                };
@@ -207,7 +207,7 @@ fn notify(
        if let RefUpdate::Skipped { .. } = update {
            // Don't notify about skipped refs.
        } else if let Err(e) = store.insert(rid, update, now) {
-
            log::error!(
+
            log::debug!(
                target: "worker",
                "Failed to update notification store for {rid}: {e}"
            );
@@ -227,8 +227,8 @@ where
        let name = r.name();
        let (namespace, qualified) = match radicle::git::parse_ref_namespaced(name) {
            Err(e) => {
-
                log::error!(target: "worker", "Git reference is invalid: {name:?}: {e}");
-
                log::warn!(target: "worker", "Skipping refs caching for fetch of {repo}");
+
                log::debug!(target: "worker", "Git reference is invalid: {name:?}: {e}");
+
                log::debug!(target: "worker", "Skipping refs caching for fetch of {repo}");
                break;
            }
            Ok((n, q)) => (n, q),
@@ -247,8 +247,8 @@ where
        };

        if let Err(e) = result {
-
            log::error!(target: "worker", "Error updating git refs cache for {name:?}: {e}");
-
            log::warn!(target: "worker", "Skipping refs caching for fetch of {repo}");
+
            log::debug!(target: "worker", "Failed to update git refs cache for {name:?}: {e}");
+
            log::debug!(target: "worker", "Skipping refs caching for fetch of {repo}");
            break;
        }
    }
@@ -326,7 +326,7 @@ where
        }
        Err(e) => {
            // Object was found, but failed to load. Fall-through.
-
            log::error!(target: "fetch", "Error loading COB {tid} from storage: {e}");
+
            log::debug!(target: "fetch", "Failed to load COB {tid} from storage: {e}");
        }
    }
    // The object has either been removed entirely from the repository,
@@ -380,7 +380,7 @@ fn set_canonical_refs(

        let canonical = match canonical.find_objects() {
            Err(err) => {
-
                log::warn!(target: "worker", "Failed to find objects for canonical computation: {err}");
+
                log::warn!(target: "worker", "Failed to find objects for canonical computation of `{name}`: {err}");
                continue;
            }
            Ok(canonical) => canonical,
@@ -390,7 +390,7 @@ fn set_canonical_refs(
            Err(err) => {
                log::warn!(
                    target: "worker",
-
                    "Failed to calculate canonical reference: {err}",
+
                    "Failed to calculate canonical reference `{name}`: {err}",
                );
                continue;
            }
modified crates/radicle-node/src/worker/upload_pack.rs
@@ -97,7 +97,7 @@ where
                    Ok(n) => {
                        let mut lock = reporter.lock().expect("FATAL: upload_pack poisoned lock");
                        if let Err(e) = lock.write_all(&buffer[..n]) {
-
                            log::warn!(target: "worker", "Error reading stdout to upload-pack reporter: {e}");
+
                            log::debug!(target: "worker", "Failed to write bugger to upload-pack reporter: {e}");
                            emitter.emit(events::UploadPack::error(header.repo, remote, e).into());
                            break;
                        }
@@ -119,7 +119,7 @@ where
                    Ok(0) => break,
                    Ok(n) => {
                        if let Err(e) = stdin.write_all(&buffer[..n]) {
-
                            log::warn!(target: "worker", "Error writing to upload-pack stdin: {e}");
+
                            log::debug!(target: "worker", "Failed to write to upload-pack stdin: {e}");
                            break;
                        }
                    }
@@ -128,7 +128,7 @@ where
                        break;
                    }
                    Err(e) if e.kind() == io::ErrorKind::TimedOut => {
-
                        log::warn!(target: "worker", "Read channel timed out for upload-pack {}", header.repo);
+
                        log::debug!(target: "worker", "Read channel timed out for upload-pack {}", header.repo);
                        // N.b. if the read timed out, ensure that the sender isn't
                        // still sending messages.
                        let lock = reporter.lock().expect("FATAL: upload_pack poisoned lock");
@@ -137,7 +137,7 @@ where
                        }
                    }
                    Err(e) => {
-
                        log::error!(target: "worker", "Error on upload-pack channel read for {}: {e}", header.repo);
+
                        log::debug!(target: "worker", "Failure on upload-pack channel read for {}: {e}", header.repo);
                        emitter.emit(events::UploadPack::error(header.repo, remote, e).into());
                        break;
                    }
modified crates/radicle-protocol/src/service.rs
@@ -572,7 +572,7 @@ where
            self.filter = Filter::allowed_by(self.policies.seed_policies()?);
            // Update and announce new inventory.
            if let Err(e) = self.remove_inventory(id) {
-
                error!(target: "service", "Error updating inventory after unseed: {e}");
+
                warn!(target: "service", "Failed to update inventory after unseed: {e}");
            }
        }
        Ok(updated)
@@ -660,7 +660,7 @@ where
            Ok(Some(last)) => Some(last.to_local_time()),
            Ok(None) => None,
            Err(e) => {
-
                error!(target: "service", "Error getting the latest gossip message from db: {e}");
+
                warn!(target: "service", "Failed to get the latest gossip message from db: {e}");
                None
            }
        };
@@ -671,11 +671,11 @@ where
            Ok(0) => {
                info!(target: "service", "Empty refs database, populating from storage..");
                if let Err(e) = self.db.refs_mut().populate(&self.storage) {
-
                    error!(target: "service", "Failed to populate refs database: {e}");
+
                    warn!(target: "service", "Failed to populate refs database: {e}");
                }
            }
            Ok(n) => debug!(target: "service", "Refs database has {n} cached references"),
-
            Err(e) => error!(target: "service", "Error checking refs database: {e}"),
+
            Err(e) => warn!(target: "service", "Failed to populate refs database: {e}"),
        }

        let announced = self
@@ -691,7 +691,7 @@ where

            // If we're not seeding this repo, just skip it.
            if !self.policies.is_seeding(&rid)? {
-
                warn!(target: "service", "Local repository {rid} is not seeded");
+
                debug!(target: "service", "Local repository {rid} is not seeded");
                continue;
            }
            // Add public repositories to inventory.
@@ -748,7 +748,7 @@ where
        let addrs = self.config.connect.clone();
        for (id, addr) in addrs.into_iter().map(|ca| ca.into()) {
            if let Err(e) = self.connect(id, addr) {
-
                error!(target: "service", "Service::initialization connection error: {e}");
+
                debug!(target: "service", "Service::initialization connection error: {e}");
            }
        }
        // Try to establish some connections.
@@ -804,7 +804,7 @@ where
            trace!(target: "service", "Running 'gossip' task...");

            if let Err(e) = self.relay_announcements() {
-
                error!(target: "service", "Error relaying stored announcements: {e}");
+
                warn!(target: "service", "Failed to relay stored announcements: {e}");
            }
            self.outbox.wakeup(GOSSIP_INTERVAL);
            self.last_gossip = now;
@@ -813,7 +813,7 @@ where
            trace!(target: "service", "Running 'sync' task...");

            if let Err(e) = self.fetch_missing_repositories() {
-
                error!(target: "service", "Error fetching missing inventory: {e}");
+
                warn!(target: "service", "Failed to fetch missing inventory: {e}");
            }
            self.outbox.wakeup(SYNC_INTERVAL);
            self.last_sync = now;
@@ -829,14 +829,14 @@ where
            trace!(target: "service", "Running 'prune' task...");

            if let Err(err) = self.prune_routing_entries(&now) {
-
                error!(target: "service", "Error pruning routing entries: {err}");
+
                warn!(target: "service", "Failed to prune routing entries: {err}");
            }
            if let Err(err) = self
                .db
                .gossip_mut()
                .prune((now - LocalDuration::from(self.config.limits.gossip_max_age)).into())
            {
-
                error!(target: "service", "Error pruning gossip entries: {err}");
+
                warn!(target: "service", "Failed to prune gossip entries: {err}");
            }

            self.outbox.wakeup(PRUNE_INTERVAL);
@@ -890,7 +890,7 @@ where
                    resp.send(seeds).ok();
                }
                Err(e) => {
-
                    error!(target: "service", "Error getting seeds for {rid}: {e}");
+
                    warn!(target: "service", "Failed to get seeds for {rid}: {e}");
                }
            },
            Command::Fetch(rid, seed, timeout, resp) => {
@@ -933,11 +933,11 @@ where
                let doc = match self.storage.get(id) {
                    Ok(Some(doc)) => doc,
                    Ok(None) => {
-
                        error!(target: "service", "Error announcing refs: repository {id} not found");
+
                        warn!(target: "service", "Failed to announce refs: repository {id} not found");
                        return;
                    }
                    Err(e) => {
-
                        error!(target: "service", "Error announcing refs: doc error: {e}");
+
                        warn!(target: "service", "Failed to announce refs: doc error: {e}");
                        return;
                    }
                };
@@ -949,7 +949,7 @@ where
                        }
                    }
                    Err(err) => {
-
                        error!(target: "service", "Error announcing refs: {err}");
+
                        warn!(target: "service", "Failed to announce refs: {err}");
                    }
                }
            }
@@ -961,7 +961,7 @@ where
                    resp.send(updated).ok();
                }
                Err(e) => {
-
                    error!(target: "service", "Error adding {rid} to inventory: {e}");
+
                    warn!(target: "service", "Failed to add {rid} to inventory: {e}");
                }
            },
            Command::QueryState(query, sender) => {
@@ -990,7 +990,7 @@ where
                }
            }
            Err(e) => {
-
                error!(target: "service", "Error getting the refs status of {rid}: {e}");
+
                warn!(target: "service", "Failed to get the refs status of {rid}: {e}");
            }
        }
        // We didn't try to fetch anything.
@@ -1070,7 +1070,7 @@ where

    fn queue_fetch(&mut self, fetch: QueuedFetch) {
        let Some(s) = self.sessions.get_mut(&fetch.from) else {
-
            log::error!(target: "service", "Cannot queue fetch for unknown session {}", fetch.from);
+
            log::debug!(target: "service", "Cannot queue fetch for unknown session {}", fetch.from);
            return;
        };
        if let Err(e) = s.queue_fetch(fetch) {
@@ -1139,7 +1139,7 @@ where
        result: Result<crate::worker::fetch::FetchResult, crate::worker::FetchError>,
    ) {
        let Some(fetching) = self.fetching.remove(&rid) else {
-
            error!(target: "service", "Received unexpected fetch result for {rid}, from {remote}");
+
            debug!(target: "service", "Received unexpected fetch result for {rid}, from {remote}");
            return;
        };
        debug_assert_eq!(fetching.from, remote);
@@ -1165,7 +1165,7 @@ where
                },
            };
            if sub.send(result).is_err() {
-
                error!(target: "service", "Error sending fetch result for {rid} from {remote}..");
+
                debug!(target: "service", "Failed to send fetch result for {rid} from {remote}..");
            } else {
                debug!(target: "service", "Sent fetch result for {rid} from {remote}..");
            }
@@ -1213,7 +1213,7 @@ where
                    debug!(target: "service", "Updating and announcing inventory for cloned repository {rid}..");

                    if let Err(e) = self.add_inventory(rid) {
-
                        error!(target: "service", "Error announcing inventory for {rid}: {e}");
+
                        warn!(target: "service", "Failed to announce inventory for {rid}: {e}");
                    }
                }

@@ -1224,12 +1224,12 @@ where
                    // Finally, announce the refs. This is useful for nodes to know what we've synced,
                    // beyond just knowing that we have added an item to our inventory.
                    if let Err(e) = self.announce_refs(rid, doc.into(), namespaces, false) {
-
                        error!(target: "service", "Failed to announce new refs: {e}");
+
                        warn!(target: "service", "Failed to announce new refs: {e}");
                    }
                }
            }
            Err(err) => {
-
                error!(target: "service", "Fetch failed for {rid} from {remote}: {err}");
+
                warn!(target: "service", "Fetch failed for {rid} from {remote}: {err}");

                // For now, we only disconnect the remote in case of timeout. In the future,
                // there may be other reasons to disconnect.
@@ -1310,7 +1310,7 @@ where
                    return false;
                }
            }
-
            Err(e) => error!(target: "service", "Error querying ban status for {ip}: {e}"),
+
            Err(e) => warn!(target: "service", "Failed to query ban status for {ip}: {e}"),
        }
        let host: HostName = ip.into();
        let tokens = self.config.limits.rate.inbound;
@@ -1379,7 +1379,7 @@ where
                                    .addresses_mut()
                                    .record_ip(&remote, ip, self.clock.into())
                            {
-
                                log::error!(target: "service", "Error recording IP address for {remote}: {e}");
+
                                log::debug!(target: "service", "Failed to record IP address for {remote}: {e}");
                            }
                        }
                    }
@@ -1473,7 +1473,7 @@ where
                .addresses_mut()
                .disconnected(&remote, &addr, severity)
            {
-
                error!(target: "service", "Error updating address store: {e}");
+
                debug!(target: "service", "Failed to update address store: {e}");
            }
            // Only re-attempt outbound connections, since we don't care if an inbound connection
            // is dropped.
@@ -1544,7 +1544,7 @@ where
                    }
                }
                Err(e) => {
-
                    error!(target: "service", "Error looking up node in address book: {e}");
+
                    debug!(target: "service", "Failed to look up node in address book: {e}");
                    return Ok(None);
                }
            }
@@ -1577,7 +1577,7 @@ where
                return Ok(None);
            }
            Err(e) => {
-
                error!(target: "service", "Error updating gossip entry from {announcer}: {e}");
+
                debug!(target: "service", "Failed to update gossip entry from {announcer}: {e}");
                return Ok(None);
            }
        };
@@ -1602,7 +1602,7 @@ where
                        }
                    }
                    Err(e) => {
-
                        error!(target: "service", "Error processing inventory from {announcer}: {e}");
+
                        debug!(target: "service", "Failed to process inventory from {announcer}: {e}");
                        return Ok(None);
                    }
                }
@@ -1633,7 +1633,7 @@ where
                                        missing.push(*id);
                                    }
                                }
-
                                Err(e) => error!(
+
                                Err(e) => debug!(
                                    target: "service",
                                    "Error checking local inventory for {id}: {e}"
                                ),
@@ -1703,7 +1703,7 @@ where
                            }
                        }
                        Err(e) => {
-
                            error!(target: "service", "Error updating sync status for {}: {e}", message.rid);
+
                            debug!(target: "service", "Failed to update sync status for {}: {e}", message.rid);
                        }
                    }
                }
@@ -1781,7 +1781,7 @@ where
                    }
                    Err(err) => {
                        // An error here is due to a fault in our address store.
-
                        error!(target: "service", "Error processing node announcement from {announcer}: {err}");
+
                        warn!(target: "service", "Failed to process node announcement from {announcer}: {err}");
                    }
                }
            }
@@ -1813,7 +1813,7 @@ where
        let local = self.node_id();
        let relay = self.config.is_relay();
        let Some(peer) = self.sessions.get_mut(remote) else {
-
            warn!(target: "service", "Session not found for {remote}");
+
            debug!(target: "service", "Session not found for {remote}");
            return Ok(());
        };
        peer.last_active = self.clock;
@@ -1871,7 +1871,7 @@ where
                                .gossip_mut()
                                .set_relay(id, gossip::RelayStatus::Relay)
                            {
-
                                error!(target: "service", "Error setting relay flag for message: {e}");
+
                                warn!(target: "service", "Failed to set relay flag for message: {e}");
                                return Ok(());
                            }
                        } else {
@@ -1892,7 +1892,7 @@ where
                            let ann = match ann {
                                Ok(a) => a,
                                Err(e) => {
-
                                    error!(target: "service", "Error reading gossip message from store: {e}");
+
                                    debug!(target: "service", "Failed to read gossip message from store: {e}");
                                    continue;
                                }
                            };
@@ -1907,7 +1907,7 @@ where
                        }
                    }
                    Err(e) => {
-
                        error!(target: "service", "Error querying gossip messages from store: {e}");
+
                        warn!(target: "service", "Failed to query gossip messages from store: {e}");
                    }
                }
                peer.subscribe = Some(subscribe);
@@ -2044,7 +2044,7 @@ where
        let now = self.timestamp();

        if !self.storage.contains(&rid)? {
-
            error!(target: "service", "Attempt to add non-existing inventory {rid}: repository not found in storage");
+
            debug!(target: "service", "Attempt to add non-existing inventory {rid}: repository not found in storage");
            return Ok(false);
        }
        // Add to our local inventory.
@@ -2188,7 +2188,7 @@ where
                r.at,
                timestamp.to_local_time(),
            ) {
-
                error!(
+
                warn!(
                    target: "service",
                    "Error updating refs database for `rad/sigrefs` of {} in {rid}: {e}",
                    r.remote
@@ -2219,7 +2219,7 @@ where
            );
            // Update our local node's sync status to mark the refs as announced.
            if let Err(e) = self.db.seeds_mut().synced(&rid, &ann.node, r.at, timestamp) {
-
                error!(target: "service", "Error updating sync status for local node: {e}");
+
                warn!(target: "service", "Failed to update sync status for local node: {e}");
            } else {
                debug!(target: "service", "Saved local sync status for {rid}..");
            }
@@ -2262,7 +2262,7 @@ where
        let timestamp: Timestamp = self.clock.into();

        if let Err(e) = self.db.addresses_mut().attempted(&nid, &addr, timestamp) {
-
            error!(target: "service", "Error updating address book with connection attempt: {e}");
+
            warn!(target: "service", "Failed to update address book with connection attempt: {e}");
        }
        self.sessions.insert(
            nid,
@@ -2507,7 +2507,7 @@ where
                peers
            }
            Err(e) => {
-
                error!(target: "service", "Unable to lookup available peers in address book: {e}");
+
                warn!(target: "service", "Unable to lookup available peers in address book: {e}");
                Vec::new()
            }
        }
@@ -2520,7 +2520,7 @@ where
            let policy = match policy {
                Ok(policy) => policy,
                Err(err) => {
-
                    log::error!(target: "protocol::filter", "Failed to read seed policy: {err}");
+
                    debug!(target: "protocol::filter", "Failed to read seed policy: {err}");
                    continue;
                }
            };
@@ -2537,7 +2537,7 @@ where
                    }
                }
                Err(err) => {
-
                    log::warn!(target: "protocol::filter", "Failed to check if {rid} exists: {err}");
+
                    log::debug!(target: "protocol::filter", "Failed to check if {rid} exists: {err}");
                    continue;
                }
            }
@@ -2561,7 +2561,7 @@ where
                    }
                }
                Err(e) => {
-
                    error!(target: "service", "Couldn't fetch missing repo {rid}: failed to lookup seeds: {e}");
+
                    debug!(target: "service", "Couldn't fetch missing repo {rid}: failed to lookup seeds: {e}");
                }
            }
        }
@@ -2580,7 +2580,7 @@ where
                        .addresses_mut()
                        .connected(&sess.id, &sess.addr, self.clock.into())
                {
-
                    error!(target: "service", "Error updating address book with connection: {e}");
+
                    warn!(target: "service", "Failed to update address book with connection: {e}");
                }
            }
        }
@@ -2645,7 +2645,7 @@ where
        }
        for (id, ka) in connect {
            if let Err(e) = self.connect(id, ka.addr.clone()) {
-
                error!(target: "service", "Service::maintain_connections connection error: {e}");
+
                warn!(target: "service", "Service::maintain_connections connection error: {e}");
            }
        }
    }
modified crates/radicle-protocol/src/service/filter.rs
@@ -70,7 +70,7 @@ impl Filter {
            let seed = match seed {
                Ok(seed) => seed,
                Err(err) => {
-
                    log::error!(target: "protocol::filter", "Failed to read seed policy: {err}");
+
                    log::debug!(target: "protocol::filter", "Failed to read seed policy: {err}");
                    continue;
                }
            };
modified crates/radicle-protocol/src/service/gossip.rs
@@ -44,7 +44,7 @@ pub fn inventory(
) -> InventoryAnnouncement {
    let inventory = inventory.into_iter().collect::<Vec<_>>();
    if inventory.len() > INVENTORY_LIMIT {
-
        error!(
+
        warn!(
            target: "service",
            "inventory announcement limit ({}) exceeded, other nodes will see only some of your projects",
            inventory.len()
modified crates/radicle-protocol/src/service/io.rs
@@ -82,7 +82,7 @@ impl Outbox {
        // Store our announcement so that it can be retrieved from us later, just like
        // announcements we receive from peers.
        if let Err(e) = gossip.announced(&ann.node, &ann) {
-
            error!(target: "service", "Error updating our gossip store with announced message: {e}");
+
            warn!(target: "service", "Failed to update gossip store with announced message: {e}");
        }

        for peer in peers {
modified crates/radicle-protocol/src/service/message.rs
@@ -217,9 +217,9 @@ impl RefsStatus {
                self.want.push(theirs);
            }
            Err(e) => {
-
                log::warn!(
+
                log::debug!(
                    target: "service",
-
                    "Error getting cached ref of {repo} for refs status: {e}"
+
                    "Failed to get cached 'rad/sigrefs' of {} in {repo} for refs status: {e}", theirs.remote,
                );
            }
        }
modified crates/radicle-protocol/src/service/session.rs
@@ -301,7 +301,7 @@ impl Session {
    pub fn fetched(&mut self, rid: RepoId) {
        if let State::Connected { fetching, .. } = &mut self.state {
            if !fetching.remove(&rid) {
-
                log::warn!(target: "service", "Fetched unknown repository {rid}");
+
                log::debug!(target: "service", "Fetched unknown repository {rid}");
            }
        }
    }
@@ -319,7 +319,7 @@ impl Session {
        self.last_active = since;

        if let State::Connected { .. } = &self.state {
-
            log::error!(target: "service", "Session {} is already in 'connected' state, resetting..", self.id);
+
            log::debug!(target: "service", "Session {} is already in 'connected' state, resetting..", self.id);
        };
        self.state = State::Connected {
            since,
modified crates/radicle/src/node/routing.rs
@@ -222,10 +222,8 @@ impl Store for Database {
        ignore: &NodeId,
    ) -> Result<usize, Error> {
        let limit: i64 = limit
-
            .unwrap_or(i64::MAX as usize)
-
            .try_into()
-
            .map_err(|_| Error::UnitOverflow)?;
-

+
            .and_then(|limit| i64::try_from(limit).ok())
+
            .unwrap_or(i64::MAX);
        let mut stmt = self.db.prepare(
            "DELETE FROM routing
             WHERE node <> ?1 AND rowid IN