aboutsummaryrefslogtreecommitdiffstats
path: root/src/state/peer.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-12-01 02:08:53 +0000
committertv <tv@krebsco.de>2026-12-01 02:08:53 +0000
commit22f9ac13bd0089f89cd2dd74932b522ab0c285c0 (patch)
tree5b5f9c09755f385743c9537672542456b79a6a2e /src/state/peer.rs
parenteadf0952260ba4b21e791226cf5ad39e8f079c86 (diff)
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.
Diffstat (limited to 'src/state/peer.rs')
-rw-r--r--src/state/peer.rs6
1 files changed, 6 insertions, 0 deletions
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(),