From 5247296250355b7f75a993856d3675f73114d253 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 26 Oct 2026 20:38:07 +0100 Subject: remove some dead comments --- src/main.rs | 3 --- src/remake/snapshot.rs | 8 +++----- src/state/mod.rs | 7 ++----- 3 files changed, 5 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 628a71e..0cda7ca 100644 --- a/src/main.rs +++ b/src/main.rs @@ -308,6 +308,3 @@ fn watch_for_shutdown() -> Result> { async fn stopped(mut stop: watch::Receiver) { let _ = stop.wait_for(|stop| *stop).await; } - -// === Footnotes =============================================================== -// [concurrent]: these comments are in place so we remember what to do if we go from async to concurrent. diff --git a/src/remake/snapshot.rs b/src/remake/snapshot.rs index d093a33..b8c784e 100644 --- a/src/remake/snapshot.rs +++ b/src/remake/snapshot.rs @@ -18,10 +18,6 @@ //! at the snapshot change itself, so edits made afterwards through the store API can't //! change what the protocol sees. -// `Snapshot::clock` is kept for returning nodes (step 7); late nodes read the clock from -// the metadata instead. -#![cfg_attr(not(test), allow(dead_code))] - use std::collections::BTreeMap; use automerge::{ActorId, AutoCommit, ChangeHash, transaction::CommitOptions}; @@ -61,7 +57,9 @@ pub(crate) struct Snapshot { /// A document consisting of exactly that one change. pub(crate) doc: AutoCommit, /// Highest sequence number per actor (hex) contained in the base. A change - /// (actor, seq) is part of the snapshot iff seq <= clock[actor]. + /// (actor, seq) is part of the snapshot iff seq <= clock[actor]. Read by tests only: + /// nodes read the clock from the epoch metadata (`EpochMetadata::clock`). + #[cfg_attr(not(test), allow(dead_code))] pub(crate) clock: BTreeMap, } diff --git a/src/state/mod.rs b/src/state/mod.rs index beac886..787fd8c 100644 --- a/src/state/mod.rs +++ b/src/state/mod.rs @@ -57,8 +57,6 @@ pub(crate) struct AppState { pub(crate) lifecycle: Arc>, - // Serializes swarm-ID establishment, peer membership, and readiness transitions. - //[concurrent]swarm_validation: Arc>, pub(crate) peer_states: Arc>>>>, pub(crate) transport: Arc, pub(crate) firewall: Arc, @@ -69,7 +67,8 @@ pub(crate) struct AppState { pub(crate) sync_events: mpsc::UnboundedSender, - // TODO see key_watchers.md ("Use a per-key notification registry instead of the global `watch`") + /// The document's version: bumped after every change (`notify_store_changed`). The + /// change publisher (`swarm::sync`) waits on it; a measurement compares it. pub(crate) change_tx: watch::Sender, pub(crate) initial_sync_done: Arc, @@ -212,7 +211,6 @@ impl AppState { // Record the expected swarm without making the node Ready. Bootstrap owns readiness. pub(crate) async fn set_expected_swarm_id(&self, swarm_id: String) -> Result<()> { - //[concurrent]let _guard = self.swarm_validation.lock().await; let mut lifecycle = self.lifecycle.write().await; match &*lifecycle { NodeLifecycle::Joining { @@ -256,7 +254,6 @@ impl AppState { // Only bootstrap should call this, after validating document metadata. pub(crate) async fn mark_ready(&self, swarm_id: String) -> Result<()> { - //[concurrent]let _guard = self.swarm_validation.lock().await; let mut lifecycle = self.lifecycle.write().await; match &*lifecycle { NodeLifecycle::Joining { -- cgit v1.3.1