aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm/links.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-03 05:21:25 +0100
committertv <tv@krebsco.de>2026-11-03 05:21:25 +0100
commit8366f7c5de474753dbfbf88431917e79c15e5389 (patch)
tree8c3ed8cca74760ff98b58264843765a3d8e65d3b /src/swarm/links.rs
parent96d7744dd29a3c783b43a7a6697af7d5d5719a10 (diff)
replace eager links by trees
Diffstat (limited to 'src/swarm/links.rs')
-rw-r--r--src/swarm/links.rs24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/swarm/links.rs b/src/swarm/links.rs
index e0d483d..c430d58 100644
--- a/src/swarm/links.rs
+++ b/src/swarm/links.rs
@@ -1,9 +1,8 @@
//! How members are linked, for a map of the swarm (the dashboard, `api::dashboard`): a
//! node asks a member with LINKS, and the member answers with a LINKS_REPLY listing its
//! neighbours and the peers it holds dormant (`own_links`), each with the transport its
-//! messages go over, whether only through a relay, the round trip, whether it is
-//! dormant, and which way the link is eager (`swarm::relay`): as the member measures
-//! them, which no other node can.
+//! messages go over, whether only through a relay, the round trip and whether it is
+//! dormant: as the member measures them, which no other node can.
//!
//! Every node answers, whatever its build: one with a dashboard asks any member, which
//! may have none. Only members (in the member list) are answered, as the links name
@@ -11,8 +10,8 @@
//! is written to the document: asked for while someone looks, forgotten after.
//!
//! A LINKS may subscribe (`subscribe_secs`): the member then sends a LINKS_REPLY again
-//! whenever its links change (`changed`: a peer, a transport, relayed, dormant, eager,
-//! or a round trip that moved by a fifth), looked at every `WATCH_EVERY` while anyone
+//! whenever its links change (`changed`: a peer, a transport, relayed, dormant, or a
+//! round trip that moved by a fifth), looked at every `WATCH_EVERY` while anyone
//! subscribes (round trips change without telling), until the subscription runs out
//! (the asker renews it with its next LINKS, so one that is gone stops it by not
//! renewing) or a LINKS with 0 ends it.
@@ -232,14 +231,7 @@ impl Links {
pub(crate) async fn own_links(state: &AppState) -> Vec<Link> {
let mut links = Vec::new();
for (peer, peer_state) in state.peers_snapshot().await {
- let (dormant, eager_to, eager_from) = {
- let peer_state = peer_state.lock().await;
- (
- peer_state.liveness.is_dormant(),
- peer_state.eager_to,
- peer_state.eager_from,
- )
- };
+ let dormant = peer_state.lock().await.liveness.is_dormant();
if !dormant && !topology::is_neighbour(state, &peer) {
continue;
}
@@ -264,8 +256,6 @@ pub(crate) async fn own_links(state: &AppState) -> Vec<Link> {
.rtt(&peer)
.map(|rtt| u32::try_from(rtt.as_micros()).unwrap_or(u32::MAX)),
dormant,
- eager_to,
- eager_from,
clock: state.transport.clock_offset(&peer),
peer,
});
@@ -1020,8 +1010,6 @@ fn changed(old: &[Link], new: &[Link]) -> bool {
|| a.relayed != b.relayed
|| a.down != b.down
|| a.dormant != b.dormant
- || a.eager_to != b.eager_to
- || a.eager_from != b.eager_from
|| moved(a.rtt_us, b.rtt_us)
|| clock_moved(a.clock, b.clock)
|| a.others.len() != b.others.len()
@@ -1074,8 +1062,6 @@ mod tests {
down: false,
rtt_us,
dormant: false,
- eager_to: false,
- eager_from: false,
others: Vec::new(),
clock: None,
}