From 665114036b3deb79ba232f4e741eeb9ad4e32dec Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Mon, 22 Dec 2025 21:12:29 +0100 Subject: [PATCH] refactor: remove lattice-store crate and update roadmap tasks --- Cargo.toml | 2 -- docs/roadmap.md | 3 +-- lattice-store/Cargo.toml | 15 --------------- lattice-store/src/lib.rs | 12 ------------ lattice-store/src/snapshot.rs | 6 ------ lattice-store/src/store.rs | 35 ---------------------------------- lattice-store/src/watermark.rs | 9 --------- 7 files changed, 1 insertion(+), 81 deletions(-) delete mode 100644 lattice-store/Cargo.toml delete mode 100644 lattice-store/src/lib.rs delete mode 100644 lattice-store/src/snapshot.rs delete mode 100644 lattice-store/src/store.rs delete mode 100644 lattice-store/src/watermark.rs diff --git a/Cargo.toml b/Cargo.toml index 2a298b4..254a280 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,6 @@ resolver = "2" members = [ "lattice-core", "lattice-net", - "lattice-store", "lattice-cli", ] @@ -16,7 +15,6 @@ license = "MIT" # Workspace crates lattice-core = { path = "lattice-core" } lattice-net = { path = "lattice-net" } -lattice-store = { path = "lattice-store" } lattice-cli = { path = "lattice-cli" } # CLI diff --git a/docs/roadmap.md b/docs/roadmap.md index f50b4c3..9255f7b 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -139,8 +139,7 @@ **Post-M2 Refactoring:** - [ ] Unify `node.rs` from `lattice-cli` and `lattice-core` -- [ ] Move `Store` code into `lattice-store` crate -- [ ] Move `StoreActor` code into `lattice-store` crate +- [ ] Use prost for node status in store --- diff --git a/lattice-store/Cargo.toml b/lattice-store/Cargo.toml deleted file mode 100644 index 1595012..0000000 --- a/lattice-store/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "lattice-store" -description = "Log-based KV store with snapshots and watermarks" -version.workspace = true -edition.workspace = true -license.workspace = true - -[dependencies] -lattice-core = { workspace = true } -tokio = { workspace = true } -thiserror = { workspace = true } -tracing = { workspace = true } - -[dev-dependencies] -tokio-test = { workspace = true } diff --git a/lattice-store/src/lib.rs b/lattice-store/src/lib.rs deleted file mode 100644 index ac31584..0000000 --- a/lattice-store/src/lib.rs +++ /dev/null @@ -1,12 +0,0 @@ -//! Lattice Store -//! -//! Log-based Key-Value store: -//! - State is a "view" generated by replaying entries -//! - Watermarks for agreeing on safe compaction points -//! - Snapshots for replacing old logs - -pub mod store; -pub mod snapshot; -pub mod watermark; - -pub use store::Store; diff --git a/lattice-store/src/snapshot.rs b/lattice-store/src/snapshot.rs deleted file mode 100644 index 25ef69e..0000000 --- a/lattice-store/src/snapshot.rs +++ /dev/null @@ -1,6 +0,0 @@ -//! Snapshots for log compaction - -/// A verified snapshot that can replace old log entries. -pub struct Snapshot { - // TODO: snapshot data, watermark, verification -} diff --git a/lattice-store/src/store.rs b/lattice-store/src/store.rs deleted file mode 100644 index 2309df3..0000000 --- a/lattice-store/src/store.rs +++ /dev/null @@ -1,35 +0,0 @@ -//! The main KV store - -use std::collections::HashMap; - -/// A log-based Key-Value store. -/// -/// The store is a dynamic "view" generated by replaying entries. -pub struct Store { - data: HashMap, Vec>, -} - -impl Store { - /// Create a new empty store. - pub fn new() -> Self { - Self { - data: HashMap::new(), - } - } - - /// Get a value by key. - pub fn get(&self, key: &[u8]) -> Option<&[u8]> { - self.data.get(key).map(|v| v.as_slice()) - } - - /// Set a value (this would normally go through the log). - pub fn set(&mut self, key: Vec, value: Vec) { - self.data.insert(key, value); - } -} - -impl Default for Store { - fn default() -> Self { - Self::new() - } -} diff --git a/lattice-store/src/watermark.rs b/lattice-store/src/watermark.rs deleted file mode 100644 index 589e5cf..0000000 --- a/lattice-store/src/watermark.rs +++ /dev/null @@ -1,9 +0,0 @@ -//! Watermarks for agreeing on safe compaction points - -/// A watermark representing a safe cut-off point for log compaction. -/// -/// Nodes use watermarks to agree on which entries can be safely -/// deleted and replaced with snapshots. -pub struct Watermark { - // TODO: watermark data -}