global: snapshot part 4

This commit is contained in:
nym21
2026-03-20 14:27:10 +01:00
parent 1d671ea41f
commit 8f93ff9f68
47 changed files with 683 additions and 637 deletions
@@ -6,7 +6,7 @@ use vecdb::{Database, Exit, Rw, StorageMode};
use crate::{
indexes,
internal::{CachedWindowStarts, PerBlockCumulativeWithSums},
internal::{CachedWindowStarts, PerBlockCumulativeRolling},
};
use super::TotalAddrCountVecs;
@@ -14,9 +14,9 @@ use super::TotalAddrCountVecs;
/// New address count per block (global + per-type)
#[derive(Traversable)]
pub struct NewAddrCountVecs<M: StorageMode = Rw> {
pub all: PerBlockCumulativeWithSums<StoredU64, StoredU64, M>,
pub all: PerBlockCumulativeRolling<StoredU64, StoredU64, M>,
#[traversable(flatten)]
pub by_addr_type: ByAddrType<PerBlockCumulativeWithSums<StoredU64, StoredU64, M>>,
pub by_addr_type: ByAddrType<PerBlockCumulativeRolling<StoredU64, StoredU64, M>>,
}
impl NewAddrCountVecs {
@@ -26,7 +26,7 @@ impl NewAddrCountVecs {
indexes: &indexes::Vecs,
cached_starts: &CachedWindowStarts,
) -> Result<Self> {
let all = PerBlockCumulativeWithSums::forced_import(
let all = PerBlockCumulativeRolling::forced_import(
db,
"new_addr_count",
version,
@@ -35,7 +35,7 @@ impl NewAddrCountVecs {
)?;
let by_addr_type = ByAddrType::new_with_name(|name| {
PerBlockCumulativeWithSums::forced_import(
PerBlockCumulativeRolling::forced_import(
db,
&format!("{name}_new_addr_count"),
version,