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/members.rs | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/swarm/members.rs') diff --git a/src/swarm/members.rs b/src/swarm/members.rs index eac4d55..60d7e06 100644 --- a/src/swarm/members.rs +++ b/src/swarm/members.rs @@ -368,14 +368,16 @@ pub(crate) async fn ensure_registered(state: &AppState) { shortest, ) = { let replica = state.doc.read().await; + let entries = state.entries(); + let listed = crate::document::view::members_of(&entries, &replica.doc); ( - registered(&replica.doc, &local), - alias(&replica.doc, &local), - dashboard(&replica.doc, &local), - addresses(&replica.doc, &local), - millis_at(&replica.doc, &alive_path(&local)), - millis_at(&replica.doc, &window_path(&local)), - shortest_window(&replica.doc, state.electorate_window), + registered(listed, &local), + alias(listed, &local), + dashboard(listed, &local), + addresses(listed, &local), + millis_at(listed, &alive_path(&local)), + millis_at(listed, &window_path(&local)), + shortest_window(listed, state.electorate_window), ) }; let wanted = state.alias.clone(); @@ -454,7 +456,11 @@ pub(crate) async fn ensure_registered(state: &AppState) { // The party it is of, as configured. #[cfg(feature = "federation")] if let Some(ours) = state.holding.party() { - let recorded = party(&state.doc.read().await.doc, &local); + let entries = state.entries(); + let recorded = party( + crate::document::view::members_of(&entries, &state.doc.read().await.doc), + &local, + ); if recorded.as_deref() != Some(ours) { let (path, value) = (party_path(&local), json!(ours)); match state -- cgit v1.3.1