mirror of
https://github.com/jmcorgan/fips.git
synced 2026-07-30 19:46:15 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user