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
@@ -5,7 +5,7 @@ use vecdb::Database;
use super::Vecs;
use crate::{
indexes,
internal::{CachedWindowStarts, PerBlockCumulativeWithSums},
internal::{CachedWindowStarts, PerBlockCumulativeRolling},
};
impl Vecs {
@@ -16,28 +16,28 @@ impl Vecs {
cached_starts: &CachedWindowStarts,
) -> Result<Self> {
Ok(Self {
destroyed: PerBlockCumulativeWithSums::forced_import(
destroyed: PerBlockCumulativeRolling::forced_import(
db,
"cointime_value_destroyed",
version,
indexes,
cached_starts,
)?,
created: PerBlockCumulativeWithSums::forced_import(
created: PerBlockCumulativeRolling::forced_import(
db,
"cointime_value_created",
version,
indexes,
cached_starts,
)?,
stored: PerBlockCumulativeWithSums::forced_import(
stored: PerBlockCumulativeRolling::forced_import(
db,
"cointime_value_stored",
version,
indexes,
cached_starts,
)?,
vocdd: PerBlockCumulativeWithSums::forced_import(
vocdd: PerBlockCumulativeRolling::forced_import(
db,
"vocdd",
version + Version::ONE,
@@ -2,12 +2,12 @@ use brk_traversable::Traversable;
use brk_types::StoredF64;
use vecdb::{Rw, StorageMode};
use crate::internal::PerBlockCumulativeWithSums;
use crate::internal::PerBlockCumulativeRolling;
#[derive(Traversable)]
pub struct Vecs<M: StorageMode = Rw> {
pub destroyed: PerBlockCumulativeWithSums<StoredF64, StoredF64, M>,
pub created: PerBlockCumulativeWithSums<StoredF64, StoredF64, M>,
pub stored: PerBlockCumulativeWithSums<StoredF64, StoredF64, M>,
pub vocdd: PerBlockCumulativeWithSums<StoredF64, StoredF64, M>,
pub destroyed: PerBlockCumulativeRolling<StoredF64, StoredF64, M>,
pub created: PerBlockCumulativeRolling<StoredF64, StoredF64, M>,
pub stored: PerBlockCumulativeRolling<StoredF64, StoredF64, M>,
pub vocdd: PerBlockCumulativeRolling<StoredF64, StoredF64, M>,
}