From f0c0cec4358db039b49dbf1b38bdc17117ba69cf Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Nov 2026 13:16:06 +0000 Subject: federation: a member's entry in a set of events What a node says of itself (store::entry::Entry): a JSON map of no more than 16 KiB, with its count, signed with its node key for its store. A set holds each member's newest (Set::put_entry): the highest count, of two of one count the lower name; none of a node the store doesn't name a member as it reads now, and those it held go with their node. Their names are among the set's, to catch up by; and a set says what of a peer's names it would have (Set::wants, Store::knows), which leaves out what its store refused, waits for or forgot, and a stranger's entry until who is a member changes. The store's test fold names members, by what counts at node:. --- src/federation/store/testfold.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/federation/store/testfold.rs') diff --git a/src/federation/store/testfold.rs b/src/federation/store/testfold.rs index 6dd1460..1b26a4e 100644 --- a/src/federation/store/testfold.rs +++ b/src/federation/store/testfold.rs @@ -452,7 +452,16 @@ impl Fold for TestFold { (heads.iter().copied().collect::>() != now.at).then(|| heads.clone()) } - fn members(_state: &State) -> Vec<(String, String)> { - Vec::new() + /// The nodes named by what counts at keys `node:`, each with what the key + /// holds as its group; none where it holds nothing. + fn members(state: &State) -> Vec<(String, String)> { + state + .counts() + .into_iter() + .filter_map(|(key, group)| { + let node = key.strip_prefix("node:")?; + (!group.is_empty()).then(|| (node.to_owned(), group)) + }) + .collect() } } -- cgit v1.3.1