Human-readable peer identifiers in log messages

Replace raw NodeAddr hex strings in log output with human-readable
identifiers using a four-tier lookup: configured alias, active peer
short npub, session endpoint short npub, or truncated hex fallback.

- Add PeerIdentity::short_npub() for compact npub display (npub1xxxx...yyyy)
- Add NodeAddr::short_hex() for compact hex fallback (first 4 bytes + ...)
- Add peer_aliases map populated at startup from peer config
- Add Node::peer_display_name() with four-tier resolution
- Add SessionEntry::remote_pubkey() accessor for session-layer lookups
- Update all 120 log field occurrences across 11 handler/node files
- Pass pre-computed display names to MMP static metric/teardown methods
  to work around borrow checker constraints in iterator loops
This commit is contained in:
Johnathan Corgan
2026-02-19 05:04:19 +00:00
parent ab7a4bac29
commit 9605cbafe3
15 changed files with 215 additions and 141 deletions
+5
View File
@@ -51,6 +51,11 @@ impl NodeAddr {
pub fn as_slice(&self) -> &[u8] {
&self.0
}
/// Return a short hex representation: first 4 bytes + "...".
pub fn short_hex(&self) -> String {
format!("{}...", hex_encode(&self.0[..4]))
}
}
impl fmt::Debug for NodeAddr {