From 0e03a77bcb1d39f1fbda23d8e704ac40302afb93 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 7 Nov 2026 22:35:10 +0100 Subject: dashboard: without LINKS; LINKS removed The dashboard reads every member's links from the members themselves; LINKS and LINKS_REPLY, swarm::links and their wire tags go (wire version bumped). Nodes the browser can't reach are drawn from what the reachable ones measure. Auth plan M3. --- src/transport/mod.rs | 97 ---------------------------------------------------- 1 file changed, 97 deletions(-) (limited to 'src/transport/mod.rs') diff --git a/src/transport/mod.rs b/src/transport/mod.rs index 8cbf412..f5b2db1 100644 --- a/src/transport/mod.rs +++ b/src/transport/mod.rs @@ -238,11 +238,6 @@ pub(crate) enum ParsedMessage { nonce: u64, at: crate::clock::UnixMillis, }, - /// Asks a member how it is linked to its peers, for a map of the swarm - /// (`swarm::links`). - Links(LinksRequest), - /// Answers a LINKS. - LinksReply(LinksReply), /// Asks whether the recipient reaches a member (`swarm::working_links`). Probe(ProbeRequest), /// Answers a PROBE. @@ -397,8 +392,6 @@ pub(crate) enum MessageKind { Me, Ping, Pong, - Links, - LinksReply, Probe, ProbeReply, Prune, @@ -421,8 +414,6 @@ impl ParsedMessage { ParsedMessage::Me(_) => MessageKind::Me, ParsedMessage::Ping(_) => MessageKind::Ping, ParsedMessage::Pong { .. } => MessageKind::Pong, - ParsedMessage::Links(_) => MessageKind::Links, - ParsedMessage::LinksReply(_) => MessageKind::LinksReply, ParsedMessage::Probe(_) => MessageKind::Probe, ParsedMessage::ProbeReply(_) => MessageKind::ProbeReply, ParsedMessage::Prune(_) => MessageKind::Prune, @@ -446,8 +437,6 @@ impl ParsedMessage { Some((status.epoch, status.epoch_seq)) } ParsedMessage::Blob(blob) => Some((blob.epoch, blob.epoch_seq)), - ParsedMessage::Links(request) => Some((request.epoch, request.epoch_seq)), - ParsedMessage::LinksReply(reply) => Some((reply.epoch, reply.epoch_seq)), ParsedMessage::Probe(request) => Some((request.epoch, request.epoch_seq)), ParsedMessage::ProbeReply(reply) => Some((reply.epoch, reply.epoch_seq)), ParsedMessage::Prune(link) | ParsedMessage::Graft(link) => { @@ -530,92 +519,6 @@ pub(crate) struct ProbeReply { pub(crate) reached: Option, } -/// LINKS: what a member is asked for a map of the swarm (`swarm::links`). -#[derive(Debug, Clone, Serialize, Deserialize)] -pub(crate) struct LinksRequest { - #[serde(with = "crate::transport::wire::codec::epoch")] - pub(crate) epoch: Epoch, - /// See `SyncEnvelope::epoch_seq`. - pub(crate) epoch_seq: u32, - /// Repeated in the reply: which request it answers. - pub(crate) nonce: u64, - /// For this long (seconds), a LINKS_REPLY again whenever the links change (a - /// subscription; the next LINKS renews it). 0: this reply only, and a subscription - /// ends (a relayed one runs out instead). - pub(crate) subscribe_secs: u32, - /// Members the receiver is to ask on the sender's behalf, which the sender can't - /// reach, passing their links on (relayed, `swarm::links`); none: the receiver's own. - pub(crate) of: Vec, - /// How long relayed links may be held to send several in one LINKS_REPLY, by the - /// receiver and the hops after it together (milliseconds; `swarm::links`). - pub(crate) batch_ms: u32, - /// How many more nodes a relayed request may go through, after the receiver. - pub(crate) hops: u8, -} - -/// LINKS_REPLY: how the sender is linked to its neighbours, as it measures them. -#[derive(Debug, Clone, Serialize, Deserialize)] -pub(crate) struct LinksReply { - #[serde(with = "crate::transport::wire::codec::epoch")] - pub(crate) epoch: Epoch, - /// See `SyncEnvelope::epoch_seq`. - pub(crate) epoch_seq: u32, - /// The request's. - pub(crate) nonce: u64, - /// The sender's own, if asked for; at most `swarm::links::MAX_LINKS`. - pub(crate) links: Vec, - /// Other members' links, passed on (`LinksRequest::of`). - pub(crate) relayed: Vec, -} - -/// A member's links as a LINKS_REPLY passes them on. -#[derive(Debug, Clone, Serialize, Deserialize)] -pub(crate) struct RelayedLinks { - pub(crate) member: String, - /// How long ago the member reported them (milliseconds). - pub(crate) age_ms: u32, - /// The member's epoch, as its LINKS_REPLY said (`LinksReply::epoch`): a dashboard - /// shows who entered a new one, swarm-wide. - #[serde(with = "crate::transport::wire::codec::epoch")] - pub(crate) epoch: Epoch, - pub(crate) links: Vec, -} - -/// One of a member's links, in a LINKS_REPLY. -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub(crate) struct Link { - /// The peer's node ID. - pub(crate) peer: String, - /// The transport its messages go over now (the scheme of the path in use), if any. - pub(crate) transport: Option, - /// Only through a relay (libp2p). - pub(crate) relayed: bool, - /// The path in use is down: none to the peer answers (`paths`), whatever its - /// connection was. - pub(crate) down: bool, - /// The round trip on that path, in microseconds, if measured. - pub(crate) rtt_us: Option, - /// Silent for long (`peers.md`, dormancy). - pub(crate) dormant: bool, - /// The peer's other transports (`swarm::links::MAX_OTHERS` at most): where else - /// it proved itself, those paths up. - pub(crate) others: Vec, - /// How far the peer's clock is ahead of the member's (`paths::ClockOffset`), if - /// measured: with every member's, a map of the swarm shows whose clock is off. - pub(crate) clock: Option, -} - -/// A transport of a link besides the one in use, in a LINKS_REPLY. -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub(crate) struct OtherPath { - /// Its scheme (`mycelium`, `libp2p`, `tor`). - pub(crate) transport: String, - /// The round trip of its fastest path, in microseconds, if any is measured. - pub(crate) rtt_us: Option, - /// Only through a relay (libp2p): no direct connection at any of its paths. - pub(crate) relayed: bool, -} - #[derive(Clone, Serialize, Deserialize)] pub(crate) struct HelloRequest { /// The sender's swarm, if it knows it (a new node doesn't yet). A receiver in -- cgit v1.3.1