From a1460b0a2861d5bb34ba25d409b234468f269e4e Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 24 Oct 2026 03:19:28 +0200 Subject: use nonce in handshake To prevent stale hello replies to cause joins and thus stale sessions, each run gets a random ID, which used as nonce in the handshake. --- src/state.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/state.rs') diff --git a/src/state.rs b/src/state.rs index bbda4e4..cfa5ddf 100644 --- a/src/state.rs +++ b/src/state.rs @@ -492,6 +492,9 @@ pub(crate) struct AppState { /// knows the swarm ID. pub(crate) swarm_key: Option>, + /// Random per run of this node; our HELLOs carry it and replies must echo it. + pub(crate) run_id: transport::RunId, + /// While rejoining a newer epoch, the previous document, served read-only (and /// marked stale) instead of answering 503. pub(crate) stale: Arc>>, -- cgit v1.3.1