mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 14:49:58 -07:00
global: BIG snapshot
This commit is contained in:
@@ -20,7 +20,6 @@ impl Vecs {
|
||||
indexes: &indexes::Vecs,
|
||||
outputs: &outputs::Vecs,
|
||||
) -> Result<Self> {
|
||||
let v0 = Version::ZERO;
|
||||
let full_stats = || {
|
||||
VecBuilderOptions::default()
|
||||
.add_average()
|
||||
@@ -34,7 +33,7 @@ impl Vecs {
|
||||
db,
|
||||
"p2a_count",
|
||||
Source::Compute,
|
||||
version + v0,
|
||||
version,
|
||||
indexes,
|
||||
full_stats(),
|
||||
)?;
|
||||
@@ -42,7 +41,7 @@ impl Vecs {
|
||||
db,
|
||||
"p2ms_count",
|
||||
Source::Compute,
|
||||
version + v0,
|
||||
version,
|
||||
indexes,
|
||||
full_stats(),
|
||||
)?;
|
||||
@@ -50,7 +49,7 @@ impl Vecs {
|
||||
db,
|
||||
"p2pk33_count",
|
||||
Source::Compute,
|
||||
version + v0,
|
||||
version,
|
||||
indexes,
|
||||
full_stats(),
|
||||
)?;
|
||||
@@ -58,7 +57,7 @@ impl Vecs {
|
||||
db,
|
||||
"p2pk65_count",
|
||||
Source::Compute,
|
||||
version + v0,
|
||||
version,
|
||||
indexes,
|
||||
full_stats(),
|
||||
)?;
|
||||
@@ -66,7 +65,7 @@ impl Vecs {
|
||||
db,
|
||||
"p2pkh_count",
|
||||
Source::Compute,
|
||||
version + v0,
|
||||
version,
|
||||
indexes,
|
||||
full_stats(),
|
||||
)?;
|
||||
@@ -74,7 +73,7 @@ impl Vecs {
|
||||
db,
|
||||
"p2sh_count",
|
||||
Source::Compute,
|
||||
version + v0,
|
||||
version,
|
||||
indexes,
|
||||
full_stats(),
|
||||
)?;
|
||||
@@ -82,7 +81,7 @@ impl Vecs {
|
||||
db,
|
||||
"p2tr_count",
|
||||
Source::Compute,
|
||||
version + v0,
|
||||
version,
|
||||
indexes,
|
||||
full_stats(),
|
||||
)?;
|
||||
@@ -90,7 +89,7 @@ impl Vecs {
|
||||
db,
|
||||
"p2wpkh_count",
|
||||
Source::Compute,
|
||||
version + v0,
|
||||
version,
|
||||
indexes,
|
||||
full_stats(),
|
||||
)?;
|
||||
@@ -98,7 +97,7 @@ impl Vecs {
|
||||
db,
|
||||
"p2wsh_count",
|
||||
Source::Compute,
|
||||
version + v0,
|
||||
version,
|
||||
indexes,
|
||||
full_stats(),
|
||||
)?;
|
||||
@@ -108,7 +107,7 @@ impl Vecs {
|
||||
db,
|
||||
"segwit_count",
|
||||
Source::Compute,
|
||||
version + v0,
|
||||
version,
|
||||
indexes,
|
||||
full_stats(),
|
||||
)?;
|
||||
@@ -119,7 +118,7 @@ impl Vecs {
|
||||
let indexes_to_taproot_adoption =
|
||||
LazyVecsFrom2FromHeight::from_height_and_txindex::<PercentageU64F32>(
|
||||
"taproot_adoption",
|
||||
version + v0,
|
||||
version,
|
||||
indexes_to_p2tr_count.height.u().boxed_clone(),
|
||||
outputs.count.indexes_to_count.height.sum.u().boxed_clone(),
|
||||
&indexes_to_p2tr_count,
|
||||
@@ -128,7 +127,7 @@ impl Vecs {
|
||||
let indexes_to_segwit_adoption =
|
||||
LazyVecsFrom2FromHeight::from_height_and_txindex::<PercentageU64F32>(
|
||||
"segwit_adoption",
|
||||
version + v0,
|
||||
version,
|
||||
indexes_to_segwit_count.height.u().boxed_clone(),
|
||||
outputs.count.indexes_to_count.height.sum.u().boxed_clone(),
|
||||
&indexes_to_segwit_count,
|
||||
@@ -149,7 +148,7 @@ impl Vecs {
|
||||
db,
|
||||
"opreturn_count",
|
||||
Source::Compute,
|
||||
version + v0,
|
||||
version,
|
||||
indexes,
|
||||
full_stats(),
|
||||
)?,
|
||||
@@ -157,7 +156,7 @@ impl Vecs {
|
||||
db,
|
||||
"emptyoutput_count",
|
||||
Source::Compute,
|
||||
version + v0,
|
||||
version,
|
||||
indexes,
|
||||
full_stats(),
|
||||
)?,
|
||||
@@ -165,7 +164,7 @@ impl Vecs {
|
||||
db,
|
||||
"unknownoutput_count",
|
||||
Source::Compute,
|
||||
version + v0,
|
||||
version,
|
||||
indexes,
|
||||
full_stats(),
|
||||
)?,
|
||||
|
||||
@@ -20,7 +20,7 @@ impl Vecs {
|
||||
let db = Database::open(&parent_path.join(super::DB_NAME))?;
|
||||
db.set_min_len(PAGE_SIZE * 50_000_000)?;
|
||||
|
||||
let version = parent_version + Version::ZERO;
|
||||
let version = parent_version;
|
||||
let compute_dollars = price.is_some();
|
||||
|
||||
let count = CountVecs::forced_import(&db, version, indexes, outputs)?;
|
||||
|
||||
@@ -15,16 +15,13 @@ impl Vecs {
|
||||
indexes: &indexes::Vecs,
|
||||
compute_dollars: bool,
|
||||
) -> Result<Self> {
|
||||
let v0 = Version::ZERO;
|
||||
|
||||
let height_to_opreturn_value =
|
||||
EagerVec::forced_import(db, "opreturn_value", version + v0)?;
|
||||
let height_to_opreturn_value = EagerVec::forced_import(db, "opreturn_value", version)?;
|
||||
|
||||
let indexes_to_opreturn_value = ComputedValueVecsFromHeight::forced_import(
|
||||
db,
|
||||
"opreturn_value",
|
||||
Source::Vec(height_to_opreturn_value.boxed_clone()),
|
||||
version + v0,
|
||||
version,
|
||||
VecBuilderOptions::default()
|
||||
.add_sum()
|
||||
.add_cumulative()
|
||||
|
||||
Reference in New Issue
Block a user