diff options
| author | tv <tv@krebsco.de> | 2026-11-16 20:48:03 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-16 22:03:41 +0100 |
| commit | 0e1238015e55854515a4cbc6b6ef757792e7d804 (patch) | |
| tree | bc7c008dfdf36d78d1e80f10d03e13926690749e /src/state | |
| parent | c534b25dbd94dc41731f98e4c4b2a170fe02c347 (diff) | |
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.
Diffstat (limited to 'src/state')
| -rw-r--r-- | src/state/peer.rs | 5 |
1 files changed, 5 insertions, 0 deletions
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<String>, 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(), |
