From 22f9ac13bd0089f89cd2dd74932b522ab0c285c0 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Dec 2026 02:08:53 +0000 Subject: federation: nodes of both kinds pass their sets on to each other, too Two nodes of both kinds say an Automerge document in their handshakes, and synced that alone: what only sets hold, the entries of the nodes on sets, stopped at the first node of both it reached, so that in a swarm larger than its neighbour count the nodes on sets never came to read each other's entries. A node of both now says where its set stands beside each STATUS to a peer on a document; one of both that hears it passes its set on in turn, one on the document alone drops it. A simulation of nine nodes, three of each kind, two neighbours each. --- src/state/peer.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/state/peer.rs') diff --git a/src/state/peer.rs b/src/state/peer.rs index 356736a..768fead 100644 --- a/src/state/peer.rs +++ b/src/state/peer.rs @@ -95,6 +95,10 @@ pub(crate) struct PeerState { /// The kind of document its handshakes say it holds, of those this node holds: what /// this node says to it in turn, and passes on to it (`swarm::peer::inbound`). pub(crate) kind: Option<&'static str>, + /// Whether it holds a set of events beside the Automerge document its handshakes + /// say, a node of both kinds as this one: it sent what a set says (`swarm::set`). + #[cfg(feature = "federation")] + pub(crate) set_beside: bool, pub(crate) hello_state: HelloState, /// Wait between unanswered HELLOs; reset whenever a new handshake starts. pub(crate) hello_backoff: Backoff, @@ -343,6 +347,8 @@ impl PeerState { left: false, hello_attempts: 0, kind: None, + #[cfg(feature = "federation")] + set_beside: false, last_hello_at: None, unreachable_since: None, incidents: Incidents::default(), -- cgit v1.3.1