global: snapshot

This commit is contained in:
nym21
2026-02-28 23:14:01 +01:00
parent a2bd7ca299
commit 1750c06369
50 changed files with 122 additions and 192 deletions

View File

@@ -3,7 +3,7 @@ use brk_types::{Height, StoredU32, StoredU64};
use vecdb::{EagerVec, PcoVec, Rw, StorageMode};
use crate::internal::{
BlockWindowStarts, ComputedFromHeightCumulativeSum, ConstantVecs, RollingWindows, WindowStarts,
ComputedFromHeightCumulativeSum, ConstantVecs, RollingWindows, WindowStarts,
};
#[derive(Traversable)]
@@ -56,14 +56,6 @@ impl Vecs {
}
}
/// Get the 2 block-count rolling window start heights (1h, 24h) for tx-derived metrics.
pub fn block_window_starts(&self) -> BlockWindowStarts<'_> {
BlockWindowStarts {
_1h: &self.height_1h_ago,
_24h: &self.height_24h_ago,
}
}
pub fn start_vec(&self, days: usize) -> &EagerVec<PcoVec<Height, Height>> {
match days {
1 => &self.height_24h_ago,