From 37a521169f703f5f412ea6dd52684b03289c350d Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 21 Nov 2026 22:21:56 +0000 Subject: roots: a seed joining itself names the root once it has it A joiner takes no root before each of its seeds named one, and a seed names its root only in a handshake. A seed that shook hands while joining itself named none, and never again: its joiner waited for ever. scripts/wire-check hit that (b joining a, c through b, d through c): b's reply to c came 2 ms before b had its document. Now a node notes the peers its handshakes named no root to, and once ready, shakes hands with them again, naming it. Older joiners take it too: it's a handshake as before. --- src/swarm/peer/handshake.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/swarm/peer') diff --git a/src/swarm/peer/handshake.rs b/src/swarm/peer/handshake.rs index ef7d379..d3f6b99 100644 --- a/src/swarm/peer/handshake.rs +++ b/src/swarm/peer/handshake.rs @@ -140,7 +140,7 @@ async fn transmit_hello(state: &AppState, peer: &str) -> Result<()> { ready: state.is_ready().await, run_id: state.run_id, handshake, - root: crate::swarm::roots::own(state) + root: crate::swarm::roots::named_to(state, peer) .await .map(|root| root.0.to_vec()), party: party(state), @@ -250,7 +250,7 @@ pub(super) async fn send_hello_reply( run_id, away_ms: away.map(|away| away.as_millis() as u64), sender_run_id: state.run_id, - root: crate::swarm::roots::own(state) + root: crate::swarm::roots::named_to(state, peer) .await .map(|root| root.0.to_vec()), party: party(state), -- cgit v1.3.1