vecs: part 10

This commit is contained in:
nym21
2025-07-25 20:22:54 +02:00
parent 49a66f72fc
commit dfc286b393
69 changed files with 1506 additions and 1323 deletions
@@ -1,10 +1,10 @@
use std::{ops::Deref, path::Path};
use std::{ops::Deref, path::Path, sync::Arc};
use brk_core::{Bitcoin, DateIndex, Dollars, Height, Result, StoredUsize, Version};
use brk_exit::Exit;
use brk_indexer::Indexer;
use brk_vec::{
AnyCollectableVec, AnyIterableVec, AnyVec, Computation, EagerVec, Format, VecIterator,
use brk_vecs::{
AnyCollectableVec, AnyIterableVec, AnyVec, Computation, EagerVec, File, Format, VecIterator,
};
use crate::{
@@ -35,7 +35,7 @@ pub struct Vecs {
impl Vecs {
#[allow(clippy::too_many_arguments)]
pub fn forced_import(
path: &Path,
file: &Arc<File>,
cohort_name: Option<&str>,
computation: Computation,
format: Format,
@@ -57,13 +57,13 @@ impl Vecs {
compute_dollars,
)?,
height_to_address_count: EagerVec::forced_import(
path,
file,
&suffix("address_count"),
version + VERSION + Version::ZERO,
format,
)?,
indexes_to_address_count: ComputedVecsFromHeight::forced_import(
path,
file,
&suffix("address_count"),
Source::None,
version + VERSION + Version::ZERO,
@@ -73,7 +73,7 @@ impl Vecs {
VecBuilderOptions::default().add_last(),
)?,
inner: common::Vecs::forced_import(
path,
file,
cohort_name,
computation,
format,
@@ -1,4 +1,4 @@
use std::path::Path;
use std::{path::Path, sync::Arc};
use brk_core::{
AddressGroups, Bitcoin, ByAmountRange, ByGreatEqualAmount, ByLowerThanAmount, DateIndex,
@@ -6,7 +6,7 @@ use brk_core::{
};
use brk_exit::Exit;
use brk_indexer::Indexer;
use brk_vec::{AnyIterableVec, Computation, Format};
use brk_vecs::{AnyIterableVec, Computation, File, Format};
use derive_deref::{Deref, DerefMut};
use rayon::prelude::*;
@@ -25,7 +25,7 @@ pub struct Vecs(AddressGroups<(GroupFilter, address_cohort::Vecs)>);
impl Vecs {
pub fn forced_import(
path: &Path,
file: &Arc<File>,
version: Version,
_computation: Computation,
format: Format,
@@ -37,7 +37,7 @@ impl Vecs {
AddressGroups {
amount_range: ByAmountRange {
_0sats: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_with_0sats"),
_computation,
format,
@@ -48,7 +48,7 @@ impl Vecs {
true,
)?,
_1sat_to_10sats: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_1sat_under_10sats"),
_computation,
format,
@@ -59,7 +59,7 @@ impl Vecs {
true,
)?,
_10sats_to_100sats: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_10sats_under_100sats"),
_computation,
format,
@@ -70,7 +70,7 @@ impl Vecs {
true,
)?,
_100sats_to_1k_sats: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_100sats_under_1k_sats"),
_computation,
format,
@@ -81,7 +81,7 @@ impl Vecs {
true,
)?,
_1k_sats_to_10k_sats: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_1k_sats_under_10k_sats"),
_computation,
format,
@@ -92,7 +92,7 @@ impl Vecs {
true,
)?,
_10k_sats_to_100k_sats: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_10k_sats_under_100k_sats"),
_computation,
format,
@@ -103,7 +103,7 @@ impl Vecs {
true,
)?,
_100k_sats_to_1m_sats: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_100k_sats_under_1m_sats"),
_computation,
format,
@@ -114,7 +114,7 @@ impl Vecs {
true,
)?,
_1m_sats_to_10m_sats: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_1m_sats_under_10m_sats"),
_computation,
format,
@@ -125,7 +125,7 @@ impl Vecs {
true,
)?,
_10m_sats_to_1btc: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_10m_sats_under_1btc"),
_computation,
format,
@@ -136,7 +136,7 @@ impl Vecs {
true,
)?,
_1btc_to_10btc: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_1btc_under_10btc"),
_computation,
format,
@@ -147,7 +147,7 @@ impl Vecs {
true,
)?,
_10btc_to_100btc: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_10btc_under_100btc"),
_computation,
format,
@@ -158,7 +158,7 @@ impl Vecs {
true,
)?,
_100btc_to_1k_btc: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_100btc_under_1k_btc"),
_computation,
format,
@@ -169,7 +169,7 @@ impl Vecs {
true,
)?,
_1k_btc_to_10k_btc: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_1k_btc_under_10k_btc"),
_computation,
format,
@@ -180,7 +180,7 @@ impl Vecs {
true,
)?,
_10k_btc_to_100k_btc: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_10k_btc_under_100k_btc"),
_computation,
format,
@@ -191,7 +191,7 @@ impl Vecs {
true,
)?,
_100k_btc_or_more: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_100k_btc"),
_computation,
format,
@@ -204,7 +204,7 @@ impl Vecs {
},
lt_amount: ByLowerThanAmount {
_10sats: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_under_10sats"),
_computation,
format,
@@ -215,7 +215,7 @@ impl Vecs {
true,
)?,
_100sats: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_under_100sats"),
_computation,
format,
@@ -226,7 +226,7 @@ impl Vecs {
true,
)?,
_1k_sats: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_under_1k_sats"),
_computation,
format,
@@ -237,7 +237,7 @@ impl Vecs {
true,
)?,
_10k_sats: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_under_10k_sats"),
_computation,
format,
@@ -248,7 +248,7 @@ impl Vecs {
true,
)?,
_100k_sats: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_under_100k_sats"),
_computation,
format,
@@ -259,7 +259,7 @@ impl Vecs {
true,
)?,
_1m_sats: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_under_1m_sats"),
_computation,
format,
@@ -270,7 +270,7 @@ impl Vecs {
true,
)?,
_10m_sats: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_under_10m_sats"),
_computation,
format,
@@ -281,7 +281,7 @@ impl Vecs {
true,
)?,
_1btc: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_under_1btc"),
_computation,
format,
@@ -292,7 +292,7 @@ impl Vecs {
true,
)?,
_10btc: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_under_10btc"),
_computation,
format,
@@ -303,7 +303,7 @@ impl Vecs {
true,
)?,
_100btc: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_under_100btc"),
_computation,
format,
@@ -314,7 +314,7 @@ impl Vecs {
true,
)?,
_1k_btc: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_under_1k_btc"),
_computation,
format,
@@ -325,7 +325,7 @@ impl Vecs {
true,
)?,
_10k_btc: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_under_10k_btc"),
_computation,
format,
@@ -336,7 +336,7 @@ impl Vecs {
true,
)?,
_100k_btc: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_under_100k_btc"),
_computation,
format,
@@ -349,7 +349,7 @@ impl Vecs {
},
ge_amount: ByGreatEqualAmount {
_1sat: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_1sat"),
_computation,
format,
@@ -360,7 +360,7 @@ impl Vecs {
true,
)?,
_10sats: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_10sats"),
_computation,
format,
@@ -371,7 +371,7 @@ impl Vecs {
true,
)?,
_100sats: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_100sats"),
_computation,
format,
@@ -382,7 +382,7 @@ impl Vecs {
true,
)?,
_1k_sats: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_1k_sats"),
_computation,
format,
@@ -393,7 +393,7 @@ impl Vecs {
true,
)?,
_10k_sats: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_10k_sats"),
_computation,
format,
@@ -404,7 +404,7 @@ impl Vecs {
true,
)?,
_100k_sats: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_100k_sats"),
_computation,
format,
@@ -415,7 +415,7 @@ impl Vecs {
true,
)?,
_1m_sats: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_1m_sats"),
_computation,
format,
@@ -426,7 +426,7 @@ impl Vecs {
true,
)?,
_10m_sats: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_10m_sats"),
_computation,
format,
@@ -437,7 +437,7 @@ impl Vecs {
true,
)?,
_1btc: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_1btc"),
_computation,
format,
@@ -448,7 +448,7 @@ impl Vecs {
true,
)?,
_10btc: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_10btc"),
_computation,
format,
@@ -459,7 +459,7 @@ impl Vecs {
true,
)?,
_100btc: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_100btc"),
_computation,
format,
@@ -470,7 +470,7 @@ impl Vecs {
true,
)?,
_1k_btc: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_1k_btc"),
_computation,
format,
@@ -481,7 +481,7 @@ impl Vecs {
true,
)?,
_10k_btc: address_cohort::Vecs::forced_import(
path,
file,
Some("addrs_above_10k_btc"),
_computation,
format,
@@ -1,5 +1,5 @@
use brk_core::{ByAddressType, Height};
use brk_vec::VecIterator;
use brk_vecs::VecIterator;
use derive_deref::{Deref, DerefMut};
use crate::stateful::addresstype_to_height_to_addresscount::AddressTypeToHeightToAddressCount;
@@ -1,6 +1,6 @@
use brk_core::{ByAddressType, Height, Result, StoredUsize};
use brk_exit::Exit;
use brk_vec::EagerVec;
use brk_vecs::EagerVec;
use derive_deref::{Deref, DerefMut};
use crate::stateful::addresstype_to_addresscount::AddressTypeToAddressCount;
@@ -1,6 +1,6 @@
use brk_core::{ByAddressType, StoredUsize};
use brk_exit::Exit;
use brk_vec::AnyCollectableVec;
use brk_vecs::AnyCollectableVec;
use derive_deref::{Deref, DerefMut};
use crate::{
+85 -85
View File
@@ -1,13 +1,13 @@
use std::path::Path;
use std::sync::Arc;
use brk_core::{
Bitcoin, DateIndex, Dollars, Height, Result, Sats, StoredF32, StoredF64, StoredUsize, Version,
};
use brk_exit::Exit;
use brk_indexer::Indexer;
use brk_vec::{
use brk_vecs::{
AnyCollectableVec, AnyIterableVec, AnyVec, CloneableAnyIterableVec, Computation, EagerVec,
Format, VecIterator,
File, Format, VecIterator,
};
use crate::{
@@ -128,7 +128,7 @@ pub struct Vecs {
impl Vecs {
#[allow(clippy::too_many_arguments)]
pub fn forced_import(
path: &Path,
file: &Arc<File>,
cohort_name: Option<&str>,
computation: Computation,
format: Format,
@@ -146,7 +146,7 @@ impl Vecs {
let dateindex_to_supply_in_profit = compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("supply_in_profit"),
version + VERSION + Version::ZERO,
format,
@@ -156,7 +156,7 @@ impl Vecs {
let dateindex_to_supply_even = compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("supply_even"),
version + VERSION + Version::ZERO,
format,
@@ -166,7 +166,7 @@ impl Vecs {
let dateindex_to_supply_in_loss = compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("supply_in_loss"),
version + VERSION + Version::ZERO,
format,
@@ -176,7 +176,7 @@ impl Vecs {
let dateindex_to_unrealized_profit = compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("unrealized_profit"),
version + VERSION + Version::ZERO,
format,
@@ -186,7 +186,7 @@ impl Vecs {
let dateindex_to_unrealized_loss = compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("unrealized_loss"),
version + VERSION + Version::ZERO,
format,
@@ -197,7 +197,7 @@ impl Vecs {
Ok(Self {
height_to_supply_in_profit: compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("supply_in_profit"),
version + VERSION + Version::ZERO,
format,
@@ -206,7 +206,7 @@ impl Vecs {
}),
indexes_to_supply_in_profit: compute_dollars.then(|| {
ComputedValueVecsFromDateIndex::forced_import(
path,
file,
&suffix("supply_in_profit"),
dateindex_to_supply_in_profit.as_ref().map(|v | v.boxed_clone()).into(),
version + VERSION + Version::ZERO,
@@ -221,7 +221,7 @@ impl Vecs {
dateindex_to_supply_in_profit,
height_to_supply_even: compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("supply_even"),
version + VERSION + Version::ZERO,
format,
@@ -230,7 +230,7 @@ impl Vecs {
}),
indexes_to_supply_even: compute_dollars.then(|| {
ComputedValueVecsFromDateIndex::forced_import(
path,
file,
&suffix("supply_even"),
dateindex_to_supply_even.as_ref().map(|v | v.boxed_clone()).into(),
version + VERSION + Version::ZERO,
@@ -245,7 +245,7 @@ impl Vecs {
dateindex_to_supply_even,
height_to_supply_in_loss: compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("supply_in_loss"),
version + VERSION + Version::ZERO,
format,
@@ -254,7 +254,7 @@ impl Vecs {
}),
indexes_to_supply_in_loss: compute_dollars.then(|| {
ComputedValueVecsFromDateIndex::forced_import(
path,
file,
&suffix("supply_in_loss"),
dateindex_to_supply_in_loss.as_ref().map(|v | v.boxed_clone()).into(),
version + VERSION + Version::ZERO,
@@ -269,7 +269,7 @@ impl Vecs {
dateindex_to_supply_in_loss,
height_to_unrealized_profit: compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("unrealized_profit"),
version + VERSION + Version::ZERO,
format,
@@ -278,7 +278,7 @@ impl Vecs {
}),
indexes_to_unrealized_profit: compute_dollars.then(|| {
ComputedVecsFromDateIndex::forced_import(
path,
file,
&suffix("unrealized_profit"),
dateindex_to_unrealized_profit.as_ref().map(|v | v.boxed_clone()).into(),
version + VERSION + Version::ZERO,
@@ -292,7 +292,7 @@ impl Vecs {
dateindex_to_unrealized_profit,
height_to_unrealized_loss: compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("unrealized_loss"),
version + VERSION + Version::ZERO,
format,
@@ -301,7 +301,7 @@ impl Vecs {
}),
height_to_min_price_paid: compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("min_price_paid"),
version + VERSION + Version::ZERO,
format,
@@ -310,7 +310,7 @@ impl Vecs {
}),
height_to_max_price_paid: compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("max_price_paid"),
version + VERSION + Version::ZERO,
format,
@@ -319,7 +319,7 @@ impl Vecs {
}),
indexes_to_unrealized_loss: compute_dollars.then(|| {
ComputedVecsFromDateIndex::forced_import(
path,
file,
&suffix("unrealized_loss"),
dateindex_to_unrealized_loss.as_ref().map(|v | v.boxed_clone()).into(),
version + VERSION + Version::ZERO,
@@ -333,7 +333,7 @@ impl Vecs {
dateindex_to_unrealized_loss,
height_to_realized_cap: compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("realized_cap"),
version + VERSION + Version::ZERO,
format,
@@ -342,7 +342,7 @@ impl Vecs {
}),
indexes_to_realized_cap: compute_dollars.then(|| {
ComputedVecsFromHeight::forced_import(
path,
file,
&suffix("realized_cap"),
Source::None,
version + VERSION + Version::ZERO,
@@ -355,7 +355,7 @@ impl Vecs {
}),
indexes_to_min_price_paid: compute_dollars.then(|| {
ComputedVecsFromHeight::forced_import(
path,
file,
&suffix("min_price_paid"),
Source::None,
version + VERSION + Version::ZERO,
@@ -368,7 +368,7 @@ impl Vecs {
}),
indexes_to_max_price_paid: compute_dollars.then(|| {
ComputedVecsFromHeight::forced_import(
path,
file,
&suffix("max_price_paid"),
Source::None,
version + VERSION + Version::ZERO,
@@ -380,13 +380,13 @@ impl Vecs {
.unwrap()
}),
height_to_supply: EagerVec::forced_import(
path,
file,
&suffix("supply"),
version + VERSION + Version::ZERO,
format,
)?,
height_to_supply_value: ComputedHeightValueVecs::forced_import(
path,
file,
&suffix("supply"),
Source::None,
version + VERSION + Version::ZERO,
@@ -394,7 +394,7 @@ impl Vecs {
compute_dollars,
)?,
indexes_to_supply: ComputedValueVecsFromDateIndex::forced_import(
path,
file,
&suffix("supply"),
Source::Compute,
version + VERSION + Version::ONE,
@@ -405,13 +405,13 @@ impl Vecs {
indexes,
)?,
height_to_utxo_count: EagerVec::forced_import(
path,
file,
&suffix("utxo_count"),
version + VERSION + Version::ZERO,
format,
)?,
indexes_to_utxo_count: ComputedVecsFromHeight::forced_import(
path,
file,
&suffix("utxo_count"),
Source::None,
version + VERSION + Version::ZERO,
@@ -422,7 +422,7 @@ impl Vecs {
)?,
indexes_to_realized_price: compute_dollars.then(|| {
ComputedVecsFromHeight::forced_import(
path,
file,
&suffix("realized_price"),
Source::Compute,
version + VERSION + Version::ZERO,
@@ -435,7 +435,7 @@ impl Vecs {
}),
indexes_to_realized_price_extra: compute_dollars.then(|| {
ComputedRatioVecsFromDateIndex::forced_import(
path,
file,
&suffix("realized_price"),
Source::None,
version + VERSION + Version::ZERO,
@@ -448,7 +448,7 @@ impl Vecs {
}),
height_to_realized_profit: compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("realized_profit"),
version + VERSION + Version::ZERO,
format,
@@ -457,7 +457,7 @@ impl Vecs {
}),
indexes_to_realized_profit: compute_dollars.then(|| {
ComputedVecsFromHeight::forced_import(
path,
file,
&suffix("realized_profit"),
Source::None,
version + VERSION + Version::ZERO,
@@ -472,7 +472,7 @@ impl Vecs {
}),
height_to_realized_loss: compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("realized_loss"),
version + VERSION + Version::ZERO,
format,
@@ -481,7 +481,7 @@ impl Vecs {
}),
indexes_to_realized_loss: compute_dollars.then(|| {
ComputedVecsFromHeight::forced_import(
path,
file,
&suffix("realized_loss"),
Source::None,
version + VERSION + Version::ZERO,
@@ -496,7 +496,7 @@ impl Vecs {
}),
indexes_to_negative_realized_loss: compute_dollars.then(|| {
ComputedVecsFromHeight::forced_import(
path,
file,
&suffix("negative_realized_loss"),
Source::Compute,
version + VERSION + Version::ONE,
@@ -509,7 +509,7 @@ impl Vecs {
}),
height_to_value_created: compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("value_created"),
version + VERSION + Version::ZERO,
format,
@@ -518,7 +518,7 @@ impl Vecs {
}),
indexes_to_value_created: compute_dollars.then(|| {
ComputedVecsFromHeight::forced_import(
path,
file,
&suffix("value_created"),
Source::None,
version + VERSION + Version::ZERO,
@@ -531,7 +531,7 @@ impl Vecs {
}),
indexes_to_realized_value: compute_dollars.then(|| {
ComputedVecsFromHeight::forced_import(
path,
file,
&suffix("realized_value"),
Source::Compute,
version + VERSION + Version::ZERO,
@@ -544,7 +544,7 @@ impl Vecs {
}),
height_to_adjusted_value_created: compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("adjusted_value_created"),
version + VERSION + Version::ZERO,
format,
@@ -553,7 +553,7 @@ impl Vecs {
}),
indexes_to_adjusted_value_created: compute_dollars.then(|| {
ComputedVecsFromHeight::forced_import(
path,
file,
&suffix("adjusted_value_created"),
Source::None,
version + VERSION + Version::ZERO,
@@ -566,7 +566,7 @@ impl Vecs {
}),
height_to_value_destroyed: compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("value_destroyed"),
version + VERSION + Version::ZERO,
format,
@@ -575,7 +575,7 @@ impl Vecs {
}),
indexes_to_value_destroyed: compute_dollars.then(|| {
ComputedVecsFromHeight::forced_import(
path,
file,
&suffix("value_destroyed"),
Source::None,
version + VERSION + Version::ZERO,
@@ -588,7 +588,7 @@ impl Vecs {
}),
height_to_adjusted_value_destroyed: compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("adjusted_value_destroyed"),
version + VERSION + Version::ZERO,
format,
@@ -597,7 +597,7 @@ impl Vecs {
}),
indexes_to_adjusted_value_destroyed: compute_dollars.then(|| {
ComputedVecsFromHeight::forced_import(
path,
file,
&suffix("adjusted_value_destroyed"),
Source::None,
version + VERSION + Version::ZERO,
@@ -610,7 +610,7 @@ impl Vecs {
}),
indexes_to_realized_cap_30d_change: compute_dollars.then(|| {
ComputedVecsFromDateIndex::forced_import(
path,
file,
&suffix("realized_cap_30d_change"),
Source::Compute,
version + VERSION + Version::ZERO,
@@ -623,7 +623,7 @@ impl Vecs {
}),
indexes_to_net_realized_profit_and_loss: compute_dollars.then(|| {
ComputedVecsFromHeight::forced_import(
path,
file,
&suffix("net_realized_profit_and_loss"),
Source::Compute,
version + VERSION + Version::ZERO,
@@ -638,7 +638,7 @@ impl Vecs {
}),
dateindex_to_sell_side_risk_ratio: compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("sell_side_risk_ratio"),
version + VERSION + Version::ONE,
format,
@@ -647,7 +647,7 @@ impl Vecs {
}),
dateindex_to_spent_output_profit_ratio: compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("spent_output_profit_ratio"),
version + VERSION + Version::ZERO,
format,
@@ -656,7 +656,7 @@ impl Vecs {
}),
dateindex_to_adjusted_spent_output_profit_ratio: compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("adjusted_spent_output_profit_ratio"),
version + VERSION + Version::ZERO,
format,
@@ -664,7 +664,7 @@ impl Vecs {
.unwrap()
}),
height_to_halved_supply_value: ComputedHeightValueVecs::forced_import(
path,
file,
&suffix("halved_supply"),
Source::Compute,
version + VERSION + Version::ZERO,
@@ -672,7 +672,7 @@ impl Vecs {
compute_dollars,
)?,
indexes_to_halved_supply: ComputedValueVecsFromDateIndex::forced_import(
path,
file,
&suffix("halved_supply"),
Source::Compute,
version + VERSION + Version::ZERO,
@@ -684,7 +684,7 @@ impl Vecs {
)?,
height_to_negative_unrealized_loss: compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("negative_unrealized_loss"),
version + VERSION + Version::ZERO,
format,
@@ -693,7 +693,7 @@ impl Vecs {
}),
indexes_to_negative_unrealized_loss: compute_dollars.then(|| {
ComputedVecsFromDateIndex::forced_import(
path,
file,
&suffix("negative_unrealized_loss"),
Source::Compute,
version + VERSION + Version::ZERO,
@@ -706,7 +706,7 @@ impl Vecs {
}),
height_to_net_unrealized_profit_and_loss: compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("net_unrealized_profit_and_loss"),
version + VERSION + Version::ZERO,
format,
@@ -715,7 +715,7 @@ impl Vecs {
}),
indexes_to_net_unrealized_profit_and_loss: compute_dollars.then(|| {
ComputedVecsFromDateIndex::forced_import(
path,
file,
&suffix("net_unrealized_profit_and_loss"),
Source::Compute,
version + VERSION + Version::ZERO,
@@ -729,7 +729,7 @@ impl Vecs {
height_to_net_unrealized_profit_and_loss_relative_to_market_cap: compute_dollars.then(
|| {
EagerVec::forced_import(
path,
file,
&suffix("net_unrealized_profit_and_loss_relative_to_market_cap"),
version + VERSION + Version::ONE,
format,
@@ -740,7 +740,7 @@ impl Vecs {
indexes_to_net_unrealized_profit_and_loss_relative_to_market_cap: compute_dollars.then(
|| {
ComputedVecsFromDateIndex::forced_import(
path,
file,
&suffix("net_unrealized_profit_and_loss_relative_to_market_cap"),
Source::Compute,
version + VERSION + Version::ONE,
@@ -754,7 +754,7 @@ impl Vecs {
),
indexes_to_realized_profit_relative_to_realized_cap: compute_dollars.then(|| {
ComputedVecsFromHeight::forced_import(
path,
file,
&suffix("realized_profit_relative_to_realized_cap"),
Source::Compute,
version + VERSION + Version::ZERO,
@@ -767,7 +767,7 @@ impl Vecs {
}),
indexes_to_realized_loss_relative_to_realized_cap: compute_dollars.then(|| {
ComputedVecsFromHeight::forced_import(
path,
file,
&suffix("realized_loss_relative_to_realized_cap"),
Source::Compute,
version + VERSION + Version::ZERO,
@@ -781,7 +781,7 @@ impl Vecs {
indexes_to_net_realized_profit_and_loss_relative_to_realized_cap: compute_dollars.then(
|| {
ComputedVecsFromHeight::forced_import(
path,
file,
&suffix("net_realized_profit_and_loss_relative_to_realized_cap"),
Source::Compute,
version + VERSION + Version::ONE,
@@ -795,7 +795,7 @@ impl Vecs {
),
height_to_supply_even_value: compute_dollars.then(|| {
ComputedHeightValueVecs::forced_import(
path,
file,
&suffix("supply_even"),
Source::None,
version + VERSION + Version::ZERO,
@@ -806,7 +806,7 @@ impl Vecs {
}),
height_to_supply_in_loss_value: compute_dollars.then(|| {
ComputedHeightValueVecs::forced_import(
path,
file,
&suffix("supply_in_loss"),
Source::None,
version + VERSION + Version::ZERO,
@@ -817,7 +817,7 @@ impl Vecs {
}),
height_to_supply_in_profit_value: compute_dollars.then(|| {
ComputedHeightValueVecs::forced_import(
path,
file,
&suffix("supply_in_profit"),
Source::None,
version + VERSION + Version::ZERO,
@@ -828,7 +828,7 @@ impl Vecs {
}),
height_to_supply_even_relative_to_own_supply: compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("supply_even_relative_to_own_supply"),
version + VERSION + Version::ONE,
format,
@@ -837,7 +837,7 @@ impl Vecs {
}),
height_to_supply_in_loss_relative_to_own_supply: compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("supply_in_loss_relative_to_own_supply"),
version + VERSION + Version::ONE,
format,
@@ -846,7 +846,7 @@ impl Vecs {
}),
height_to_supply_in_profit_relative_to_own_supply: compute_dollars.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("supply_in_profit_relative_to_own_supply"),
version + VERSION + Version::ONE,
format,
@@ -855,7 +855,7 @@ impl Vecs {
}),
indexes_to_supply_even_relative_to_own_supply: compute_dollars.then(|| {
ComputedVecsFromDateIndex::forced_import(
path,
file,
&suffix("supply_even_relative_to_own_supply"),
Source::Compute,
version + VERSION + Version::ONE,
@@ -868,7 +868,7 @@ impl Vecs {
}),
indexes_to_supply_in_loss_relative_to_own_supply: compute_dollars.then(|| {
ComputedVecsFromDateIndex::forced_import(
path,
file,
&suffix("supply_in_loss_relative_to_own_supply"),
Source::Compute,
version + VERSION + Version::ONE,
@@ -881,7 +881,7 @@ impl Vecs {
}),
indexes_to_supply_in_profit_relative_to_own_supply: compute_dollars.then(|| {
ComputedVecsFromDateIndex::forced_import(
path,
file,
&suffix("supply_in_profit_relative_to_own_supply"),
Source::Compute,
version + VERSION + Version::ONE,
@@ -894,7 +894,7 @@ impl Vecs {
}),
indexes_to_supply_relative_to_circulating_supply: compute_relative_to_all.then(|| {
ComputedVecsFromHeight::forced_import(
path,
file,
&suffix("supply_relative_to_circulating_supply"),
Source::Compute,
version + VERSION + Version::ONE,
@@ -909,7 +909,7 @@ impl Vecs {
&& compute_dollars)
.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("supply_even_relative_to_circulating_supply"),
version + VERSION + Version::ONE,
format,
@@ -920,7 +920,7 @@ impl Vecs {
&& compute_dollars)
.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("supply_in_loss_relative_to_circulating_supply"),
version + VERSION + Version::ONE,
format,
@@ -931,7 +931,7 @@ impl Vecs {
&& compute_dollars)
.then(|| {
EagerVec::forced_import(
path,
file,
&suffix("supply_in_profit_relative_to_circulating_supply"),
version + VERSION + Version::ONE,
format,
@@ -942,7 +942,7 @@ impl Vecs {
&& compute_dollars)
.then(|| {
ComputedVecsFromDateIndex::forced_import(
path,
file,
&suffix("supply_even_relative_to_circulating_supply"),
Source::Compute,
version + VERSION + Version::ONE,
@@ -957,7 +957,7 @@ impl Vecs {
&& compute_dollars)
.then(|| {
ComputedVecsFromDateIndex::forced_import(
path,
file,
&suffix("supply_in_loss_relative_to_circulating_supply"),
Source::Compute,
version + VERSION + Version::ONE,
@@ -972,7 +972,7 @@ impl Vecs {
&& compute_dollars)
.then(|| {
ComputedVecsFromDateIndex::forced_import(
path,
file,
&suffix("supply_in_profit_relative_to_circulating_supply"),
Source::Compute,
version + VERSION + Version::ONE,
@@ -984,19 +984,19 @@ impl Vecs {
.unwrap()
}),
height_to_satblocks_destroyed: EagerVec::forced_import(
path,
file,
&suffix("satblocks_destroyed"),
version + VERSION + Version::ZERO,
format,
)?,
height_to_satdays_destroyed: EagerVec::forced_import(
path,
file,
&suffix("satdays_destroyed"),
version + VERSION + Version::ZERO,
format,
)?,
indexes_to_coinblocks_destroyed: ComputedVecsFromHeight::forced_import(
path,
file,
&suffix("coinblocks_destroyed"),
Source::Compute,
version + VERSION + Version::TWO,
@@ -1006,7 +1006,7 @@ impl Vecs {
VecBuilderOptions::default().add_sum().add_cumulative(),
)?,
indexes_to_coindays_destroyed: ComputedVecsFromHeight::forced_import(
path,
file,
&suffix("coindays_destroyed"),
Source::Compute,
version + VERSION + Version::TWO,
@@ -1017,7 +1017,7 @@ impl Vecs {
)?,
indexes_to_net_realized_profit_and_loss_cumulative_30d_change: compute_dollars.then(|| {
ComputedVecsFromDateIndex::forced_import(
path,
file,
&suffix("net_realized_profit_and_loss_cumulative_30d_change"),
Source::Compute,
version + VERSION + Version::new(3),
@@ -1030,7 +1030,7 @@ impl Vecs {
}),
indexes_to_net_realized_profit_and_loss_cumulative_30d_change_relative_to_realized_cap: compute_dollars.then(|| {
ComputedVecsFromDateIndex::forced_import(
path,
file,
&suffix("net_realized_profit_and_loss_cumulative_30d_change_relative_to_realized_cap"),
Source::Compute,
version + VERSION + Version::new(3),
@@ -1043,7 +1043,7 @@ impl Vecs {
}),
indexes_to_net_realized_profit_and_loss_cumulative_30d_change_relative_to_market_cap: compute_dollars.then(|| {
ComputedVecsFromDateIndex::forced_import(
path,
file,
&suffix("net_realized_profit_and_loss_cumulative_30d_change_relative_to_market_cap"),
Source::Compute,
version + VERSION + Version::new(3),
+218 -207
View File
@@ -1,4 +1,4 @@
use std::{cmp::Ordering, collections::BTreeMap, mem, path::Path, thread};
use std::{cmp::Ordering, collections::BTreeMap, mem, path::Path, sync::Arc, thread};
use brk_core::{
AnyAddressDataIndexEnum, AnyAddressIndex, ByAddressType, ByAnyAddress, CheckedSub, DateIndex,
@@ -9,9 +9,9 @@ use brk_core::{
};
use brk_exit::Exit;
use brk_indexer::Indexer;
use brk_vec::{
AnyCollectableVec, AnyIndexedVec, AnyVec, CollectableVec, Computation, EagerVec, Format,
GenericStoredVec, IndexedVec, Mmap, StoredIndex, StoredVec, VecIterator,
use brk_vecs::{
AnyCollectableVec, AnyStampedVec, AnyVec, CollectableVec, Computation, EagerVec, File, Format,
GenericStoredVec, Reader, Stamp, StampedVec, StoredIndex, StoredVec, VecIterator,
};
use log::info;
use rayon::prelude::*;
@@ -71,16 +71,16 @@ pub struct Vecs {
pub utxo_cohorts: utxo_cohorts::Vecs,
pub address_cohorts: address_cohorts::Vecs,
pub p2pk33addressindex_to_anyaddressindex: IndexedVec<P2PK33AddressIndex, AnyAddressIndex>,
pub p2pk65addressindex_to_anyaddressindex: IndexedVec<P2PK65AddressIndex, AnyAddressIndex>,
pub p2pkhaddressindex_to_anyaddressindex: IndexedVec<P2PKHAddressIndex, AnyAddressIndex>,
pub p2shaddressindex_to_anyaddressindex: IndexedVec<P2SHAddressIndex, AnyAddressIndex>,
pub p2traddressindex_to_anyaddressindex: IndexedVec<P2TRAddressIndex, AnyAddressIndex>,
pub p2wpkhaddressindex_to_anyaddressindex: IndexedVec<P2WPKHAddressIndex, AnyAddressIndex>,
pub p2wshaddressindex_to_anyaddressindex: IndexedVec<P2WSHAddressIndex, AnyAddressIndex>,
pub p2aaddressindex_to_anyaddressindex: IndexedVec<P2AAddressIndex, AnyAddressIndex>,
pub loadedaddressindex_to_loadedaddressdata: IndexedVec<LoadedAddressIndex, LoadedAddressData>,
pub emptyaddressindex_to_emptyaddressdata: IndexedVec<EmptyAddressIndex, EmptyAddressData>,
pub p2pk33addressindex_to_anyaddressindex: StampedVec<P2PK33AddressIndex, AnyAddressIndex>,
pub p2pk65addressindex_to_anyaddressindex: StampedVec<P2PK65AddressIndex, AnyAddressIndex>,
pub p2pkhaddressindex_to_anyaddressindex: StampedVec<P2PKHAddressIndex, AnyAddressIndex>,
pub p2shaddressindex_to_anyaddressindex: StampedVec<P2SHAddressIndex, AnyAddressIndex>,
pub p2traddressindex_to_anyaddressindex: StampedVec<P2TRAddressIndex, AnyAddressIndex>,
pub p2wpkhaddressindex_to_anyaddressindex: StampedVec<P2WPKHAddressIndex, AnyAddressIndex>,
pub p2wshaddressindex_to_anyaddressindex: StampedVec<P2WSHAddressIndex, AnyAddressIndex>,
pub p2aaddressindex_to_anyaddressindex: StampedVec<P2AAddressIndex, AnyAddressIndex>,
pub loadedaddressindex_to_loadedaddressdata: StampedVec<LoadedAddressIndex, LoadedAddressData>,
pub emptyaddressindex_to_emptyaddressdata: StampedVec<EmptyAddressIndex, EmptyAddressData>,
pub indexes_to_address_count: ComputedVecsFromHeight<StoredUsize>,
pub indexes_to_empty_address_count: ComputedVecsFromHeight<StoredUsize>,
@@ -88,36 +88,34 @@ pub struct Vecs {
impl Vecs {
pub fn forced_import(
path: &Path,
file: &Arc<File>,
version: Version,
computation: Computation,
format: Format,
indexes: &indexes::Vecs,
fetched: Option<&fetched::Vecs>,
states_path: &Path,
) -> color_eyre::Result<Self> {
let compute_dollars = fetched.is_some();
let mut root_path = path.to_owned();
root_path.pop();
root_path.pop();
let states_path = root_path.join("states");
let chain_file = Arc::new(File::open(&states_path.join("chain"))?);
Ok(Self {
chain_state: StoredVec::forced_import(
&states_path,
&chain_file,
"chain",
version + VERSION + Version::ZERO,
Format::Raw,
)?,
height_to_unspendable_supply: EagerVec::forced_import(
path,
file,
"unspendable_supply",
version + VERSION + Version::ZERO,
format,
)?,
indexes_to_unspendable_supply: ComputedValueVecsFromHeight::forced_import(
path,
file,
"unspendable_supply",
Source::None,
version + VERSION + Version::ZERO,
@@ -128,13 +126,13 @@ impl Vecs {
indexes,
)?,
height_to_opreturn_supply: EagerVec::forced_import(
path,
file,
"opreturn_supply",
version + VERSION + Version::ZERO,
format,
)?,
indexes_to_opreturn_supply: ComputedValueVecsFromHeight::forced_import(
path,
file,
"opreturn_supply",
Source::None,
version + VERSION + Version::ZERO,
@@ -145,7 +143,7 @@ impl Vecs {
indexes,
)?,
indexes_to_address_count: ComputedVecsFromHeight::forced_import(
path,
file,
"address_count",
Source::Compute,
version + VERSION + Version::ZERO,
@@ -155,7 +153,7 @@ impl Vecs {
VecBuilderOptions::default().add_last(),
)?,
indexes_to_empty_address_count: ComputedVecsFromHeight::forced_import(
path,
file,
"empty_address_count",
Source::Compute,
version + VERSION + Version::ZERO,
@@ -167,49 +165,49 @@ impl Vecs {
addresstype_to_height_to_address_count: AddressTypeToHeightToAddressCount::from(
ByAddressType {
p2pk65: EagerVec::forced_import(
path,
file,
"p2pk65_address_count",
version + VERSION + Version::ZERO,
format,
)?,
p2pk33: EagerVec::forced_import(
path,
file,
"p2pk33_address_count",
version + VERSION + Version::ZERO,
format,
)?,
p2pkh: EagerVec::forced_import(
path,
file,
"p2pkh_address_count",
version + VERSION + Version::ZERO,
format,
)?,
p2sh: EagerVec::forced_import(
path,
file,
"p2sh_address_count",
version + VERSION + Version::ZERO,
format,
)?,
p2wpkh: EagerVec::forced_import(
path,
file,
"p2wpkh_address_count",
version + VERSION + Version::ZERO,
format,
)?,
p2wsh: EagerVec::forced_import(
path,
file,
"p2wsh_address_count",
version + VERSION + Version::ZERO,
format,
)?,
p2tr: EagerVec::forced_import(
path,
file,
"p2tr_address_count",
version + VERSION + Version::ZERO,
format,
)?,
p2a: EagerVec::forced_import(
path,
file,
"p2a_address_count",
version + VERSION + Version::ZERO,
format,
@@ -219,49 +217,49 @@ impl Vecs {
addresstype_to_height_to_empty_address_count: AddressTypeToHeightToAddressCount::from(
ByAddressType {
p2pk65: EagerVec::forced_import(
path,
file,
"p2pk65_empty_address_count",
version + VERSION + Version::ZERO,
format,
)?,
p2pk33: EagerVec::forced_import(
path,
file,
"p2pk33_empty_address_count",
version + VERSION + Version::ZERO,
format,
)?,
p2pkh: EagerVec::forced_import(
path,
file,
"p2pkh_empty_address_count",
version + VERSION + Version::ZERO,
format,
)?,
p2sh: EagerVec::forced_import(
path,
file,
"p2sh_empty_address_count",
version + VERSION + Version::ZERO,
format,
)?,
p2wpkh: EagerVec::forced_import(
path,
file,
"p2wpkh_empty_address_count",
version + VERSION + Version::ZERO,
format,
)?,
p2wsh: EagerVec::forced_import(
path,
file,
"p2wsh_empty_address_count",
version + VERSION + Version::ZERO,
format,
)?,
p2tr: EagerVec::forced_import(
path,
file,
"p2tr_empty_address_count",
version + VERSION + Version::ZERO,
format,
)?,
p2a: EagerVec::forced_import(
path,
file,
"p2a_empty_address_count",
version + VERSION + Version::ZERO,
format,
@@ -271,7 +269,7 @@ impl Vecs {
addresstype_to_indexes_to_address_count: AddressTypeToIndexesToAddressCount::from(
ByAddressType {
p2pk65: ComputedVecsFromHeight::forced_import(
path,
file,
"p2pk65_address_count",
Source::None,
version + VERSION + Version::ZERO,
@@ -281,7 +279,7 @@ impl Vecs {
VecBuilderOptions::default().add_last(),
)?,
p2pk33: ComputedVecsFromHeight::forced_import(
path,
file,
"p2pk33_address_count",
Source::None,
version + VERSION + Version::ZERO,
@@ -291,7 +289,7 @@ impl Vecs {
VecBuilderOptions::default().add_last(),
)?,
p2pkh: ComputedVecsFromHeight::forced_import(
path,
file,
"p2pkh_address_count",
Source::None,
version + VERSION + Version::ZERO,
@@ -301,7 +299,7 @@ impl Vecs {
VecBuilderOptions::default().add_last(),
)?,
p2sh: ComputedVecsFromHeight::forced_import(
path,
file,
"p2sh_address_count",
Source::None,
version + VERSION + Version::ZERO,
@@ -311,7 +309,7 @@ impl Vecs {
VecBuilderOptions::default().add_last(),
)?,
p2wpkh: ComputedVecsFromHeight::forced_import(
path,
file,
"p2wpkh_address_count",
Source::None,
version + VERSION + Version::ZERO,
@@ -321,7 +319,7 @@ impl Vecs {
VecBuilderOptions::default().add_last(),
)?,
p2wsh: ComputedVecsFromHeight::forced_import(
path,
file,
"p2wsh_address_count",
Source::None,
version + VERSION + Version::ZERO,
@@ -331,7 +329,7 @@ impl Vecs {
VecBuilderOptions::default().add_last(),
)?,
p2tr: ComputedVecsFromHeight::forced_import(
path,
file,
"p2tr_address_count",
Source::None,
version + VERSION + Version::ZERO,
@@ -341,7 +339,7 @@ impl Vecs {
VecBuilderOptions::default().add_last(),
)?,
p2a: ComputedVecsFromHeight::forced_import(
path,
file,
"p2a_address_count",
Source::None,
version + VERSION + Version::ZERO,
@@ -355,7 +353,7 @@ impl Vecs {
addresstype_to_indexes_to_empty_address_count: AddressTypeToIndexesToAddressCount::from(
ByAddressType {
p2pk65: ComputedVecsFromHeight::forced_import(
path,
file,
"p2pk65_empty_address_count",
Source::None,
version + VERSION + Version::ZERO,
@@ -365,7 +363,7 @@ impl Vecs {
VecBuilderOptions::default().add_last(),
)?,
p2pk33: ComputedVecsFromHeight::forced_import(
path,
file,
"p2pk33_empty_address_count",
Source::None,
version + VERSION + Version::ZERO,
@@ -375,7 +373,7 @@ impl Vecs {
VecBuilderOptions::default().add_last(),
)?,
p2pkh: ComputedVecsFromHeight::forced_import(
path,
file,
"p2pkh_empty_address_count",
Source::None,
version + VERSION + Version::ZERO,
@@ -385,7 +383,7 @@ impl Vecs {
VecBuilderOptions::default().add_last(),
)?,
p2sh: ComputedVecsFromHeight::forced_import(
path,
file,
"p2sh_empty_address_count",
Source::None,
version + VERSION + Version::ZERO,
@@ -395,7 +393,7 @@ impl Vecs {
VecBuilderOptions::default().add_last(),
)?,
p2wpkh: ComputedVecsFromHeight::forced_import(
path,
file,
"p2wpkh_empty_address_count",
Source::None,
version + VERSION + Version::ZERO,
@@ -405,7 +403,7 @@ impl Vecs {
VecBuilderOptions::default().add_last(),
)?,
p2wsh: ComputedVecsFromHeight::forced_import(
path,
file,
"p2wsh_empty_address_count",
Source::None,
version + VERSION + Version::ZERO,
@@ -415,7 +413,7 @@ impl Vecs {
VecBuilderOptions::default().add_last(),
)?,
p2tr: ComputedVecsFromHeight::forced_import(
path,
file,
"p2tr_empty_address_count",
Source::None,
version + VERSION + Version::ZERO,
@@ -425,7 +423,7 @@ impl Vecs {
VecBuilderOptions::default().add_last(),
)?,
p2a: ComputedVecsFromHeight::forced_import(
path,
file,
"p2a_empty_address_count",
Source::None,
version + VERSION + Version::ZERO,
@@ -437,81 +435,81 @@ impl Vecs {
},
),
utxo_cohorts: utxo_cohorts::Vecs::forced_import(
path,
file,
version,
computation,
format,
indexes,
fetched,
&states_path,
states_path,
)?,
address_cohorts: address_cohorts::Vecs::forced_import(
path,
file,
version,
computation,
format,
indexes,
fetched,
&states_path,
states_path,
)?,
p2aaddressindex_to_anyaddressindex: IndexedVec::forced_import(
path,
p2aaddressindex_to_anyaddressindex: StampedVec::forced_import(
file,
"anyaddressindex",
version + VERSION + Version::ZERO,
Format::Raw,
)?,
p2pk33addressindex_to_anyaddressindex: IndexedVec::forced_import(
path,
p2pk33addressindex_to_anyaddressindex: StampedVec::forced_import(
file,
"anyaddressindex",
version + VERSION + Version::ZERO,
Format::Raw,
)?,
p2pk65addressindex_to_anyaddressindex: IndexedVec::forced_import(
path,
p2pk65addressindex_to_anyaddressindex: StampedVec::forced_import(
file,
"anyaddressindex",
version + VERSION + Version::ZERO,
Format::Raw,
)?,
p2pkhaddressindex_to_anyaddressindex: IndexedVec::forced_import(
path,
p2pkhaddressindex_to_anyaddressindex: StampedVec::forced_import(
file,
"anyaddressindex",
version + VERSION + Version::ZERO,
Format::Raw,
)?,
p2shaddressindex_to_anyaddressindex: IndexedVec::forced_import(
path,
p2shaddressindex_to_anyaddressindex: StampedVec::forced_import(
file,
"anyaddressindex",
version + VERSION + Version::ZERO,
Format::Raw,
)?,
p2traddressindex_to_anyaddressindex: IndexedVec::forced_import(
path,
p2traddressindex_to_anyaddressindex: StampedVec::forced_import(
file,
"anyaddressindex",
version + VERSION + Version::ZERO,
Format::Raw,
)?,
p2wpkhaddressindex_to_anyaddressindex: IndexedVec::forced_import(
path,
p2wpkhaddressindex_to_anyaddressindex: StampedVec::forced_import(
file,
"anyaddressindex",
version + VERSION + Version::ZERO,
Format::Raw,
)?,
p2wshaddressindex_to_anyaddressindex: IndexedVec::forced_import(
path,
p2wshaddressindex_to_anyaddressindex: StampedVec::forced_import(
file,
"anyaddressindex",
version + VERSION + Version::ZERO,
Format::Raw,
)?,
loadedaddressindex_to_loadedaddressdata: IndexedVec::forced_import(
path,
loadedaddressindex_to_loadedaddressdata: StampedVec::forced_import(
file,
"loadedaddressdata",
version + VERSION + Version::ZERO,
Format::Raw,
)?,
emptyaddressindex_to_emptyaddressdata: IndexedVec::forced_import(
path,
emptyaddressindex_to_emptyaddressdata: StampedVec::forced_import(
file,
"emptyaddressdata",
version + VERSION + Version::ZERO,
Format::Raw,
@@ -637,54 +635,54 @@ impl Vecs {
)
.min(chain_state_starting_height)
.min(
self.p2pk33addressindex_to_anyaddressindex
.height()
Height::from(u64::from(
self.p2pk33addressindex_to_anyaddressindex.stamp(),
))
.incremented(),
)
.min(
Height::from(u64::from(
self.p2pk65addressindex_to_anyaddressindex.stamp(),
))
.incremented(),
)
.min(
Height::from(u64::from(self.p2pkhaddressindex_to_anyaddressindex.stamp()))
.incremented(),
)
.min(
self.p2pk65addressindex_to_anyaddressindex
.height()
Height::from(u64::from(self.p2shaddressindex_to_anyaddressindex.stamp()))
.incremented(),
)
.min(
self.p2pkhaddressindex_to_anyaddressindex
.height()
Height::from(u64::from(self.p2traddressindex_to_anyaddressindex.stamp()))
.incremented(),
)
.min(
self.p2shaddressindex_to_anyaddressindex
.height()
Height::from(u64::from(
self.p2wpkhaddressindex_to_anyaddressindex.stamp(),
))
.incremented(),
)
.min(
Height::from(u64::from(self.p2wshaddressindex_to_anyaddressindex.stamp()))
.incremented(),
)
.min(
self.p2traddressindex_to_anyaddressindex
.height()
Height::from(u64::from(self.p2aaddressindex_to_anyaddressindex.stamp()))
.incremented(),
)
.min(
self.p2wpkhaddressindex_to_anyaddressindex
.height()
.incremented(),
Height::from(u64::from(
self.loadedaddressindex_to_loadedaddressdata.stamp(),
))
.incremented(),
)
.min(
self.p2wshaddressindex_to_anyaddressindex
.height()
.incremented(),
)
.min(
self.p2aaddressindex_to_anyaddressindex
.height()
.incremented(),
)
.min(
self.loadedaddressindex_to_loadedaddressdata
.height()
.incremented(),
)
.min(
self.emptyaddressindex_to_emptyaddressdata
.height()
.incremented(),
Height::from(u64::from(
self.emptyaddressindex_to_emptyaddressdata.stamp(),
))
.incremented(),
)
.min(Height::from(self.height_to_unspendable_supply.len()))
.min(Height::from(self.height_to_opreturn_supply.len()))
@@ -749,13 +747,13 @@ impl Vecs {
.try_for_each(|(_, v)| v.state.reset_price_to_amount())?;
};
let last_height = indexer.vecs.height_to_blockhash.height();
let last_height = Height::from(u64::from(indexer.vecs.height_to_blockhash.stamp()));
if starting_height <= last_height {
let inputindex_to_outputindex_mmap = inputindex_to_outputindex.create_mmap()?;
let outputindex_to_value_mmap = outputindex_to_value.create_mmap()?;
let outputindex_to_outputtype_mmap = outputindex_to_outputtype.create_mmap()?;
let outputindex_to_typeindex_mmap = outputindex_to_typeindex.create_mmap()?;
let inputindex_to_outputindex_reader = inputindex_to_outputindex.create_reader();
let outputindex_to_value_reader = outputindex_to_value.create_reader();
let outputindex_to_outputtype_reader = outputindex_to_outputtype.create_reader();
let outputindex_to_typeindex_reader = outputindex_to_typeindex.create_reader();
let mut height_to_first_outputindex_iter = height_to_first_outputindex.into_iter();
let mut height_to_first_inputindex_iter = height_to_first_inputindex.into_iter();
@@ -828,14 +826,14 @@ impl Vecs {
AddressTypeToTypeIndexTree::<WithAddressDataSource<LoadedAddressData>>::default();
let mut addresstype_to_typeindex_to_emptyaddressdata =
AddressTypeToTypeIndexTree::<WithAddressDataSource<EmptyAddressData>>::default();
let mut addresstypeindex_to_anyaddressindex_mmap_opt =
ByAddressType::<Option<Mmap>>::default();
let mut anyaddressindex_to_anyaddressdata_mmap_opt =
ByAnyAddress::<Option<Mmap>>::default();
let mut addresstypeindex_to_anyaddressindex_reader_opt =
ByAddressType::<Option<Reader>>::default();
let mut anyaddressindex_to_anyaddressdata_reader_opt =
ByAnyAddress::<Option<Reader>>::default();
self.reset_mmaps_options(
&mut addresstypeindex_to_anyaddressindex_mmap_opt,
&mut anyaddressindex_to_anyaddressdata_mmap_opt,
self.reset_readers_options(
&mut addresstypeindex_to_anyaddressindex_reader_opt,
&mut anyaddressindex_to_anyaddressdata_reader_opt,
);
(height.unwrap_to_usize()..height_to_date_fixed.len())
@@ -912,17 +910,17 @@ impl Vecs {
.map(OutputIndex::from)
.map(|outputindex| {
let value = outputindex_to_value
.unwrap_read(outputindex, &outputindex_to_value_mmap);
.unwrap_read(outputindex, &outputindex_to_value_reader);
let output_type = outputindex_to_outputtype
.unwrap_read(outputindex, &outputindex_to_outputtype_mmap);
.unwrap_read(outputindex, &outputindex_to_outputtype_reader);
if output_type.is_not_address() {
return (value, output_type, None);
}
let typeindex = outputindex_to_typeindex
.unwrap_read(outputindex, &outputindex_to_typeindex_mmap);
.unwrap_read(outputindex, &outputindex_to_typeindex_reader);
let addressdata_opt = Self::get_addressdatawithsource(
output_type,
@@ -930,8 +928,8 @@ impl Vecs {
&first_addressindexes,
&addresstype_to_typeindex_to_loadedaddressdata,
&addresstype_to_typeindex_to_emptyaddressdata,
&addresstypeindex_to_anyaddressindex_mmap_opt,
&anyaddressindex_to_anyaddressdata_mmap_opt,
&addresstypeindex_to_anyaddressindex_reader_opt,
&anyaddressindex_to_anyaddressdata_reader_opt,
&self.p2pk33addressindex_to_anyaddressindex,
&self.p2pk65addressindex_to_anyaddressindex,
&self.p2pkhaddressindex_to_anyaddressindex,
@@ -996,13 +994,13 @@ impl Vecs {
.map(InputIndex::from)
.map(|inputindex| {
let outputindex =
inputindex_to_outputindex.unwrap_read(inputindex, &inputindex_to_outputindex_mmap);
inputindex_to_outputindex.unwrap_read(inputindex, &inputindex_to_outputindex_reader);
let value = outputindex_to_value
.unwrap_read(outputindex, &outputindex_to_value_mmap);
.unwrap_read(outputindex, &outputindex_to_value_reader);
let input_type = outputindex_to_outputtype
.unwrap_read(outputindex, &outputindex_to_outputtype_mmap);
.unwrap_read(outputindex, &outputindex_to_outputtype_reader);
let prev_height =
*outputindex_range_to_height.get(outputindex).unwrap();
@@ -1012,7 +1010,7 @@ impl Vecs {
}
let typeindex = outputindex_to_typeindex
.unwrap_read(outputindex, &outputindex_to_typeindex_mmap);
.unwrap_read(outputindex, &outputindex_to_typeindex_reader);
let addressdata_opt = Self::get_addressdatawithsource(
input_type,
@@ -1020,8 +1018,8 @@ impl Vecs {
&first_addressindexes,
&addresstype_to_typeindex_to_loadedaddressdata,
&addresstype_to_typeindex_to_emptyaddressdata,
&addresstypeindex_to_anyaddressindex_mmap_opt,
&anyaddressindex_to_anyaddressdata_mmap_opt,
&addresstypeindex_to_anyaddressindex_reader_opt,
&anyaddressindex_to_anyaddressdata_reader_opt,
&self.p2pk33addressindex_to_anyaddressindex,
&self.p2pk65addressindex_to_anyaddressindex,
&self.p2pkhaddressindex_to_anyaddressindex,
@@ -1240,11 +1238,14 @@ impl Vecs {
let _lock = exit.lock();
addresstypeindex_to_anyaddressindex_reader_opt.take();
anyaddressindex_to_anyaddressdata_reader_opt.take();
self.flush_states(height, &chain_state, mem::take(&mut addresstype_to_typeindex_to_loadedaddressdata), mem::take(&mut addresstype_to_typeindex_to_emptyaddressdata), exit)?;
self.reset_mmaps_options(
&mut addresstypeindex_to_anyaddressindex_mmap_opt,
&mut anyaddressindex_to_anyaddressdata_mmap_opt,
self.reset_readers_options(
&mut addresstypeindex_to_anyaddressindex_reader_opt,
&mut anyaddressindex_to_anyaddressdata_reader_opt,
);
}
@@ -1431,18 +1432,18 @@ impl Vecs {
addresstype_to_typeindex_to_emptyaddressdata: &AddressTypeToTypeIndexTree<
WithAddressDataSource<EmptyAddressData>,
>,
addresstypeindex_to_anyaddressindex_mmap_opt: &ByAddressType<Option<Mmap>>,
anyaddressindex_to_anyaddressdata_mmap_opt: &ByAnyAddress<Option<Mmap>>,
p2pk33addressindex_to_anyaddressindex: &IndexedVec<P2PK33AddressIndex, AnyAddressIndex>,
p2pk65addressindex_to_anyaddressindex: &IndexedVec<P2PK65AddressIndex, AnyAddressIndex>,
p2pkhaddressindex_to_anyaddressindex: &IndexedVec<P2PKHAddressIndex, AnyAddressIndex>,
p2shaddressindex_to_anyaddressindex: &IndexedVec<P2SHAddressIndex, AnyAddressIndex>,
p2traddressindex_to_anyaddressindex: &IndexedVec<P2TRAddressIndex, AnyAddressIndex>,
p2wpkhaddressindex_to_anyaddressindex: &IndexedVec<P2WPKHAddressIndex, AnyAddressIndex>,
p2wshaddressindex_to_anyaddressindex: &IndexedVec<P2WSHAddressIndex, AnyAddressIndex>,
p2aaddressindex_to_anyaddressindex: &IndexedVec<P2AAddressIndex, AnyAddressIndex>,
loadedaddressindex_to_loadedaddressdata: &IndexedVec<LoadedAddressIndex, LoadedAddressData>,
emptyaddressindex_to_emptyaddressdata: &IndexedVec<EmptyAddressIndex, EmptyAddressData>,
addresstypeindex_to_anyaddressindex_reader_opt: &ByAddressType<Option<Reader>>,
anyaddressindex_to_anyaddressdata_reader_opt: &ByAnyAddress<Option<Reader>>,
p2pk33addressindex_to_anyaddressindex: &StampedVec<P2PK33AddressIndex, AnyAddressIndex>,
p2pk65addressindex_to_anyaddressindex: &StampedVec<P2PK65AddressIndex, AnyAddressIndex>,
p2pkhaddressindex_to_anyaddressindex: &StampedVec<P2PKHAddressIndex, AnyAddressIndex>,
p2shaddressindex_to_anyaddressindex: &StampedVec<P2SHAddressIndex, AnyAddressIndex>,
p2traddressindex_to_anyaddressindex: &StampedVec<P2TRAddressIndex, AnyAddressIndex>,
p2wpkhaddressindex_to_anyaddressindex: &StampedVec<P2WPKHAddressIndex, AnyAddressIndex>,
p2wshaddressindex_to_anyaddressindex: &StampedVec<P2WSHAddressIndex, AnyAddressIndex>,
p2aaddressindex_to_anyaddressindex: &StampedVec<P2AAddressIndex, AnyAddressIndex>,
loadedaddressindex_to_loadedaddressdata: &StampedVec<LoadedAddressIndex, LoadedAddressData>,
emptyaddressindex_to_emptyaddressdata: &StampedVec<EmptyAddressIndex, EmptyAddressData>,
) -> Option<WithAddressDataSource<LoadedAddressData>> {
if *first_addressindexes.get(address_type).unwrap() <= typeindex {
return Some(WithAddressDataSource::New(LoadedAddressData::default()));
@@ -1460,7 +1461,7 @@ impl Vecs {
return None;
}
let mmap = addresstypeindex_to_anyaddressindex_mmap_opt
let mmap = addresstypeindex_to_anyaddressindex_reader_opt
.get_unwrap(address_type)
.as_ref()
.unwrap();
@@ -1498,7 +1499,7 @@ impl Vecs {
Some(match anyaddressindex.to_enum() {
AnyAddressDataIndexEnum::Loaded(loadedaddressindex) => {
let mmap = anyaddressindex_to_anyaddressdata_mmap_opt
let mmap = anyaddressindex_to_anyaddressdata_reader_opt
.loaded
.as_ref()
.unwrap();
@@ -1515,7 +1516,7 @@ impl Vecs {
))
}
AnyAddressDataIndexEnum::Empty(emtpyaddressindex) => {
let mmap = anyaddressindex_to_anyaddressdata_mmap_opt
let mmap = anyaddressindex_to_anyaddressdata_reader_opt
.empty
.as_ref()
.unwrap();
@@ -1534,60 +1535,60 @@ impl Vecs {
})
}
fn reset_mmaps_options(
fn reset_readers_options(
&self,
addresstypeindex_to_anyaddressindex_mmap_opt: &mut ByAddressType<Option<Mmap>>,
anyaddressindex_to_anyaddressdata_mmap_opt: &mut ByAnyAddress<Option<Mmap>>,
addresstypeindex_to_anyaddressindex_reader_opt: &mut ByAddressType<Option<Reader>>,
anyaddressindex_to_anyaddressdata_reader_opt: &mut ByAnyAddress<Option<Reader>>,
) {
addresstypeindex_to_anyaddressindex_mmap_opt.p2pk65.replace(
self.p2pk65addressindex_to_anyaddressindex
.create_mmap()
.unwrap(),
);
addresstypeindex_to_anyaddressindex_mmap_opt.p2pk33.replace(
self.p2pk33addressindex_to_anyaddressindex
.create_mmap()
.unwrap(),
);
addresstypeindex_to_anyaddressindex_mmap_opt.p2pkh.replace(
self.p2pkhaddressindex_to_anyaddressindex
.create_mmap()
.unwrap(),
);
addresstypeindex_to_anyaddressindex_mmap_opt.p2sh.replace(
addresstypeindex_to_anyaddressindex_reader_opt
.p2pk65
.replace(
self.p2pk65addressindex_to_anyaddressindex
.create_static_reader(),
);
addresstypeindex_to_anyaddressindex_reader_opt
.p2pk33
.replace(
self.p2pk33addressindex_to_anyaddressindex
.create_static_reader(),
);
addresstypeindex_to_anyaddressindex_reader_opt
.p2pkh
.replace(
self.p2pkhaddressindex_to_anyaddressindex
.create_static_reader(),
);
addresstypeindex_to_anyaddressindex_reader_opt.p2sh.replace(
self.p2shaddressindex_to_anyaddressindex
.create_mmap()
.unwrap(),
.create_static_reader(),
);
addresstypeindex_to_anyaddressindex_mmap_opt.p2wpkh.replace(
self.p2wpkhaddressindex_to_anyaddressindex
.create_mmap()
.unwrap(),
);
addresstypeindex_to_anyaddressindex_mmap_opt.p2wsh.replace(
self.p2wshaddressindex_to_anyaddressindex
.create_mmap()
.unwrap(),
);
addresstypeindex_to_anyaddressindex_mmap_opt.p2tr.replace(
addresstypeindex_to_anyaddressindex_reader_opt
.p2wpkh
.replace(
self.p2wpkhaddressindex_to_anyaddressindex
.create_static_reader(),
);
addresstypeindex_to_anyaddressindex_reader_opt
.p2wsh
.replace(
self.p2wshaddressindex_to_anyaddressindex
.create_static_reader(),
);
addresstypeindex_to_anyaddressindex_reader_opt.p2tr.replace(
self.p2traddressindex_to_anyaddressindex
.create_mmap()
.unwrap(),
.create_static_reader(),
);
addresstypeindex_to_anyaddressindex_mmap_opt.p2a.replace(
addresstypeindex_to_anyaddressindex_reader_opt.p2a.replace(
self.p2aaddressindex_to_anyaddressindex
.create_mmap()
.unwrap(),
.create_static_reader(),
);
anyaddressindex_to_anyaddressdata_mmap_opt.loaded.replace(
anyaddressindex_to_anyaddressdata_reader_opt.loaded.replace(
self.loadedaddressindex_to_loadedaddressdata
.create_mmap()
.unwrap(),
.create_static_reader(),
);
anyaddressindex_to_anyaddressdata_mmap_opt.empty.replace(
anyaddressindex_to_anyaddressdata_reader_opt.empty.replace(
self.emptyaddressindex_to_emptyaddressdata
.create_mmap()
.unwrap(),
.create_static_reader(),
);
}
@@ -1765,16 +1766,26 @@ impl Vecs {
})
})?;
self.p2pk33addressindex_to_anyaddressindex.flush(height)?;
self.p2pk65addressindex_to_anyaddressindex.flush(height)?;
self.p2pkhaddressindex_to_anyaddressindex.flush(height)?;
self.p2shaddressindex_to_anyaddressindex.flush(height)?;
self.p2traddressindex_to_anyaddressindex.flush(height)?;
self.p2wpkhaddressindex_to_anyaddressindex.flush(height)?;
self.p2wshaddressindex_to_anyaddressindex.flush(height)?;
self.p2aaddressindex_to_anyaddressindex.flush(height)?;
self.loadedaddressindex_to_loadedaddressdata.flush(height)?;
self.emptyaddressindex_to_emptyaddressdata.flush(height)?;
self.p2pk33addressindex_to_anyaddressindex
.flush(Stamp::from(u64::from(height)))?;
self.p2pk65addressindex_to_anyaddressindex
.flush(Stamp::from(u64::from(height)))?;
self.p2pkhaddressindex_to_anyaddressindex
.flush(Stamp::from(u64::from(height)))?;
self.p2shaddressindex_to_anyaddressindex
.flush(Stamp::from(u64::from(height)))?;
self.p2traddressindex_to_anyaddressindex
.flush(Stamp::from(u64::from(height)))?;
self.p2wpkhaddressindex_to_anyaddressindex
.flush(Stamp::from(u64::from(height)))?;
self.p2wshaddressindex_to_anyaddressindex
.flush(Stamp::from(u64::from(height)))?;
self.p2aaddressindex_to_anyaddressindex
.flush(Stamp::from(u64::from(height)))?;
self.loadedaddressindex_to_loadedaddressdata
.flush(Stamp::from(u64::from(height)))?;
self.emptyaddressindex_to_emptyaddressdata
.flush(Stamp::from(u64::from(height)))?;
self.chain_state.truncate_if_needed(Height::ZERO)?;
chain_state.iter().for_each(|block_state| {
@@ -1,6 +1,6 @@
use std::collections::BTreeMap;
use brk_vec::{IndexedVec, StoredIndex, StoredType};
use brk_vecs::{StampedVec, StoredIndex, StoredType};
#[derive(Debug)]
pub struct RangeMap<I, T>(BTreeMap<I, T>);
@@ -20,12 +20,12 @@ where
}
}
impl<I, T> From<&IndexedVec<I, T>> for RangeMap<T, I>
impl<I, T> From<&StampedVec<I, T>> for RangeMap<T, I>
where
I: StoredIndex,
T: StoredIndex + StoredType,
{
fn from(vec: &IndexedVec<I, T>) -> Self {
fn from(vec: &StampedVec<I, T>) -> Self {
Self(
vec.into_iter()
.map(|(i, v)| (v.into_owned(), i))
+1 -1
View File
@@ -1,7 +1,7 @@
use brk_core::{Bitcoin, DateIndex, Dollars, Height, Result, Version};
use brk_exit::Exit;
use brk_indexer::Indexer;
use brk_vec::{AnyCollectableVec, AnyIterableVec};
use brk_vecs::{AnyCollectableVec, AnyIterableVec};
use crate::{Indexes, fetched, indexes, market};
@@ -1,9 +1,9 @@
use std::{ops::Deref, path::Path};
use std::{ops::Deref, path::Path, sync::Arc};
use brk_core::{Bitcoin, DateIndex, Dollars, Height, Result, Version};
use brk_exit::Exit;
use brk_indexer::Indexer;
use brk_vec::{AnyCollectableVec, AnyIterableVec, Computation, Format};
use brk_vecs::{AnyCollectableVec, AnyIterableVec, Computation, File, Format};
use crate::{
Indexes, UTXOCohortState, fetched, indexes, market,
@@ -25,7 +25,7 @@ pub struct Vecs {
impl Vecs {
#[allow(clippy::too_many_arguments)]
pub fn forced_import(
path: &Path,
file: &Arc<File>,
cohort_name: Option<&str>,
computation: Computation,
format: Format,
@@ -48,7 +48,7 @@ impl Vecs {
)?,
inner: common::Vecs::forced_import(
path,
file,
cohort_name,
computation,
format,
+119 -119
View File
@@ -1,4 +1,4 @@
use std::{collections::BTreeMap, ops::ControlFlow, path::Path};
use std::{collections::BTreeMap, ops::ControlFlow, path::Path, sync::Arc};
use brk_core::{
Bitcoin, ByAgeRange, ByAmountRange, ByEpoch, ByGreatEqualAmount, ByLowerThanAmount, ByMaxAge,
@@ -7,7 +7,7 @@ use brk_core::{
};
use brk_exit::Exit;
use brk_indexer::Indexer;
use brk_vec::{AnyIterableVec, Computation, Format, StoredIndex};
use brk_vecs::{AnyIterableVec, Computation, File, Format, StoredIndex};
use derive_deref::{Deref, DerefMut};
use rayon::prelude::*;
@@ -26,7 +26,7 @@ pub struct Vecs(UTXOGroups<(GroupFilter, utxo_cohort::Vecs)>);
impl Vecs {
pub fn forced_import(
path: &Path,
file: &Arc<File>,
version: Version,
_computation: Computation,
format: Format,
@@ -37,7 +37,7 @@ impl Vecs {
Ok(Self(
UTXOGroups {
all: utxo_cohort::Vecs::forced_import(
path,
file,
None,
_computation,
format,
@@ -50,7 +50,7 @@ impl Vecs {
)?,
term: ByTerm {
short: utxo_cohort::Vecs::forced_import(
path,
file,
Some("short_term_holders"),
_computation,
format,
@@ -62,7 +62,7 @@ impl Vecs {
true,
)?,
long: utxo_cohort::Vecs::forced_import(
path,
file,
Some("long_term_holders"),
_computation,
format,
@@ -76,7 +76,7 @@ impl Vecs {
},
epoch: ByEpoch {
_0: utxo_cohort::Vecs::forced_import(
path,
file,
Some("epoch_0"),
_computation,
format,
@@ -88,7 +88,7 @@ impl Vecs {
true,
)?,
_1: utxo_cohort::Vecs::forced_import(
path,
file,
Some("epoch_1"),
_computation,
format,
@@ -100,7 +100,7 @@ impl Vecs {
true,
)?,
_2: utxo_cohort::Vecs::forced_import(
path,
file,
Some("epoch_2"),
_computation,
format,
@@ -112,7 +112,7 @@ impl Vecs {
true,
)?,
_3: utxo_cohort::Vecs::forced_import(
path,
file,
Some("epoch_3"),
_computation,
format,
@@ -124,7 +124,7 @@ impl Vecs {
true,
)?,
_4: utxo_cohort::Vecs::forced_import(
path,
file,
Some("epoch_4"),
_computation,
format,
@@ -138,7 +138,7 @@ impl Vecs {
},
_type: BySpendableType {
p2pk65: utxo_cohort::Vecs::forced_import(
path,
file,
Some("p2pk65"),
_computation,
format,
@@ -150,7 +150,7 @@ impl Vecs {
false,
)?,
p2pk33: utxo_cohort::Vecs::forced_import(
path,
file,
Some("p2pk33"),
_computation,
format,
@@ -162,7 +162,7 @@ impl Vecs {
false,
)?,
p2pkh: utxo_cohort::Vecs::forced_import(
path,
file,
Some("p2pkh"),
_computation,
format,
@@ -174,7 +174,7 @@ impl Vecs {
false,
)?,
p2sh: utxo_cohort::Vecs::forced_import(
path,
file,
Some("p2sh"),
_computation,
format,
@@ -186,7 +186,7 @@ impl Vecs {
false,
)?,
p2wpkh: utxo_cohort::Vecs::forced_import(
path,
file,
Some("p2wpkh"),
_computation,
format,
@@ -198,7 +198,7 @@ impl Vecs {
false,
)?,
p2wsh: utxo_cohort::Vecs::forced_import(
path,
file,
Some("p2wsh"),
_computation,
format,
@@ -210,7 +210,7 @@ impl Vecs {
false,
)?,
p2tr: utxo_cohort::Vecs::forced_import(
path,
file,
Some("p2tr"),
_computation,
format,
@@ -222,7 +222,7 @@ impl Vecs {
false,
)?,
p2a: utxo_cohort::Vecs::forced_import(
path,
file,
Some("p2a"),
_computation,
format,
@@ -234,7 +234,7 @@ impl Vecs {
false,
)?,
p2ms: utxo_cohort::Vecs::forced_import(
path,
file,
Some("p2ms_outputs"),
_computation,
format,
@@ -246,7 +246,7 @@ impl Vecs {
false,
)?,
empty: utxo_cohort::Vecs::forced_import(
path,
file,
Some("empty_outputs"),
_computation,
format,
@@ -258,7 +258,7 @@ impl Vecs {
false,
)?,
unknown: utxo_cohort::Vecs::forced_import(
path,
file,
Some("unknown_outputs"),
_computation,
format,
@@ -272,7 +272,7 @@ impl Vecs {
},
max_age: ByMaxAge {
_1w: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_up_to_1w_old"),
_computation,
format,
@@ -284,7 +284,7 @@ impl Vecs {
true,
)?,
_1m: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_up_to_1m_old"),
_computation,
format,
@@ -296,7 +296,7 @@ impl Vecs {
true,
)?,
_2m: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_up_to_2m_old"),
_computation,
format,
@@ -308,7 +308,7 @@ impl Vecs {
true,
)?,
_3m: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_up_to_3m_old"),
_computation,
format,
@@ -320,7 +320,7 @@ impl Vecs {
true,
)?,
_4m: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_up_to_4m_old"),
_computation,
format,
@@ -332,7 +332,7 @@ impl Vecs {
true,
)?,
_5m: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_up_to_5m_old"),
_computation,
format,
@@ -344,7 +344,7 @@ impl Vecs {
true,
)?,
_6m: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_up_to_6m_old"),
_computation,
format,
@@ -356,7 +356,7 @@ impl Vecs {
true,
)?,
_1y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_up_to_1y_old"),
_computation,
format,
@@ -368,7 +368,7 @@ impl Vecs {
true,
)?,
_2y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_up_to_2y_old"),
_computation,
format,
@@ -380,7 +380,7 @@ impl Vecs {
true,
)?,
_3y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_up_to_3y_old"),
_computation,
format,
@@ -392,7 +392,7 @@ impl Vecs {
true,
)?,
_4y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_up_to_4y_old"),
_computation,
format,
@@ -404,7 +404,7 @@ impl Vecs {
true,
)?,
_5y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_up_to_5y_old"),
_computation,
format,
@@ -416,7 +416,7 @@ impl Vecs {
true,
)?,
_6y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_up_to_6y_old"),
_computation,
format,
@@ -428,7 +428,7 @@ impl Vecs {
true,
)?,
_7y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_up_to_7y_old"),
_computation,
format,
@@ -440,7 +440,7 @@ impl Vecs {
true,
)?,
_8y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_up_to_8y_old"),
_computation,
format,
@@ -452,7 +452,7 @@ impl Vecs {
true,
)?,
_10y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_up_to_10y_old"),
_computation,
format,
@@ -464,7 +464,7 @@ impl Vecs {
true,
)?,
_12y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_up_to_12y_old"),
_computation,
format,
@@ -476,7 +476,7 @@ impl Vecs {
true,
)?,
_15y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_up_to_15y_old"),
_computation,
format,
@@ -490,7 +490,7 @@ impl Vecs {
},
min_age: ByMinAge {
_1d: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_1d_old"),
_computation,
format,
@@ -502,7 +502,7 @@ impl Vecs {
true,
)?,
_1w: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_1w_old"),
_computation,
format,
@@ -514,7 +514,7 @@ impl Vecs {
true,
)?,
_1m: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_1m_old"),
_computation,
format,
@@ -526,7 +526,7 @@ impl Vecs {
true,
)?,
_2m: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_2m_old"),
_computation,
format,
@@ -538,7 +538,7 @@ impl Vecs {
true,
)?,
_3m: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_3m_old"),
_computation,
format,
@@ -550,7 +550,7 @@ impl Vecs {
true,
)?,
_4m: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_4m_old"),
_computation,
format,
@@ -562,7 +562,7 @@ impl Vecs {
true,
)?,
_5m: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_5m_old"),
_computation,
format,
@@ -574,7 +574,7 @@ impl Vecs {
true,
)?,
_6m: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_6m_old"),
_computation,
format,
@@ -586,7 +586,7 @@ impl Vecs {
true,
)?,
_1y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_1y_old"),
_computation,
format,
@@ -598,7 +598,7 @@ impl Vecs {
true,
)?,
_2y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_2y_old"),
_computation,
format,
@@ -610,7 +610,7 @@ impl Vecs {
true,
)?,
_3y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_3y_old"),
_computation,
format,
@@ -622,7 +622,7 @@ impl Vecs {
true,
)?,
_4y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_4y_old"),
_computation,
format,
@@ -634,7 +634,7 @@ impl Vecs {
true,
)?,
_5y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_5y_old"),
_computation,
format,
@@ -646,7 +646,7 @@ impl Vecs {
true,
)?,
_6y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_6y_old"),
_computation,
format,
@@ -658,7 +658,7 @@ impl Vecs {
true,
)?,
_7y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_7y_old"),
_computation,
format,
@@ -670,7 +670,7 @@ impl Vecs {
true,
)?,
_8y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_8y_old"),
_computation,
format,
@@ -682,7 +682,7 @@ impl Vecs {
true,
)?,
_10y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_10y_old"),
_computation,
format,
@@ -694,7 +694,7 @@ impl Vecs {
true,
)?,
_12y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_12y_old"),
_computation,
format,
@@ -708,7 +708,7 @@ impl Vecs {
},
age_range: ByAgeRange {
up_to_1d: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_up_to_1d_old"),
_computation,
format,
@@ -720,7 +720,7 @@ impl Vecs {
true,
)?,
_1d_to_1w: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_1d_up_to_1w_old"),
_computation,
format,
@@ -732,7 +732,7 @@ impl Vecs {
true,
)?,
_1w_to_1m: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_1w_up_to_1m_old"),
_computation,
format,
@@ -744,7 +744,7 @@ impl Vecs {
true,
)?,
_1m_to_2m: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_1m_up_to_2m_old"),
_computation,
format,
@@ -756,7 +756,7 @@ impl Vecs {
true,
)?,
_2m_to_3m: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_2m_up_to_3m_old"),
_computation,
format,
@@ -768,7 +768,7 @@ impl Vecs {
true,
)?,
_3m_to_4m: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_3m_up_to_4m_old"),
_computation,
format,
@@ -780,7 +780,7 @@ impl Vecs {
true,
)?,
_4m_to_5m: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_4m_up_to_5m_old"),
_computation,
format,
@@ -792,7 +792,7 @@ impl Vecs {
true,
)?,
_5m_to_6m: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_5m_up_to_6m_old"),
_computation,
format,
@@ -804,7 +804,7 @@ impl Vecs {
true,
)?,
_6m_to_1y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_6m_up_to_1y_old"),
_computation,
format,
@@ -816,7 +816,7 @@ impl Vecs {
true,
)?,
_1y_to_2y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_1y_up_to_2y_old"),
_computation,
format,
@@ -828,7 +828,7 @@ impl Vecs {
true,
)?,
_2y_to_3y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_2y_up_to_3y_old"),
_computation,
format,
@@ -840,7 +840,7 @@ impl Vecs {
true,
)?,
_3y_to_4y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_3y_up_to_4y_old"),
_computation,
format,
@@ -852,7 +852,7 @@ impl Vecs {
true,
)?,
_4y_to_5y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_4y_up_to_5y_old"),
_computation,
format,
@@ -864,7 +864,7 @@ impl Vecs {
true,
)?,
_5y_to_6y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_5y_up_to_6y_old"),
_computation,
format,
@@ -876,7 +876,7 @@ impl Vecs {
true,
)?,
_6y_to_7y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_6y_up_to_7y_old"),
_computation,
format,
@@ -888,7 +888,7 @@ impl Vecs {
true,
)?,
_7y_to_8y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_7y_up_to_8y_old"),
_computation,
format,
@@ -900,7 +900,7 @@ impl Vecs {
true,
)?,
_8y_to_10y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_8y_up_to_10y_old"),
_computation,
format,
@@ -912,7 +912,7 @@ impl Vecs {
true,
)?,
_10y_to_12y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_10y_up_to_12y_old"),
_computation,
format,
@@ -924,7 +924,7 @@ impl Vecs {
true,
)?,
_12y_to_15y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_12y_up_to_15y_old"),
_computation,
format,
@@ -936,7 +936,7 @@ impl Vecs {
true,
)?,
from_15y: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_at_least_15y_old"),
_computation,
format,
@@ -950,7 +950,7 @@ impl Vecs {
},
amount_range: ByAmountRange {
_0sats: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_with_0sats"),
_computation,
format,
@@ -962,7 +962,7 @@ impl Vecs {
false,
)?,
_1sat_to_10sats: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_1sat_under_10sats"),
_computation,
format,
@@ -974,7 +974,7 @@ impl Vecs {
false,
)?,
_10sats_to_100sats: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_10sats_under_100sats"),
_computation,
format,
@@ -986,7 +986,7 @@ impl Vecs {
false,
)?,
_100sats_to_1k_sats: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_100sats_under_1k_sats"),
_computation,
format,
@@ -998,7 +998,7 @@ impl Vecs {
false,
)?,
_1k_sats_to_10k_sats: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_1k_sats_under_10k_sats"),
_computation,
format,
@@ -1010,7 +1010,7 @@ impl Vecs {
false,
)?,
_10k_sats_to_100k_sats: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_10k_sats_under_100k_sats"),
_computation,
format,
@@ -1022,7 +1022,7 @@ impl Vecs {
false,
)?,
_100k_sats_to_1m_sats: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_100k_sats_under_1m_sats"),
_computation,
format,
@@ -1034,7 +1034,7 @@ impl Vecs {
false,
)?,
_1m_sats_to_10m_sats: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_1m_sats_under_10m_sats"),
_computation,
format,
@@ -1046,7 +1046,7 @@ impl Vecs {
false,
)?,
_10m_sats_to_1btc: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_10m_sats_under_1btc"),
_computation,
format,
@@ -1058,7 +1058,7 @@ impl Vecs {
false,
)?,
_1btc_to_10btc: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_1btc_under_10btc"),
_computation,
format,
@@ -1070,7 +1070,7 @@ impl Vecs {
false,
)?,
_10btc_to_100btc: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_10btc_under_100btc"),
_computation,
format,
@@ -1082,7 +1082,7 @@ impl Vecs {
false,
)?,
_100btc_to_1k_btc: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_100btc_under_1k_btc"),
_computation,
format,
@@ -1094,7 +1094,7 @@ impl Vecs {
false,
)?,
_1k_btc_to_10k_btc: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_1k_btc_under_10k_btc"),
_computation,
format,
@@ -1106,7 +1106,7 @@ impl Vecs {
false,
)?,
_10k_btc_to_100k_btc: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_10k_btc_under_100k_btc"),
_computation,
format,
@@ -1118,7 +1118,7 @@ impl Vecs {
false,
)?,
_100k_btc_or_more: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_100k_btc"),
_computation,
format,
@@ -1132,7 +1132,7 @@ impl Vecs {
},
lt_amount: ByLowerThanAmount {
_10sats: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_under_10sats"),
_computation,
format,
@@ -1144,7 +1144,7 @@ impl Vecs {
false,
)?,
_100sats: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_under_100sats"),
_computation,
format,
@@ -1156,7 +1156,7 @@ impl Vecs {
false,
)?,
_1k_sats: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_under_1k_sats"),
_computation,
format,
@@ -1168,7 +1168,7 @@ impl Vecs {
false,
)?,
_10k_sats: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_under_10k_sats"),
_computation,
format,
@@ -1180,7 +1180,7 @@ impl Vecs {
false,
)?,
_100k_sats: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_under_100k_sats"),
_computation,
format,
@@ -1192,7 +1192,7 @@ impl Vecs {
false,
)?,
_1m_sats: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_under_1m_sats"),
_computation,
format,
@@ -1204,7 +1204,7 @@ impl Vecs {
false,
)?,
_10m_sats: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_under_10m_sats"),
_computation,
format,
@@ -1216,7 +1216,7 @@ impl Vecs {
false,
)?,
_1btc: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_under_1btc"),
_computation,
format,
@@ -1228,7 +1228,7 @@ impl Vecs {
false,
)?,
_10btc: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_under_10btc"),
_computation,
format,
@@ -1240,7 +1240,7 @@ impl Vecs {
false,
)?,
_100btc: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_under_100btc"),
_computation,
format,
@@ -1252,7 +1252,7 @@ impl Vecs {
false,
)?,
_1k_btc: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_under_1k_btc"),
_computation,
format,
@@ -1264,7 +1264,7 @@ impl Vecs {
false,
)?,
_10k_btc: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_under_10k_btc"),
_computation,
format,
@@ -1276,7 +1276,7 @@ impl Vecs {
false,
)?,
_100k_btc: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_under_100k_btc"),
_computation,
format,
@@ -1290,7 +1290,7 @@ impl Vecs {
},
ge_amount: ByGreatEqualAmount {
_1sat: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_1sat"),
_computation,
format,
@@ -1302,7 +1302,7 @@ impl Vecs {
false,
)?,
_10sats: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_10sats"),
_computation,
format,
@@ -1314,7 +1314,7 @@ impl Vecs {
false,
)?,
_100sats: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_100sats"),
_computation,
format,
@@ -1326,7 +1326,7 @@ impl Vecs {
false,
)?,
_1k_sats: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_1k_sats"),
_computation,
format,
@@ -1338,7 +1338,7 @@ impl Vecs {
false,
)?,
_10k_sats: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_10k_sats"),
_computation,
format,
@@ -1350,7 +1350,7 @@ impl Vecs {
false,
)?,
_100k_sats: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_100k_sats"),
_computation,
format,
@@ -1362,7 +1362,7 @@ impl Vecs {
false,
)?,
_1m_sats: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_1m_sats"),
_computation,
format,
@@ -1374,7 +1374,7 @@ impl Vecs {
false,
)?,
_10m_sats: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_10m_sats"),
_computation,
format,
@@ -1386,7 +1386,7 @@ impl Vecs {
false,
)?,
_1btc: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_1btc"),
_computation,
format,
@@ -1398,7 +1398,7 @@ impl Vecs {
false,
)?,
_10btc: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_10btc"),
_computation,
format,
@@ -1410,7 +1410,7 @@ impl Vecs {
false,
)?,
_100btc: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_100btc"),
_computation,
format,
@@ -1422,7 +1422,7 @@ impl Vecs {
false,
)?,
_1k_btc: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_1k_btc"),
_computation,
format,
@@ -1434,7 +1434,7 @@ impl Vecs {
false,
)?,
_10k_btc: utxo_cohort::Vecs::forced_import(
path,
file,
Some("utxos_above_10k_btc"),
_computation,
format,