computer: distribution: replace Option but distinct structs

This commit is contained in:
nym21
2026-02-25 14:57:20 +01:00
parent f74115c6e2
commit 9e4fe62de2
53 changed files with 3398 additions and 1853 deletions

View File

@@ -8,7 +8,8 @@ use crate::internal::{ComputedFromHeightSumCum, ConstantVecs, RollingWindows, Wi
pub struct Vecs<M: StorageMode = Rw> {
pub block_count_target: ConstantVecs<StoredU64>,
pub block_count: ComputedFromHeightSumCum<StoredU32, M>,
// Rolling window starts (height-indexed only, no date aggregation needed)
pub block_count_sum: RollingWindows<StoredU32, M>,
pub height_24h_ago: M::Stored<EagerVec<PcoVec<Height, Height>>>,
pub height_3d_ago: M::Stored<EagerVec<PcoVec<Height, Height>>>,
pub height_1w_ago: M::Stored<EagerVec<PcoVec<Height, Height>>>,
@@ -39,8 +40,6 @@ pub struct Vecs<M: StorageMode = Rw> {
pub height_6y_ago: M::Stored<EagerVec<PcoVec<Height, Height>>>,
pub height_8y_ago: M::Stored<EagerVec<PcoVec<Height, Height>>>,
pub height_10y_ago: M::Stored<EagerVec<PcoVec<Height, Height>>>,
// Rolling window block counts
pub block_count_sum: RollingWindows<StoredU32, M>,
}
impl Vecs {

View File

@@ -7,7 +7,6 @@ use crate::internal::{ComputedFromHeightLast, ComputedHeightDerivedLast};
/// Difficulty metrics: raw difficulty, derived stats, adjustment, and countdown
#[derive(Traversable)]
pub struct Vecs<M: StorageMode = Rw> {
/// Raw difficulty with day1/period stats - merges with indexer's raw
pub raw: ComputedHeightDerivedLast<StoredF64>,
pub as_hash: ComputedFromHeightLast<StoredF32, M>,
pub adjustment: ComputedFromHeightLast<StoredF32, M>,