From 974e146bb96945218def87b70b43a448623f60e1 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sat, 6 Jun 2026 19:11:45 +0000 Subject: [PATCH] node: demote routine per-peer and capacity-cap events from info/warn to debug On a saturated public-mesh node the connection-lifecycle and capacity-cap events fire continuously and drown out the genuinely notable INFO/WARN lines. Demote them to debug and drop a redundant duplicate: - FMP K-bit cutover promotion (encrypted): info -> debug - "Connection promoted to active peer" (handshake): info -> debug, and remove the duplicate "Inbound peer promoted to active" line that shadowed it on the inbound path - "Peer restart detected" (handshake): info -> debug - "Peer removed and state cleaned up" (dispatch): info -> debug - "Rejecting inbound TCP connection (max_inbound_connections reached)" (tcp): warn -> debug - "Congestion detected, CE flag set on forwarded packet" (forwarding): warn -> debug - "Removing peer: link dead timeout" (mmp): warn -> debug These are expected, high-frequency conditions on a busy public node (new and reconnecting peers, ECN CE marking, the inbound connection cap, and link-dead churn), not operator-actionable signals. --- src/node/handlers/dispatch.rs | 2 +- src/node/handlers/encrypted.rs | 4 ++-- src/node/handlers/forwarding.rs | 2 +- src/node/handlers/handshake.rs | 13 +++++-------- src/node/handlers/mmp.rs | 2 +- src/transport/tcp/mod.rs | 2 +- 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/node/handlers/dispatch.rs b/src/node/handlers/dispatch.rs index faaccec..cc491df 100644 --- a/src/node/handlers/dispatch.rs +++ b/src/node/handlers/dispatch.rs @@ -194,7 +194,7 @@ impl Node { let remaining_peers: Vec = self.peers.keys().copied().collect(); self.bloom_state.mark_all_updates_needed(remaining_peers); - info!( + debug!( peer = %self.peer_display_name(node_addr), link_id = %link_id, tree_changed = tree_changed, diff --git a/src/node/handlers/encrypted.rs b/src/node/handlers/encrypted.rs index 211c4f6..6b3675c 100644 --- a/src/node/handlers/encrypted.rs +++ b/src/node/handlers/encrypted.rs @@ -5,7 +5,7 @@ use crate::node::wire::{EncryptedHeader, FLAG_CE, FLAG_KEY_EPOCH, FLAG_SP, strip use crate::noise::NoiseError; use crate::transport::ReceivedPacket; use std::time::Instant; -use tracing::{debug, info, trace, warn}; +use tracing::{debug, trace, warn}; /// Force-remove a peer after this many consecutive decryption failures. const DECRYPT_FAILURE_THRESHOLD: u32 = 20; @@ -94,7 +94,7 @@ impl Node { }); if let Some(plaintext) = pending_plaintext { - info!( + debug!( peer = %display_name, "Peer new-epoch frame authenticated, K-bit flip promoting new session" ); diff --git a/src/node/handlers/forwarding.rs b/src/node/handlers/forwarding.rs index 245004b..48ef9e9 100644 --- a/src/node/handlers/forwarding.rs +++ b/src/node/handlers/forwarding.rs @@ -106,7 +106,7 @@ impl Node { .unwrap_or(true); if should_log { self.last_congestion_log = Some(now); - warn!(next_hop = %next_hop_addr, "Congestion detected, CE flag set on forwarded packet"); + debug!(next_hop = %next_hop_addr, "Congestion detected, CE flag set on forwarded packet"); } } diff --git a/src/node/handlers/handshake.rs b/src/node/handlers/handshake.rs index 0f4dc26..bad38de 100644 --- a/src/node/handlers/handshake.rs +++ b/src/node/handlers/handshake.rs @@ -248,7 +248,7 @@ impl Node { match (existing_epoch, new_epoch) { (Some(existing), Some(new)) if existing != new => { // Epoch mismatch — peer restarted. Tear down stale session. - info!( + debug!( peer = %self.peer_display_name(&peer_node_addr), "Peer restart detected (epoch mismatch), removing stale session" ); @@ -510,12 +510,9 @@ impl Node { if let Some(peer) = self.peers.get_mut(&node_addr) { peer.set_handshake_msg2(wire_msg2.clone()); } - debug!( - peer = %self.peer_display_name(&node_addr), - link_id = %link_id, - our_index = %our_index, - "Inbound peer promoted to active" - ); + // Promotion is logged once by `promote_connection` + // ("Connection promoted to active peer"); no separate + // inbound-path line. // Send initial tree announce to new peer if let Err(e) = self.send_tree_announce_to_peer(&node_addr).await { debug!(peer = %self.peer_display_name(&node_addr), error = %e, "Failed to send initial TreeAnnounce"); @@ -1166,7 +1163,7 @@ impl Node { self.retry_pending.remove(&peer_node_addr); self.register_identity(peer_node_addr, verified_identity.pubkey_full()); - info!( + debug!( peer = %self.peer_display_name(&peer_node_addr), link_id = %link_id, our_index = %our_index, diff --git a/src/node/handlers/mmp.rs b/src/node/handlers/mmp.rs index f9941ae..64cf2a2 100644 --- a/src/node/handlers/mmp.rs +++ b/src/node/handlers/mmp.rs @@ -573,7 +573,7 @@ impl Node { .unwrap_or(0); for addr in &dead_peers { - warn!( + debug!( peer = %self.peer_display_name(addr), timeout_secs = self.config.node.link_dead_timeout_secs, "Removing peer: link dead timeout" diff --git a/src/transport/tcp/mod.rs b/src/transport/tcp/mod.rs index 1e8f71b..f3c20fe 100644 --- a/src/transport/tcp/mod.rs +++ b/src/transport/tcp/mod.rs @@ -801,7 +801,7 @@ async fn accept_loop( // operator-facing inbound cap. if stats.pool_inbound_count() >= max_inbound as u64 { stats.record_connection_rejected(); - warn!( + debug!( transport_id = %transport_id, peer_addr = %peer_addr, max = max_inbound,