mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 06:39:58 -07:00
global: big snapshot part 2
This commit is contained in:
@@ -125,14 +125,6 @@ impl Vecs {
|
||||
exit,
|
||||
)?;
|
||||
|
||||
self.subsidy_dominance
|
||||
.compute_binary::<Sats, Sats, RatioSatsBp16>(
|
||||
starting_indexes.height,
|
||||
&self.subsidy.cumulative.sats.height,
|
||||
&self.coinbase.cumulative.sats.height,
|
||||
exit,
|
||||
)?;
|
||||
|
||||
self.fee_to_subsidy_ratio
|
||||
.compute_binary::<Dollars, Dollars, RatioDollarsBp32, _, _>(
|
||||
starting_indexes.height,
|
||||
|
||||
@@ -7,8 +7,8 @@ use crate::{
|
||||
indexes,
|
||||
internal::{
|
||||
AmountPerBlockCumulative, AmountPerBlockCumulativeRolling, AmountPerBlockFull,
|
||||
LazyPercentRollingWindows, OneMinusBp16, PercentCumulativeRolling, PercentPerBlock,
|
||||
RatioRollingWindows, WindowStartVec, Windows,
|
||||
LazyPercentCumulativeRolling, OneMinusBp16, PercentCumulativeRolling, RatioRollingWindows,
|
||||
WindowStartVec, Windows,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -20,12 +20,12 @@ impl Vecs {
|
||||
cached_starts: &Windows<&WindowStartVec>,
|
||||
) -> Result<Self> {
|
||||
let fee_dominance =
|
||||
PercentCumulativeRolling::forced_import_flat(db, "fee_dominance", version, indexes)?;
|
||||
PercentCumulativeRolling::forced_import(db, "fee_dominance", version, indexes)?;
|
||||
|
||||
let subsidy_dominance_rolling = LazyPercentRollingWindows::from_rolling::<OneMinusBp16>(
|
||||
let subsidy_dominance = LazyPercentCumulativeRolling::from_source::<OneMinusBp16>(
|
||||
"subsidy_dominance",
|
||||
version,
|
||||
&fee_dominance.rolling,
|
||||
&fee_dominance,
|
||||
);
|
||||
|
||||
Ok(Self {
|
||||
@@ -52,13 +52,7 @@ impl Vecs {
|
||||
indexes,
|
||||
)?,
|
||||
fee_dominance,
|
||||
subsidy_dominance: PercentPerBlock::forced_import(
|
||||
db,
|
||||
"subsidy_dominance",
|
||||
version,
|
||||
indexes,
|
||||
)?,
|
||||
subsidy_dominance_rolling,
|
||||
subsidy_dominance,
|
||||
fee_to_subsidy_ratio: RatioRollingWindows::forced_import(
|
||||
db,
|
||||
"fee_to_subsidy_ratio",
|
||||
|
||||
@@ -4,7 +4,7 @@ use vecdb::{EagerVec, PcoVec, Rw, StorageMode};
|
||||
|
||||
use crate::internal::{
|
||||
AmountPerBlockCumulative, AmountPerBlockCumulativeRolling, AmountPerBlockFull,
|
||||
LazyPercentRollingWindows, PercentCumulativeRolling, PercentPerBlock, RatioRollingWindows,
|
||||
LazyPercentCumulativeRolling, PercentCumulativeRolling, RatioRollingWindows,
|
||||
};
|
||||
|
||||
#[derive(Traversable)]
|
||||
@@ -17,9 +17,7 @@ pub struct Vecs<M: StorageMode = Rw> {
|
||||
#[traversable(wrap = "fees", rename = "dominance")]
|
||||
pub fee_dominance: PercentCumulativeRolling<BasisPoints16, M>,
|
||||
#[traversable(wrap = "subsidy", rename = "dominance")]
|
||||
pub subsidy_dominance: PercentPerBlock<BasisPoints16, M>,
|
||||
#[traversable(wrap = "subsidy", rename = "dominance")]
|
||||
pub subsidy_dominance_rolling: LazyPercentRollingWindows<BasisPoints16>,
|
||||
pub subsidy_dominance: LazyPercentCumulativeRolling<BasisPoints16>,
|
||||
#[traversable(wrap = "fees", rename = "to_subsidy_ratio")]
|
||||
pub fee_to_subsidy_ratio: RatioRollingWindows<BasisPoints32, M>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user