From 85c6a9a2ddeaf23066ddfa3362693604a37526ae Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 5 Nov 2026 00:46:06 +0100 Subject: drop full mesh stat --- src/swarm/topology/mod.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/swarm/topology') diff --git a/src/swarm/topology/mod.rs b/src/swarm/topology/mod.rs index b876fd0..afa13ee 100644 --- a/src/swarm/topology/mod.rs +++ b/src/swarm/topology/mod.rs @@ -57,7 +57,10 @@ pub(crate) struct NeighbourView { /// they say they sync with us (`refresh`). outbound: BTreeSet, neighbours: BTreeSet, - /// Every reachable member is a neighbour. + /// Every member not judged unreachable is a neighbour (the tests wait for it, + /// `is_full_mesh`). Not the swarm being a full mesh: members on a transport we are + /// not on, or that we never reached, don't count against it. + #[cfg(test)] full_mesh: bool, /// The graph the member list gives, as if every member reached every other /// (`member_list_graph`): computed when first asked for, kept while the member list @@ -123,7 +126,6 @@ pub(crate) struct Summary { pub(crate) stable: usize, pub(crate) neighbours: usize, pub(crate) stable_neighbours: usize, - pub(crate) full_mesh: bool, } pub(crate) fn summary(state: &AppState) -> Option { @@ -146,7 +148,6 @@ pub(crate) fn summary(state: &AppState) -> Option { .iter() .filter(|m| view.stable.contains(*m)) .count(), - full_mesh: view.full_mesh, }) } @@ -412,6 +413,7 @@ pub(crate) async fn refresh(state: &AppState) -> Option { &|m| stable.contains(m), ); computed.extend(outbound.iter().cloned()); + #[cfg(test)] let listed_neighbours = computed.len(); computed.extend(unlisted.iter().cloned()); let change = NeighbourChange { @@ -438,11 +440,13 @@ pub(crate) async fn refresh(state: &AppState) -> Option { removed = change.removed.len(), "Neighbours computed from the member list" ); + #[cfg(test)] let reachable_others = current .iter() .filter(|m| m.as_str() != state.local_id() && !unreachable.contains(*m)) .count(); *state.neighbours.write_or_recover() = Some(NeighbourView { + #[cfg(test)] full_mesh: listed_neighbours >= reachable_others, members: current, k, -- cgit v1.3.1