From 362633603e9fc1912fd35807da5653dc1273a5be Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 30 Nov 2026 14:31:03 +0000 Subject: swarm: members read of where the node's document keeps them The swarm reads its members, their addresses, aliases, parties, tiers and links, at _continuum/members of the document the node holds. Where the node's document keeps them apart and hands them over as a tree (AppState::entries: a set of events, Holding::entries), they are read of that (view::members_of): by the topology, the node's registration, stability, working links, the state file's seeds, reach, and the API's aliases, dashboards and tier. No node's document does so yet but one whose store a set carries, which none starts as. --- src/swarm/state_file.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/swarm/state_file.rs') diff --git a/src/swarm/state_file.rs b/src/swarm/state_file.rs index 415fb1a..a8c371c 100644 --- a/src/swarm/state_file.rs +++ b/src/swarm/state_file.rs @@ -133,8 +133,9 @@ pub(crate) async fn update(state: &AppState, now: bool) { let seeds = { let replica = state.doc.read().await; + let entries = state.entries(); seeds( - &replica.doc, + crate::document::view::members_of(&entries, &replica.doc), state.local_id(), state.electorate_window, state.clock.now_millis().as_u64(), @@ -185,7 +186,12 @@ pub(crate) async fn update(state: &AppState, now: bool) { /// Where to rejoin through: the addresses of members alive within the electorate /// window, stable ones first, of at most `MAX_SEEDS` members, sorted. Changes only when /// members join, leave, move or change tier, so the file rarely does. -fn seeds(doc: &crate::document::Document, me: &str, window: Duration, now: u64) -> Vec { +fn seeds( + doc: &dyn crate::document::view::Read, + me: &str, + window: Duration, + now: u64, +) -> Vec { let (mut stable, transient): (Vec, Vec) = members::electorate(doc, now, window) .into_iter() .filter(|pk| pk != me) -- cgit v1.3.1