diff --git a/Cargo.lock b/Cargo.lock index 6190f7edf..37db97173 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -611,6 +611,7 @@ dependencies = [ "brk_vec", "color-eyre", "fjall", + "libc", "log", "rayon", ] @@ -1125,9 +1126,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.29" +version = "1.2.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c1599538de2394445747c8cf7935946e3cc27e9625f889d979bfb2aaf569362" +checksum = "deec109607ca693028562ed836a5f1c4b8bd77755c4e132fc5ce11b0b6211ae7" dependencies = [ "jobserver", "libc", @@ -3852,9 +3853,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.140" +version = "1.0.141" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +checksum = "30b9eff21ebe718216c6ec64e1d9ac57087aad11efc64e32002bce4a0d4c03d3" dependencies = [ "indexmap 2.10.0", "itoa", diff --git a/Cargo.toml b/Cargo.toml index 39381d099..8fb9db165 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,15 +48,19 @@ color-eyre = "0.6.5" derive_deref = "1.1.1" fjall = "2.11.1" jiff = "0.2.15" +libc = "0.2.174" log = { version = "0.4.27" } minreq = { version = "2.14.0", features = ["https", "serde_json"] } rayon = "1.10.0" -rmcp = { version = "0.3.0", features = ["transport-worker", "transport-streamable-http-server" ] } +rmcp = { version = "0.3.0", features = [ + "transport-worker", + "transport-streamable-http-server", +] } schemars = "1.0.4" serde = { version = "1.0.219" } serde_bytes = "0.11.17" serde_derive = "1.0.219" -serde_json = { version = "1.0.140", features = ["float_roundtrip"] } +serde_json = { version = "1.0.141", features = ["float_roundtrip"] } tabled = "0.20.0" tokio = { version = "1.46.1", features = ["rt-multi-thread"] } zerocopy = { version = "0.8.26" } diff --git a/crates/brk_computer/Cargo.toml b/crates/brk_computer/Cargo.toml index 7f5f19c30..6dbc6de4f 100644 --- a/crates/brk_computer/Cargo.toml +++ b/crates/brk_computer/Cargo.toml @@ -22,7 +22,7 @@ brk_vec = { workspace = true } color-eyre = { workspace = true } derive_deref = { workspace = true } fjall = { workspace = true } -libc = "0.2.174" +libc = { workspace = true } log = { workspace = true } rayon = { workspace = true } serde = { workspace = true } diff --git a/crates/brk_computer/src/all.rs b/crates/brk_computer/src/all.rs index d5c15f536..902614870 100644 --- a/crates/brk_computer/src/all.rs +++ b/crates/brk_computer/src/all.rs @@ -178,15 +178,15 @@ impl Vecs { exit, )?; - // self.cointime.compute( - // indexer, - // &self.indexes, - // &starting_indexes, - // self.fetched.as_ref(), - // &self.transactions, - // &self.stateful, - // exit, - // )?; + self.cointime.compute( + indexer, + &self.indexes, + &starting_indexes, + self.fetched.as_ref(), + &self.transactions, + &self.stateful, + exit, + )?; Ok(()) } diff --git a/crates/brk_computer/src/stateful/address_cohorts.rs b/crates/brk_computer/src/stateful/address_cohorts.rs index 583ccb333..83b984f09 100644 --- a/crates/brk_computer/src/stateful/address_cohorts.rs +++ b/crates/brk_computer/src/stateful/address_cohorts.rs @@ -1,4 +1,4 @@ -use std::{path::Path, time::Instant}; +use std::path::Path; use brk_core::{ AddressGroups, Bitcoin, ByAmountRange, ByGreatEqualAmount, ByLowerThanAmount, DateIndex, diff --git a/crates/brk_computer/src/stateful/mod.rs b/crates/brk_computer/src/stateful/mod.rs index 0cf56e42b..efb18c109 100644 --- a/crates/brk_computer/src/stateful/mod.rs +++ b/crates/brk_computer/src/stateful/mod.rs @@ -1,4 +1,4 @@ -use std::{cmp::Ordering, collections::BTreeMap, mem, path::Path, thread, time::Instant}; +use std::{cmp::Ordering, collections::BTreeMap, mem, path::Path, thread}; use brk_core::{ AnyAddressDataIndexEnum, AnyAddressIndex, ByAddressType, ByAnyAddress, CheckedSub, DateIndex, @@ -531,6 +531,8 @@ impl Vecs { starting_indexes: &mut Indexes, exit: &Exit, ) -> color_eyre::Result<()> { + unsafe { libc::sync() } + let height_to_first_outputindex = &indexer.vecs.height_to_first_outputindex; let height_to_first_inputindex = &indexer.vecs.height_to_first_inputindex; let height_to_first_p2aaddressindex = &indexer.vecs.height_to_first_p2aaddressindex; @@ -1265,6 +1267,10 @@ impl Vecs { exit.block(); } + unsafe { libc::sync() } + + // return Ok(()); + info!("Computing overlapping..."); self.utxo_cohorts @@ -1347,6 +1353,8 @@ impl Vecs { self.utxo_cohorts .compute_rest_part1(indexer, indexes, fetched, starting_indexes, exit)?; + unsafe { libc::sync() } + self.address_cohorts.compute_rest_part1( indexer, indexes, diff --git a/crates/brk_computer/src/stateful/utxo_cohorts.rs b/crates/brk_computer/src/stateful/utxo_cohorts.rs index 8f25930e1..cadbdd428 100644 --- a/crates/brk_computer/src/stateful/utxo_cohorts.rs +++ b/crates/brk_computer/src/stateful/utxo_cohorts.rs @@ -1,4 +1,4 @@ -use std::{collections::BTreeMap, ops::ControlFlow, path::Path, time::Instant}; +use std::{collections::BTreeMap, ops::ControlFlow, path::Path}; use brk_core::{ Bitcoin, ByAgeRange, ByAmountRange, ByEpoch, ByGreatEqualAmount, ByLowerThanAmount, ByMaxAge, diff --git a/crates/brk_indexer/Cargo.toml b/crates/brk_indexer/Cargo.toml index e03022a31..bd2ffc2bf 100644 --- a/crates/brk_indexer/Cargo.toml +++ b/crates/brk_indexer/Cargo.toml @@ -18,5 +18,6 @@ brk_store = { workspace = true } brk_vec = { workspace = true } color-eyre = { workspace = true } fjall = { workspace = true } +libc = { workspace = true } log = { workspace = true } rayon = { workspace = true } diff --git a/crates/brk_indexer/src/lib.rs b/crates/brk_indexer/src/lib.rs index 4d1e1ae0a..bae40291d 100644 --- a/crates/brk_indexer/src/lib.rs +++ b/crates/brk_indexer/src/lib.rs @@ -761,6 +761,8 @@ impl Indexer { export_if_needed(stores, vecs, idxs.height, true, exit)?; + unsafe { libc::sync() } + Ok(starting_indexes) } } diff --git a/update.sh b/update.sh index d6951dfc1..66347cd1e 100755 --- a/update.sh +++ b/update.sh @@ -4,4 +4,4 @@ cargo clean rustup update cargo upgrade --incompatible cargo update -cargo build --all-targets +cargo build --package brk -r