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
+3 -3
View File
@@ -7,7 +7,7 @@ use vecdb::{BinaryTransform, Database, Exit, ReadableVec, Rw, StorageMode, Versi
use crate::{
blocks, indexes,
internal::{
AmountPerBlockCumulativeWithSums, CachedWindowStarts, MaskSats, PercentRollingWindows,
AmountPerBlockCumulativeRolling, CachedWindowStarts, MaskSats, PercentRollingWindows,
RatioU64Bp16,
},
mining, prices,
@@ -22,7 +22,7 @@ pub struct Vecs<M: StorageMode = Rw> {
#[traversable(flatten)]
pub base: minor::Vecs<M>,
pub rewards: AmountPerBlockCumulativeWithSums<M>,
pub rewards: AmountPerBlockCumulativeRolling<M>,
#[traversable(rename = "dominance")]
pub dominance_rolling: PercentRollingWindows<BasisPoints16, M>,
}
@@ -39,7 +39,7 @@ impl Vecs {
let base = minor::Vecs::forced_import(db, slug, version, indexes, cached_starts)?;
let rewards = AmountPerBlockCumulativeWithSums::forced_import(
let rewards = AmountPerBlockCumulativeRolling::forced_import(
db,
&suffix("rewards"),
version,
+3 -3
View File
@@ -8,7 +8,7 @@ use vecdb::{
use crate::{
blocks, indexes,
internal::{
CachedWindowStarts, PerBlockCumulativeWithSums, PercentPerBlock, RatioU64Bp16,
CachedWindowStarts, PerBlockCumulativeRolling, PercentPerBlock, RatioU64Bp16,
},
};
@@ -17,7 +17,7 @@ pub struct Vecs<M: StorageMode = Rw> {
#[traversable(skip)]
slug: PoolSlug,
pub blocks_mined: PerBlockCumulativeWithSums<StoredU32, StoredU64, M>,
pub blocks_mined: PerBlockCumulativeRolling<StoredU32, StoredU64, M>,
pub dominance: PercentPerBlock<BasisPoints16, M>,
}
@@ -31,7 +31,7 @@ impl Vecs {
) -> Result<Self> {
let suffix = |s: &str| format!("{}_{s}", slug);
let blocks_mined = PerBlockCumulativeWithSums::forced_import(
let blocks_mined = PerBlockCumulativeRolling::forced_import(
db,
&suffix("blocks_mined"),
version + Version::ONE,