summaryrefslogtreecommitdiffstats
path: root/src/state.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-24 03:19:28 +0200
committertv <tv@krebsco.de>2026-10-24 03:19:28 +0200
commita1460b0a2861d5bb34ba25d409b234468f269e4e (patch)
treefb447e712aa587b4136c12f4b918cd9c6cf160f0 /src/state.rs
parent84a307a09eb3ba95920b028a49d0ec57bf316cdc (diff)
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.
Diffstat (limited to 'src/state.rs')
-rw-r--r--src/state.rs3
1 files changed, 3 insertions, 0 deletions
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<Arc<crate::swarm::auth::SwarmKey>>,
+ /// 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<std::sync::RwLock<Option<StaleView>>>,