global: veccached change

This commit is contained in:
nym21
2026-04-10 11:30:29 +02:00
parent 12aae503c9
commit 286256ebf0
118 changed files with 579 additions and 900 deletions

View File

@@ -38,10 +38,10 @@ impl Vecs {
let hash_rate = &self.rate.base.height;
for (sma, window) in [
(&mut self.rate.sma._1w.height, &lookback._1w),
(&mut self.rate.sma._1m.height, &lookback._1m),
(&mut self.rate.sma._1w.height, &lookback._1w.inner),
(&mut self.rate.sma._1m.height, &lookback._1m.inner),
(&mut self.rate.sma._2m.height, &lookback._2m),
(&mut self.rate.sma._1y.height, &lookback._1y),
(&mut self.rate.sma._1y.height, &lookback._1y.inner),
] {
sma.compute_rolling_average(starting_indexes.height, window, hash_rate, exit)?;
}

View File

@@ -6,7 +6,7 @@ use brk_types::Version;
use crate::{
indexes,
internal::{
CachedWindowStarts,
WindowStartVec, Windows,
db_utils::{finalize_db, open_db},
},
};
@@ -18,7 +18,7 @@ impl Vecs {
parent_path: &Path,
parent_version: Version,
indexes: &indexes::Vecs,
cached_starts: &CachedWindowStarts,
cached_starts: &Windows<&WindowStartVec>,
) -> Result<Self> {
let db = open_db(parent_path, super::DB_NAME, 1_000_000)?;
let version = parent_version;

View File

@@ -7,8 +7,8 @@ use crate::{
indexes,
internal::{
AmountPerBlockCumulative, AmountPerBlockCumulativeRolling, AmountPerBlockFull,
CachedWindowStarts, LazyPercentRollingWindows, OneMinusBp16, PercentPerBlock,
PercentRollingWindows, RatioRollingWindows,
LazyPercentRollingWindows, OneMinusBp16, PercentPerBlock, PercentRollingWindows,
RatioRollingWindows, WindowStartVec, Windows,
},
};
@@ -17,7 +17,7 @@ impl Vecs {
db: &Database,
version: Version,
indexes: &indexes::Vecs,
cached_starts: &CachedWindowStarts,
cached_starts: &Windows<&WindowStartVec>,
) -> Result<Self> {
let fee_dominance_rolling =
PercentRollingWindows::forced_import(db, "fee_dominance", version, indexes)?;