summaryrefslogtreecommitdiffstats
path: root/src/state/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/mod.rs')
-rw-r--r--src/state/mod.rs7
1 files changed, 2 insertions, 5 deletions
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<RwLock<NodeLifecycle>>,
- // Serializes swarm-ID establishment, peer membership, and readiness transitions.
- //[concurrent]swarm_validation: Arc<Mutex<()>>,
pub(crate) peer_states: Arc<RwLock<HashMap<String, Arc<Mutex<PeerState>>>>>,
pub(crate) transport: Arc<dyn transport::Transport>,
pub(crate) firewall: Arc<Firewall>,
@@ -69,7 +67,8 @@ pub(crate) struct AppState {
pub(crate) sync_events: mpsc::UnboundedSender<SyncEvent>,
- // TODO see key_watchers.md ("Use a per-key notification registry instead of the global `watch<u64>`")
+ /// 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<u64>,
pub(crate) initial_sync_done: Arc<AtomicBool>,
@@ -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 {