diff --git a/Cargo.lock b/Cargo.lock index 04f98e9e5..ace8d1674 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2641,27 +2641,13 @@ checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" name = "soar-db" version = "0.1.0" dependencies = [ - "async-h1", - "async-std", - "backtrace", - "base64 0.12.3", "clarity", - "http-types", "lazy_static", - "libc", - "pico-args", - "rand 0.7.3", - "reqwest", - "ring", - "rusqlite", "serde", "serde_derive", "serde_json", "slog", "stacks-common", - "tokio", - "toml", - "warp", ] [[package]] diff --git a/soar-db/Cargo.toml b/soar-db/Cargo.toml index b44182ad8..4a94d7f44 100644 --- a/soar-db/Cargo.toml +++ b/soar-db/Cargo.toml @@ -7,37 +7,14 @@ resolver = "2" [dependencies] lazy_static = "1.4.0" -pico-args = "0.3.1" -rand = "0.7.3" serde = "1" serde_derive = "1" serde_json = { version = "1.0", features = ["arbitrary_precision", "raw_value"] } -toml = "0.5.6" -async-h1 = "2.3.2" -async-std = { version = "1.6", features = ["attributes"] } -http-types = "2.12" -base64 = "0.12.0" -backtrace = "0.3.50" -libc = "0.2" slog = { version = "2.5.2", features = [ "max_level_trace" ] } clarity = { git = "https://github.com/stacks-network/stacks-blockchain.git", rev = "580e811223a389d38071dcb9fde79ab55cd6f685" } stacks-common = { git = "https://github.com/stacks-network/stacks-blockchain.git", rev = "580e811223a389d38071dcb9fde79ab55cd6f685" } # clarity = { package = "clarity", path = "../../../stacks-blockchain-develop/clarity" } # stacks-common = { package = "stacks-common", path = "../stacks-blockchain-develop/stacks-common" } -tokio = { version = "=1.15.0", features = ["full"] } -reqwest = { version = "0.11", features = ["blocking", "json", "rustls"] } -warp = "0.3" - -[dependencies.rusqlite] -version = "=0.24.2" -features = ["blob", "serde_json", "i128_blob", "bundled", "trace"] - -[dev-dependencies] -ring = "0.16.19" - -[dev-dependencies.rusqlite] -version = "=0.24.2" -features = ["blob", "serde_json", "i128_blob", "bundled", "trace"] [lib] name = "soar_db" diff --git a/soar-db/src/lib.rs b/soar-db/src/lib.rs index 5939f543c..9e64320f8 100644 --- a/soar-db/src/lib.rs +++ b/soar-db/src/lib.rs @@ -1,4 +1,13 @@ -// (S)ubnets (O)ptimistic (A)daptive (R)eplay DB +//! (S)ubnets (O)ptimistic (A)daptive (R)eplay DB +//! +//! The SoarDB is an optimistic fork-aware data store (a replacement +//! for the MARF used in stacks-blockchain). +//! +//! The general idea with the datastore is to store the current data +//! view as a normal key-value store and track the history of +//! operations on the storage. When a fork occurs, the data state is +//! unwound and then replayed. + extern crate clarity; extern crate stacks_common; diff --git a/soar-db/src/memory.rs b/soar-db/src/memory.rs index f3c44027b..90b702fff 100644 --- a/soar-db/src/memory.rs +++ b/soar-db/src/memory.rs @@ -1,3 +1,7 @@ +//! In-memory backing storage option for SoarDB. This backing store +//! is transient, so any data stored in this will be lost when the +//! process exits. + use std::collections::HashMap; use crate::SoarError; diff --git a/soar-db/src/tests.rs b/soar-db/src/tests.rs index e71062931..7a536a420 100644 --- a/soar-db/src/tests.rs +++ b/soar-db/src/tests.rs @@ -1,3 +1,5 @@ +//! Unit tests for the SoarDB implementation + use clarity::types::chainstate::StacksBlockId; use crate::{PutCommand, SoarDB};