From 0e1238015e55854515a4cbc6b6ef757792e7d804 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 16 Nov 2026 20:48:03 +0000 Subject: peer: in a swarm holding a store, its members only A node of a swarm holding a store syncs with its members only (`docs/store.md`, Members): the nodes its store names, each with the party its handshakes name, as the store reads now. A handshake from any other goes unanswered, and what the node had with it ends, as with a banned node; so does what it had with a member at its next message, once the store names it no more (`swarm::peer::members`). The party a handshake names is kept with the peer. While a node holds no store yet, joining, it can't tell, and takes everyone of its swarm: its seeds, which take it only where its party lists it. A node says whether it is a member itself, as its store reads, when that changes. --- src/state/peer.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/state/peer.rs') diff --git a/src/state/peer.rs b/src/state/peer.rs index a7c6cc9..88cbb58 100644 --- a/src/state/peer.rs +++ b/src/state/peer.rs @@ -89,6 +89,9 @@ pub(crate) struct PeerState { pub(crate) leads: bool, pub(crate) standing: Standing, + /// The party its handshakes name, in a swarm holding a store (`swarm::peer::members`). + #[cfg(feature = "federation")] + pub(crate) party: Option, pub(crate) hello_state: HelloState, /// Wait between unanswered HELLOs; reset whenever a new handshake starts. pub(crate) hello_backoff: Backoff, @@ -300,6 +303,8 @@ impl PeerState { Self { leads, standing: Standing::default(), + #[cfg(feature = "federation")] + party: None, hello_state: HelloState::default(), hello_backoff: Backoff::new(HELLO_RETRY, HELLO_RETRY_MAX), probe_backoff: timing.probe_backoff(), -- cgit v1.3.1