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
@@ -19,7 +19,7 @@ use vecdb::{AnyStoredVec, AnyVec, Database, Exit, Rw, StorageMode, WritableVec};
use crate::{
indexes,
internal::{CachedWindowStarts, PerBlockRollingAverage},
internal::{PerBlockRollingAverage, WindowStartVec, Windows},
};
/// Per-block activity counts - reset each block.
@@ -77,7 +77,7 @@ impl ActivityCountVecs {
name: &str,
version: Version,
indexes: &indexes::Vecs,
cached_starts: &CachedWindowStarts,
cached_starts: &Windows<&WindowStartVec>,
) -> Result<Self> {
Ok(Self {
reactivated: PerBlockRollingAverage::forced_import(
@@ -174,7 +174,7 @@ impl AddrTypeToActivityCountVecs {
name: &str,
version: Version,
indexes: &indexes::Vecs,
cached_starts: &CachedWindowStarts,
cached_starts: &Windows<&WindowStartVec>,
) -> Result<Self> {
Ok(Self::from(ByAddrType::<ActivityCountVecs>::new_with_name(
|type_name| {
@@ -246,7 +246,7 @@ impl AddrActivityVecs {
name: &str,
version: Version,
indexes: &indexes::Vecs,
cached_starts: &CachedWindowStarts,
cached_starts: &Windows<&WindowStartVec>,
) -> Result<Self> {
Ok(Self {
all: ActivityCountVecs::forced_import(db, name, version, indexes, cached_starts)?,
@@ -4,7 +4,7 @@ use brk_types::{BasisPointsSigned32, StoredI64, StoredU64, Version};
use crate::{
indexes,
internal::{CachedWindowStarts, LazyRollingDeltasFromHeight},
internal::{LazyRollingDeltasFromHeight, WindowStartVec, Windows},
};
use super::AddrCountsVecs;
@@ -22,7 +22,7 @@ impl DeltaVecs {
pub(crate) fn new(
version: Version,
addr_count: &AddrCountsVecs,
cached_starts: &CachedWindowStarts,
cached_starts: &Windows<&WindowStartVec>,
indexes: &indexes::Vecs,
) -> Self {
let version = version + Version::TWO;
@@ -6,7 +6,7 @@ use vecdb::{Database, Exit, Rw, StorageMode};
use crate::{
indexes,
internal::{CachedWindowStarts, PerBlockCumulativeRolling},
internal::{PerBlockCumulativeRolling, WindowStartVec, Windows},
};
use super::TotalAddrCountVecs;
@@ -24,7 +24,7 @@ impl NewAddrCountVecs {
db: &Database,
version: Version,
indexes: &indexes::Vecs,
cached_starts: &CachedWindowStarts,
cached_starts: &Windows<&WindowStartVec>,
) -> Result<Self> {
let all = PerBlockCumulativeRolling::forced_import(
db,