Report members, not symptoms

A peer going away showed up as three unrelated yellow rows: no peers
authenticated, N dial failures, one packet to an address nobody owns.
Each was true and none of them said the actual thing, which is that a
member we know about is offline. Worse, they are cumulative, so after
the peer came back the report still looked broken.

Two changes behind that.

Members are now a list, joined from the three sources that each know
part of the answer: signed state says who belongs and keeps saying it
while they are away, the session list says who is here, the overlay says
whose tunnel is up. Online first, then away, this agent left out because
the device section already covers it. An absent member is stated rather
than flagged — in a mesh of laptops being away is the ordinary condition
— and its failed dials are attributed to it instead of floating free as
a network-wide number.

Counters are history and no longer grade anything. Grading them is what
kept the report red long after the cause had gone. The one exception is
context-sensitive rather than cumulative: handshake failures with nobody
connected is the signature of a mismatched secret, so that is called
out.

NetworkStatus grows a member roster from the signed records, and the
overlay report carries the endpoint id so a tunnel can be matched to its
session. Note what the roster cannot do: a member is in signed state
only once it has claimed something, which today means an IPv4 address,
so an IPv6-only network still has no durable roster. Hostnames are not
persisted either, so an absent member is named by its id.

The control socket gained a version word. Adding these fields changed
how postcard parses the bytes, and without it a client one build ahead
of its agent reported "Found an Option discriminant that wasn't 0 or 1".
The check names a mismatch for whichever side is newer; an older agent
reading a newer request just drops the connection, so the CLI offers
that as a possibility rather than asserting it. It also now separates an
agent that is absent, which is an ordinary answer, from one that is
there and will not answer, which is a fault.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
tsunagiandClaude Opus 5 committed 2026-09-21 15:26:16 +01:00
1 parent 8a6fb39689
commit 776eedc669
7 files changed
+557 -113

No files matched your search

+21 -1
View File
@@ -30,7 +30,9 @@ use crate::storage::Storage;
use super::events::Event;
use super::session::{self, Session, SessionEvent};
use super::shutdown::Shutdown;
use super::status::{CandidateStatus, NetworkMetrics, NetworkState, NetworkStatus, PeerStatus};
use super::status::{
CandidateStatus, MemberStatus, NetworkMetrics, NetworkState, NetworkStatus, PeerStatus,
};
/// An inbound connection that already passed the handshake.
#[derive(Debug)]
@@ -1224,6 +1226,23 @@ impl Runtime {
.collect();
candidates.sort_by(|a, b| a.endpoint_id.as_bytes().cmp(b.endpoint_id.as_bytes()));
// The durable roster. Every author of a signed record is a member,
// including this agent and including members that are not here.
let mut members: Vec<MemberStatus> = self
.state
.records()
.into_iter()
.filter_map(|record| {
let endpoint_id = record.author_id().ok()?;
Some(MemberStatus {
endpoint_id,
overlay_address_v4: record.body.claimed_address(),
})
})
.collect();
members.sort_by(|a, b| a.endpoint_id.as_bytes().cmp(b.endpoint_id.as_bytes()));
members.dedup_by(|a, b| a.endpoint_id == b.endpoint_id);
NetworkStatus {
descriptor: self.params.keys.descriptor(),
name: self.params.keys.name().clone(),
@@ -1231,6 +1250,7 @@ impl Runtime {
state: NetworkState::Active,
peers,
candidates,
members,
metrics: self.metrics.clone(),
}
}