global: snapshot

This commit is contained in:
nym21
2026-03-13 16:27:10 +01:00
parent b2a1251774
commit 3709ceff8e
168 changed files with 2007 additions and 2008 deletions
@@ -3,7 +3,7 @@ use brk_types::Version;
use vecdb::{Database, EagerVec, ImportableVec};
use super::Vecs;
use crate::internal::ComputedPerTxDistribution;
use crate::internal::PerTxDistribution;
/// Bump this when fee/feerate aggregation logic changes (e.g., skip coinbase).
const VERSION: Version = Version::new(2);
@@ -14,8 +14,8 @@ impl Vecs {
Ok(Self {
input_value: EagerVec::forced_import(db, "input_value", version)?,
output_value: EagerVec::forced_import(db, "output_value", version)?,
fee: ComputedPerTxDistribution::forced_import(db, "fee", v)?,
fee_rate: ComputedPerTxDistribution::forced_import(db, "fee_rate", v)?,
fee: PerTxDistribution::forced_import(db, "fee", v)?,
fee_rate: PerTxDistribution::forced_import(db, "fee_rate", v)?,
})
}
}
@@ -2,12 +2,12 @@ use brk_traversable::Traversable;
use brk_types::{FeeRate, Sats, TxIndex};
use vecdb::{EagerVec, PcoVec, Rw, StorageMode};
use crate::internal::ComputedPerTxDistribution;
use crate::internal::PerTxDistribution;
#[derive(Traversable)]
pub struct Vecs<M: StorageMode = Rw> {
pub input_value: M::Stored<EagerVec<PcoVec<TxIndex, Sats>>>,
pub output_value: M::Stored<EagerVec<PcoVec<TxIndex, Sats>>>,
pub fee: ComputedPerTxDistribution<Sats, M>,
pub fee_rate: ComputedPerTxDistribution<FeeRate, M>,
pub fee: PerTxDistribution<Sats, M>,
pub fee_rate: PerTxDistribution<FeeRate, M>,
}