pub struct PeerDiagnosticsResult {
pub nickname: String,
pub principal: String,
pub user_id: Option<String>,
pub paired_at: Option<String>,
pub last_addr: Option<String>,
pub hint_addrs: Vec<String>,
pub hint_usable: bool,
pub reachability: Option<PeerReachability>,
}Expand description
Result of Request::PeerDiagnostics (#140): the DURABLE per-peer state this node carries,
for diagnosing why a specific long-lived pairing behaves differently from a fresh one.
This surface carries a PEER’s transport coordinates on purpose. The rendered porcelain is
address-free everywhere — nicknames and path KINDS — because that discipline keeps a peer’s
coordinates out of screenshots. (SelfNetwork.direct_addrs already returns this node’s OWN
addresses on status; what is new here is another endpoint’s.) The question this answers is
“what address is this node about to dial, and where did it come from”, which has no answer
without the address. It is your own store’s record of your own paired peers. Do not render it
in ordinary porcelain, and read it before pasting it anywhere public.
The intended use is a paired capture: run it on BOTH ends of a stuck pairing and compare the stored hint against the live path each side reports.
Fields§
§nickname: StringThe peer’s nickname as this node stores it.
principal: StringThe peer’s stable eid: device principal.
user_id: Option<String>The peer’s b64u: user_id if it proved a device→user binding at pairing.
paired_at: Option<String>When the pairing was written (epoch seconds as a string), if recorded. A LONG-LIVED pairing is exactly what #140 is about, so the age is part of the evidence.
last_addr: Option<String>The persisted dial HINT, verbatim as stored — the durable state a freshly paired identity
does not have. None for a peer added without one.
It is MERGED with discovery rather than replacing it — iroh inserts it as one more
candidate path (Source::App) and then triggers address lookup.
But that lookup is skipped when a path is already selected. iroh’s
trigger_address_lookup returns early if selected_path.is_some(), and a selected path is
cleared only when the last connection to that peer closes. So on a pair that already holds
an open RELAYED connection — live sessions, dial-backs, a working relay — discovery does
NOT re-run, and this hint is the only addressing the dial contributes. Do not read “merged,
so a stale hint is harmless” as unconditional; it is least true in exactly the state a
stuck pairing is in.
It is the only durable per-peer state ON THIS NODE’S DISK that the dial path reads, which
is what makes it the first thing to compare between two ends. It is not the only durable
state a long-lived identity carries — a published discovery record under the same key, and
SelfNetwork::identity_conflict_epoch, live elsewhere.
hint_addrs: Vec<String>The addresses parsed out of last_addr, for reading without a JSON round trip: IP
addresses verbatim, relay URLs as relay <url> and SANITIZED to scheme+host+port (an
operator’s relay URL can carry a userinfo token, and this output is meant to be pasted into
an issue). Empty when the hint is absent, unparseable, or for a different endpoint — all of
which degrade to an id-only dial.
A relay … entry with no IP alongside it is worth noticing: that hint can never punch.
hint_usable: boolWhether last_addr parses AND its embedded id matches this peer. A false here with a
present last_addr means the hint is being silently discarded at every dial.
reachability: Option<PeerReachability>This node’s LIVE view of the peer, read straight from the reachability cache — the same
values status reports, repeated here so one capture holds both the durable and the live
side. None when this peer has never been probed, which is the honest answer on a
freshly restarted daemon; it is not the same as unreachable.
Read from the cache rather than through status’s projection deliberately: that projection
spawns a background probe for every stale peer, which would make this diagnostic a
participant in the reproduction it is meant to observe.
Trait Implementations§
Source§impl Clone for PeerDiagnosticsResult
impl Clone for PeerDiagnosticsResult
Source§fn clone(&self) -> PeerDiagnosticsResult
fn clone(&self) -> PeerDiagnosticsResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more