diff --git a/Cargo.lock b/Cargo.lock index 9b22047c7..4a69a99ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -836,9 +836,9 @@ checksum = "1c53ba0f290bfc610084c05582d9c5d421662128fc69f4bf236707af6fd321b9" [[package]] name = "cc" -version = "1.2.57" +version = "1.2.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a0dd1ca384932ff3641c8718a02769f1698e7563dc6974ffd03346116310423" +checksum = "e1e928d4b69e3077709075a938a05ffbedfa53a84c8f766efbf8220bb1ff60e1" dependencies = [ "find-msvc-tools", "jobserver", @@ -2180,9 +2180,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" +checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" dependencies = [ "libc", "wasi", @@ -2545,9 +2545,9 @@ dependencies = [ [[package]] name = "rawdb" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ebc4ac8e255d001f609b3d3002c7209e1668b9ab0aedf9a6a263e2e7e2c3cdb" +checksum = "fddb06a11fcc5f7f44d9b5bee4ab61b5a1135232b2fd239253428abd192ba504" dependencies = [ "libc", "log", @@ -2963,9 +2963,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "simd-adler32" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" +checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" [[package]] name = "slab" @@ -3439,9 +3439,9 @@ checksum = "8f54a172d0620933a27a4360d3db3e2ae0dd6cceae9730751a036bbf182c4b23" [[package]] name = "vecdb" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e0237a44ee8ea6692e815154cc477a8c1936b27dca79bb1b9e093fa55e04a2" +checksum = "a33f1cbef9bf38048ee1b51328366f0a734e06bcc0b9739d68fef9ecce43d0b8" dependencies = [ "itoa", "libc", @@ -3462,9 +3462,9 @@ dependencies = [ [[package]] name = "vecdb_derive" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fef159303d1f54cbb08b8249da70a9e1573145074949a91e9072addde209d65" +checksum = "33d31f03d1c7269d65195fb4d54c1d510b124807871bd11af7d10a08700d7590" dependencies = [ "quote", "syn", diff --git a/Cargo.toml b/Cargo.toml index b77fda2b5..b6ba912dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -87,7 +87,7 @@ tower-http = { version = "0.6.8", features = ["catch-panic", "compression-br", " tower-layer = "0.3" tracing = { version = "0.1", default-features = false, features = ["std"] } ureq = { version = "3.3.0", features = ["json"] } -vecdb = { version = "0.8.0", features = ["derive", "serde_json", "pco", "schemars"] } +vecdb = { version = "0.9.0", features = ["derive", "serde_json", "pco", "schemars"] } # vecdb = { path = "../anydb/crates/vecdb", features = ["derive", "serde_json", "pco", "schemars"] } [workspace.metadata.release] diff --git a/crates/brk_client/src/lib.rs b/crates/brk_client/src/lib.rs index 68c02a83b..91a0197c1 100644 --- a/crates/brk_client/src/lib.rs +++ b/crates/brk_client/src/lib.rs @@ -8195,7 +8195,7 @@ pub struct BrkClient { impl BrkClient { /// Client version. - pub const VERSION: &'static str = "v0.2.3"; + pub const VERSION: &'static str = "v0.2.4"; /// Create a new client with the given base URL. pub fn new(base_url: impl Into) -> Self { diff --git a/crates/brk_computer/src/blocks/compute.rs b/crates/brk_computer/src/blocks/compute.rs index b0621db77..894e51dea 100644 --- a/crates/brk_computer/src/blocks/compute.rs +++ b/crates/brk_computer/src/blocks/compute.rs @@ -53,7 +53,7 @@ impl Vecs { let exit = exit.clone(); self.db.run_bg(move |db| { let _lock = exit.lock(); - db.compact() + db.compact_deferred_default() }); Ok(()) } diff --git a/crates/brk_computer/src/cointime/compute.rs b/crates/brk_computer/src/cointime/compute.rs index 9f13364cc..270da0898 100644 --- a/crates/brk_computer/src/cointime/compute.rs +++ b/crates/brk_computer/src/cointime/compute.rs @@ -85,7 +85,7 @@ impl Vecs { let exit = exit.clone(); self.db.run_bg(move |db| { let _lock = exit.lock(); - db.compact() + db.compact_deferred_default() }); Ok(()) } diff --git a/crates/brk_computer/src/distribution/vecs.rs b/crates/brk_computer/src/distribution/vecs.rs index ad830acd8..a2a32205c 100644 --- a/crates/brk_computer/src/distribution/vecs.rs +++ b/crates/brk_computer/src/distribution/vecs.rs @@ -504,7 +504,7 @@ impl Vecs { let exit = exit.clone(); self.db.run_bg(move |db| { let _lock = exit.lock(); - db.compact() + db.compact_deferred_default() }); Ok(()) } diff --git a/crates/brk_computer/src/indexes/mod.rs b/crates/brk_computer/src/indexes/mod.rs index c0a8e59ef..55f806160 100644 --- a/crates/brk_computer/src/indexes/mod.rs +++ b/crates/brk_computer/src/indexes/mod.rs @@ -217,7 +217,7 @@ impl Vecs { let exit = exit.clone(); self.db.run_bg(move |db| { let _lock = exit.lock(); - db.compact() + db.compact_deferred_default() }); Ok(starting_indexes) } diff --git a/crates/brk_computer/src/indicators/compute.rs b/crates/brk_computer/src/indicators/compute.rs index 9bcdb5849..a4015fdc3 100644 --- a/crates/brk_computer/src/indicators/compute.rs +++ b/crates/brk_computer/src/indicators/compute.rs @@ -204,7 +204,7 @@ impl Vecs { let exit = exit.clone(); self.db.run_bg(move |db| { let _lock = exit.lock(); - db.compact() + db.compact_deferred_default() }); Ok(()) } diff --git a/crates/brk_computer/src/inputs/compute.rs b/crates/brk_computer/src/inputs/compute.rs index f005d72bd..7a33c119d 100644 --- a/crates/brk_computer/src/inputs/compute.rs +++ b/crates/brk_computer/src/inputs/compute.rs @@ -25,7 +25,7 @@ impl Vecs { let exit = exit.clone(); self.db.run_bg(move |db| { let _lock = exit.lock(); - db.compact() + db.compact_deferred_default() }); Ok(()) } diff --git a/crates/brk_computer/src/investing/compute.rs b/crates/brk_computer/src/investing/compute.rs index 2633bd654..c89456bd5 100644 --- a/crates/brk_computer/src/investing/compute.rs +++ b/crates/brk_computer/src/investing/compute.rs @@ -275,7 +275,7 @@ impl Vecs { let exit = exit.clone(); self.db.run_bg(move |db| { let _lock = exit.lock(); - db.compact() + db.compact_deferred_default() }); Ok(()) } diff --git a/crates/brk_computer/src/market/compute.rs b/crates/brk_computer/src/market/compute.rs index d67e57776..3992ada97 100644 --- a/crates/brk_computer/src/market/compute.rs +++ b/crates/brk_computer/src/market/compute.rs @@ -57,7 +57,7 @@ impl Vecs { let exit = exit.clone(); self.db.run_bg(move |db| { let _lock = exit.lock(); - db.compact() + db.compact_deferred_default() }); Ok(()) } diff --git a/crates/brk_computer/src/mining/compute.rs b/crates/brk_computer/src/mining/compute.rs index 2d21d2ea7..a585cae3d 100644 --- a/crates/brk_computer/src/mining/compute.rs +++ b/crates/brk_computer/src/mining/compute.rs @@ -44,7 +44,7 @@ impl Vecs { let exit = exit.clone(); self.db.run_bg(move |db| { let _lock = exit.lock(); - db.compact() + db.compact_deferred_default() }); Ok(()) } diff --git a/crates/brk_computer/src/outputs/compute.rs b/crates/brk_computer/src/outputs/compute.rs index 6a15aaeda..790c41afa 100644 --- a/crates/brk_computer/src/outputs/compute.rs +++ b/crates/brk_computer/src/outputs/compute.rs @@ -34,7 +34,7 @@ impl Vecs { .compute(indexer, inputs, starting_indexes, exit)?; self.db.run_bg(move |db| { let _lock = lock; - db.compact() + db.compact_deferred_default() }); Ok(()) } diff --git a/crates/brk_computer/src/pools/mod.rs b/crates/brk_computer/src/pools/mod.rs index 84e3c5604..e1d1ae0a5 100644 --- a/crates/brk_computer/src/pools/mod.rs +++ b/crates/brk_computer/src/pools/mod.rs @@ -108,7 +108,7 @@ impl Vecs { let exit = exit.clone(); self.db.run_bg(move |db| { let _lock = exit.lock(); - db.compact() + db.compact_deferred_default() }); Ok(()) } diff --git a/crates/brk_computer/src/positions.rs b/crates/brk_computer/src/positions.rs index 3686a8997..4cf35d0c3 100644 --- a/crates/brk_computer/src/positions.rs +++ b/crates/brk_computer/src/positions.rs @@ -51,7 +51,7 @@ impl Vecs { let exit = exit.clone(); self.db.run_bg(move |db| { let _lock = exit.lock(); - db.compact() + db.compact_deferred_default() }); Ok(()) } diff --git a/crates/brk_computer/src/prices/compute.rs b/crates/brk_computer/src/prices/compute.rs index af51b57f2..746583cf5 100644 --- a/crates/brk_computer/src/prices/compute.rs +++ b/crates/brk_computer/src/prices/compute.rs @@ -52,7 +52,7 @@ impl Vecs { let exit = exit.clone(); self.db.run_bg(move |db| { let _lock = exit.lock(); - db.compact() + db.compact_deferred_default() }); Ok(()) } diff --git a/crates/brk_computer/src/scripts/compute.rs b/crates/brk_computer/src/scripts/compute.rs index f2a98b8da..338579815 100644 --- a/crates/brk_computer/src/scripts/compute.rs +++ b/crates/brk_computer/src/scripts/compute.rs @@ -25,7 +25,7 @@ impl Vecs { let exit = exit.clone(); self.db.run_bg(move |db| { let _lock = exit.lock(); - db.compact() + db.compact_deferred_default() }); Ok(()) } diff --git a/crates/brk_computer/src/supply/compute.rs b/crates/brk_computer/src/supply/compute.rs index feaf800c7..be9834265 100644 --- a/crates/brk_computer/src/supply/compute.rs +++ b/crates/brk_computer/src/supply/compute.rs @@ -81,7 +81,7 @@ impl Vecs { let exit = exit.clone(); self.db.run_bg(move |db| { let _lock = exit.lock(); - db.compact() + db.compact_deferred_default() }); Ok(()) diff --git a/crates/brk_computer/src/transactions/compute.rs b/crates/brk_computer/src/transactions/compute.rs index 5768e31a1..52e49da9f 100644 --- a/crates/brk_computer/src/transactions/compute.rs +++ b/crates/brk_computer/src/transactions/compute.rs @@ -62,7 +62,7 @@ impl Vecs { let exit = exit.clone(); self.db.run_bg(move |db| { let _lock = exit.lock(); - db.compact() + db.compact_deferred_default() }); Ok(()) } diff --git a/crates/brk_indexer/src/lib.rs b/crates/brk_indexer/src/lib.rs index 0c714cff1..6afae02d7 100644 --- a/crates/brk_indexer/src/lib.rs +++ b/crates/brk_indexer/src/lib.rs @@ -1,6 +1,11 @@ #![doc = include_str!("../README.md")] -use std::{fs, path::Path, thread, time::Instant}; +use std::{ + fs, + path::Path, + thread::{self, sleep}, + time::{Duration, Instant}, +}; use brk_error::Result; use brk_iterator::Blocks; @@ -8,7 +13,7 @@ use brk_rpc::Client; use brk_types::Height; use fjall::PersistMode; use tracing::{debug, info}; -use vecdb::{Exit, ReadOnlyClone, ReadableVec, Ro, Rw, StorageMode}; +use vecdb::{Exit, RawDBError, ReadOnlyClone, ReadableVec, Ro, Rw, StorageMode}; mod constants; mod indexes; mod processor; @@ -259,6 +264,8 @@ impl Indexer { self.vecs.db.run_bg(move |db| { let _lock = lock; + sleep(Duration::from_secs(5)); + if !tasks.is_empty() { let i = Instant::now(); for task in tasks { @@ -269,11 +276,10 @@ impl Indexer { let i = Instant::now(); fjall_db .persist(PersistMode::SyncData) - .map_err(vecdb::RawDBError::other)?; + .map_err(RawDBError::other)?; info!("Stores persisted in {:?}", i.elapsed()); } - db.flush()?; db.compact()?; Ok(()) }); diff --git a/modules/brk-client/index.js b/modules/brk-client/index.js index aee5f7715..57be94919 100644 --- a/modules/brk-client/index.js +++ b/modules/brk-client/index.js @@ -6381,7 +6381,7 @@ function createTransferPattern(client, acc) { * @extends BrkClientBase */ class BrkClient extends BrkClientBase { - VERSION = "v0.2.3"; + VERSION = "v0.2.4"; INDEXES = /** @type {const} */ ([ "minute10", diff --git a/modules/brk-client/package.json b/modules/brk-client/package.json index d4b23136e..9ad99a5ea 100644 --- a/modules/brk-client/package.json +++ b/modules/brk-client/package.json @@ -40,5 +40,5 @@ "url": "git+https://github.com/bitcoinresearchkit/brk.git" }, "type": "module", - "version": "0.2.3" + "version": "0.2.4" } diff --git a/packages/brk_client/brk_client/__init__.py b/packages/brk_client/brk_client/__init__.py index b6358aaa0..7604d4e94 100644 --- a/packages/brk_client/brk_client/__init__.py +++ b/packages/brk_client/brk_client/__init__.py @@ -5679,7 +5679,7 @@ class SeriesTree: class BrkClient(BrkClientBase): """Main BRK client with series tree and API methods.""" - VERSION = "v0.2.3" + VERSION = "v0.2.4" INDEXES = [ "minute10", diff --git a/packages/brk_client/pyproject.toml b/packages/brk_client/pyproject.toml index bf08b1ed4..5b4392f2a 100644 --- a/packages/brk_client/pyproject.toml +++ b/packages/brk_client/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "brk-client" -version = "0.2.3" +version = "0.2.4" description = "Bitcoin on-chain analytics client — thousands of metrics, block explorer, and address index" readme = "README.md" requires-python = ">=3.9"