global: snapshot

This commit is contained in:
nym21
2026-03-04 14:02:00 +01:00
parent 730e8bb4d4
commit 891f0dad9e
60 changed files with 300 additions and 643 deletions
@@ -27,7 +27,7 @@ impl GrowthRateVecs {
version: Version,
indexes: &indexes::Vecs,
) -> Result<Self> {
let all = PercentFromHeightDistribution::forced_import_bp16(
let all = PercentFromHeightDistribution::forced_import(
db,
"growth_rate",
version,
@@ -35,7 +35,7 @@ impl GrowthRateVecs {
)?;
let by_addresstype = ByAddressType::new_with_name(|name| {
PercentFromHeightDistribution::forced_import_bp16(
PercentFromHeightDistribution::forced_import(
db,
&format!("{name}_growth_rate"),
version,
@@ -19,8 +19,6 @@ use crate::distribution::metrics::{BasicCohortMetrics, CohortMetricsBase, Import
use super::super::traits::{CohortVecs, DynCohortVecs};
const VERSION: Version = Version::ZERO;
/// Address cohort with metrics and optional runtime state.
#[derive(Traversable)]
pub struct AddressCohortVecs<M: StorageMode = Rw> {
@@ -70,13 +68,13 @@ impl AddressCohortVecs {
addr_count: ComputedFromHeight::forced_import(
db,
&cfg.name("addr_count"),
version + VERSION,
version,
indexes,
)?,
addr_count_change_1m: ComputedFromHeight::forced_import(
db,
&cfg.name("addr_count_change_1m"),
version + VERSION,
version,
indexes,
)?,
})
@@ -67,8 +67,8 @@ pub(crate) fn process_blocks(
let height_to_first_txoutindex = &indexer.vecs.outputs.first_txoutindex;
let height_to_first_txinindex = &indexer.vecs.inputs.first_txinindex;
let height_to_tx_count = &transactions.count.tx_count.height;
let height_to_output_count = &outputs.count.total_count.full.sum_cumulative.sum.0;
let height_to_input_count = &inputs.count.full.sum_cumulative.sum.0;
let height_to_output_count = &outputs.count.total_count.full.sum;
let height_to_input_count = &inputs.count.full.sum;
let txindex_to_output_count = &indexes.txindex.output_count;
let txindex_to_input_count = &indexes.txindex.input_count;
@@ -69,7 +69,7 @@ impl<'a> ImportConfig<'a> {
suffix: &str,
offset: Version,
) -> Result<PercentFromHeight<BasisPoints16>> {
PercentFromHeight::forced_import_bp16(self.db, &self.name(suffix), self.version + offset, self.indexes)
PercentFromHeight::forced_import(self.db, &self.name(suffix), self.version + offset, self.indexes)
}
pub(crate) fn import_percent_bps16(
@@ -77,7 +77,7 @@ impl<'a> ImportConfig<'a> {
suffix: &str,
offset: Version,
) -> Result<PercentFromHeight<BasisPointsSigned16>> {
PercentFromHeight::forced_import_bps16(self.db, &self.name(suffix), self.version + offset, self.indexes)
PercentFromHeight::forced_import(self.db, &self.name(suffix), self.version + offset, self.indexes)
}
// --- Value types ---
@@ -121,7 +121,7 @@ impl<'a> ImportConfig<'a> {
}
pub(crate) fn import_percent_rolling_bp16(&self, suffix: &str, offset: Version) -> Result<PercentRollingWindows<BasisPoints16>> {
PercentRollingWindows::forced_import_bp16(self.db, &self.name(suffix), self.version + offset, self.indexes)
PercentRollingWindows::forced_import(self.db, &self.name(suffix), self.version + offset, self.indexes)
}
pub(crate) fn import_emas_1w_1m<T: NumericValue + JsonSchema>(&self, suffix: &str, offset: Version) -> Result<RollingEmas1w1m<T>> {
@@ -129,7 +129,7 @@ impl<'a> ImportConfig<'a> {
}
pub(crate) fn import_percent_emas_1w_1m_bp16(&self, suffix: &str, offset: Version) -> Result<PercentRollingEmas1w1m<BasisPoints16>> {
PercentRollingEmas1w1m::forced_import_bp16(self.db, &self.name(suffix), self.version + offset, self.indexes)
PercentRollingEmas1w1m::forced_import(self.db, &self.name(suffix), self.version + offset, self.indexes)
}
pub(crate) fn import_emas_2w(&self, suffix: &str, offset: Version) -> Result<RollingEmas2w> {