huskies: merge 889
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
//! - [`init`]: async startup and keypair persistence
|
||||
//! - [`apply`]: write path (sign, apply, persist, broadcast)
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::sync::{Mutex, OnceLock};
|
||||
|
||||
use bft_json_crdt::json_crdt::{BaseCrdt, SignedOp};
|
||||
@@ -67,6 +67,12 @@ pub(super) struct CrdtState {
|
||||
/// Newly-created registers (post-init) must have their Lamport clock
|
||||
/// advanced to this floor so they don't re-emit low sequence numbers.
|
||||
pub(super) lamport_floor: u64,
|
||||
/// Story IDs permanently tombstoned via `evict_item`.
|
||||
///
|
||||
/// `write_item` consults this set before inserting a new CRDT entry so
|
||||
/// that a concurrent or late-arriving write cannot resurrect a deleted
|
||||
/// story. Rebuilt from the CRDT op log on restart.
|
||||
pub(super) tombstones: HashSet<String>,
|
||||
}
|
||||
|
||||
// ── Singleton and accessor ───────────────────────────────────────────
|
||||
@@ -134,6 +140,7 @@ pub fn init_for_test() {
|
||||
gateway_project_index: HashMap::new(),
|
||||
persist_tx,
|
||||
lamport_floor: 0,
|
||||
tombstones: HashSet::new(),
|
||||
};
|
||||
let _ = lock.set(Mutex::new(state));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user