From 61fb06c420d5e481badc8a9d3252b90cf9013746 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Nov 2026 13:24:34 +0000 Subject: federation: passing a set of events on What two nodes say to each other of their sets (store::passing), with nothing kept of a peer between messages: where a node stands, its store's checkpoint and heads and the fingerprint of all its names; ranges (document::ranges, whose messages serialize), where fingerprints differ; its heads, where they differ and the fingerprints don't; the names it lacks and would have; events and entries, no more than 1 MiB a message. What comes is offered to the store or put as an entry, and for what the store then waits on and doesn't hold (Store::lacks) the node asks in turn. Sets that wrote apart come to hold the same, over seeds; what a node refuses of its own reaches others through it. Used by nothing yet: no node carries a set. --- 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 781ba01..0243d03 100644 --- a/src/federation/store/memory.rs +++ b/src/federation/store/memory.rs @@ -256,6 +256,18 @@ impl Store { || self.holding_back.contains(id) } + /// What events that wait build on and the store doesn't hold, nor has wait. + pub(crate) fn lacks(&self) -> Vec { + let mut lacks: Vec = self + .waits_for + .iter() + .filter(|(id, waiting)| !waiting.is_empty() && !self.waiting.contains_key(id)) + .map(|(id, _)| *id) + .collect(); + lacks.sort(); + lacks + } + /// 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