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/memory.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/federation/store/memory.rs') diff --git a/src/federation/store/memory.rs b/src/federation/store/memory.rs index 289e5b4..781ba01 100644 --- a/src/federation/store/memory.rs +++ b/src/federation/store/memory.rs @@ -244,6 +244,18 @@ impl Store { self.refused.get(id) } + /// Whether the store has seen an event: holds it, by its bytes or its name alone, + /// forgot it at a checkpoint, refused it, has it wait, or holds it back. + pub(crate) fn knows(&self, id: &Id) -> bool { + self.events.contains_key(id) + || self.kept.contains_key(id) + || self.heads.contains(id) + || self.forgotten.contains(id) + || self.refused.contains_key(id) + || self.waiting.contains_key(id) + || self.holding_back.contains(id) + } + /// Whether an event waits for dependencies the store doesn't hold. pub(crate) fn is_waiting(&self, id: &Id) -> bool { self.waiting.contains_key(id) -- cgit v1.3.1