global: snapshot

This commit is contained in:
nym21
2026-03-15 00:57:53 +01:00
parent 0d177494d9
commit 9e36a4188a
50 changed files with 2765 additions and 1239 deletions

View File

@@ -22,7 +22,7 @@ impl Vecs {
let version = parent_version;
let count = CountVecs::forced_import(&db, version, indexes, cached_starts)?;
let value = ValueVecs::forced_import(&db, version, indexes)?;
let value = ValueVecs::forced_import(&db, version, indexes, cached_starts)?;
let adoption = AdoptionVecs::forced_import(&db, version, indexes)?;
let this = Self {

View File

@@ -14,7 +14,7 @@ impl Vecs {
starting_indexes: &Indexes,
exit: &Exit,
) -> Result<()> {
self.op_return.compute_with(
self.op_return.compute(
starting_indexes.height,
prices,
exit,

View File

@@ -3,20 +3,22 @@ use brk_types::Version;
use vecdb::Database;
use super::Vecs;
use crate::{indexes, internal::AmountPerBlockCumulative};
use crate::{indexes, internal::{AmountPerBlockCumulativeWithSums, CachedWindowStarts}};
impl Vecs {
pub(crate) fn forced_import(
db: &Database,
version: Version,
indexes: &indexes::Vecs,
cached_starts: &CachedWindowStarts,
) -> Result<Self> {
Ok(Self {
op_return: AmountPerBlockCumulative::forced_import(
op_return: AmountPerBlockCumulativeWithSums::forced_import(
db,
"op_return_value",
version,
indexes,
cached_starts,
)?,
})
}

View File

@@ -1,9 +1,9 @@
use brk_traversable::Traversable;
use vecdb::{Rw, StorageMode};
use crate::internal::AmountPerBlockCumulative;
use crate::internal::AmountPerBlockCumulativeWithSums;
#[derive(Traversable)]
pub struct Vecs<M: StorageMode = Rw> {
pub op_return: AmountPerBlockCumulative<M>,
pub op_return: AmountPerBlockCumulativeWithSums<M>,
}