From 2cda56e1f8380fee428da5567b4fa4e58cc47707 Mon Sep 17 00:00:00 2001 From: Ultradesu Date: Fri, 2 Oct 2026 15:27:49 +0100 Subject: [PATCH] Log inbound handshake rejections at debug, not warn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Creating and leaving networks produced a stream of WARN lines like "Handshake rejected: peer requested an unknown or inactive network network=None". This is not a leave bug: leaving deactivates the network and publishes a release, but remote peers that still consider this device a member keep dialing, and each dial for a network no longer served is correctly rejected by the responder (lookup returns None, so the network stays unidentified — network=None by design, since a pre-handshake claim is unverified). Such a rejection is routine and remotely triggerable — a left network a peer has not caught up on, a stranger, a port scan, an old client — so logging it at WARN let any peer spam the log. It is now debug; enable debug to see rejections when diagnosing. The rejection behaviour itself is unchanged. Co-Authored-By: Claude Opus 4.8 --- crates/tsunagi-cli/src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/tsunagi-cli/src/main.rs b/crates/tsunagi-cli/src/main.rs index a0b8700..4f4c264 100644 --- a/crates/tsunagi-cli/src/main.rs +++ b/crates/tsunagi-cli/src/main.rs @@ -4435,7 +4435,12 @@ fn log_event(event: &Event) { let peer_str = peer .map(|p| p.fmt_short().to_string()) .unwrap_or_else(|| "unknown".into()); - tracing::warn!( + // Routine and remotely triggerable: a peer dialing a network this + // agent does not serve — one it never had, or has left and the peer + // has not learned yet — a stranger, or an old client. Rejecting is + // correct and contained (one session), so this is debug rather than + // a warning any peer could spam into the log. + tracing::debug!( network = ?network.map(|n| n.fmt_short().to_string()), peer = %peer_str, "Handshake rejected: {reason}"