computer: snapshot

This commit is contained in:
nym21
2026-03-09 11:16:50 +01:00
parent 0bff57fb43
commit 3e8cf4a975
92 changed files with 853 additions and 825 deletions
@@ -13,7 +13,7 @@ impl Vecs {
distribution: &distribution::Vecs,
exit: &Exit,
) -> Result<()> {
let window_starts = blocks.count.window_starts();
let window_starts = blocks.lookback.window_starts();
let all_metrics = &distribution.utxo_cohorts.all.metrics;
let circulating_supply = &all_metrics.supply.total.sats.height;
@@ -16,7 +16,7 @@ impl Vecs {
) -> Result<()> {
self.vocdd_median_1y.compute_rolling_median_from_starts(
starting_indexes.height,
&blocks.count.height_1y_ago,
&blocks.lookback.height_1y_ago,
&value.vocdd.height,
exit,
)?;
@@ -3,7 +3,7 @@ use brk_types::Version;
use vecdb::Database;
use super::Vecs;
use crate::{indexes, internal::ValueFromHeight};
use crate::{indexes, internal::AmountFromHeight};
impl Vecs {
pub(crate) fn forced_import(
@@ -12,8 +12,13 @@ impl Vecs {
indexes: &indexes::Vecs,
) -> Result<Self> {
Ok(Self {
vaulted_supply: ValueFromHeight::forced_import(db, "vaulted_supply", version, indexes)?,
active_supply: ValueFromHeight::forced_import(db, "active_supply", version, indexes)?,
vaulted_supply: AmountFromHeight::forced_import(
db,
"vaulted_supply",
version,
indexes,
)?,
active_supply: AmountFromHeight::forced_import(db, "active_supply", version, indexes)?,
})
}
}
@@ -1,10 +1,10 @@
use brk_traversable::Traversable;
use vecdb::{Rw, StorageMode};
use crate::internal::ValueFromHeight;
use crate::internal::AmountFromHeight;
#[derive(Traversable)]
pub struct Vecs<M: StorageMode = Rw> {
pub vaulted_supply: ValueFromHeight<M>,
pub active_supply: ValueFromHeight<M>,
pub vaulted_supply: AmountFromHeight<M>,
pub active_supply: AmountFromHeight<M>,
}
@@ -16,7 +16,7 @@ impl Vecs {
activity: &activity::Vecs,
exit: &Exit,
) -> Result<()> {
let window_starts = blocks.count.window_starts();
let window_starts = blocks.lookback.window_starts();
let all_metrics = &distribution.utxo_cohorts.all.metrics;
let coinblocks_destroyed = &all_metrics.activity.coinblocks_destroyed;