Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions console/executor_dumps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ void executor::dump_body_sizes() const
query_.validated_bk_body_size() %
query_.validated_tx_body_size() %
query_.filter_bk_body_size() %
query_.filter_tx_body_size() %
query_.address_body_size());
query_.filter_tx_body_size());
}

void executor::dump_records() const
Expand All @@ -129,8 +128,7 @@ void executor::dump_records() const
query_.prevalid_records() %
query_.duplicate_records() %
query_.strong_tx_records() %
query_.filter_bk_records() %
query_.address_records());
query_.filter_bk_records());
}

void executor::dump_buckets() const
Expand All @@ -140,14 +138,14 @@ void executor::dump_buckets() const
query_.txs_buckets() %
query_.tx_buckets() %
query_.ins_buckets() %
query_.outs_buckets() %
query_.prevout_buckets() %
query_.duplicate_buckets() %
query_.strong_tx_buckets() %
query_.validated_bk_buckets() %
query_.validated_tx_buckets() %
query_.filter_bk_buckets() %
query_.filter_tx_buckets() %
query_.address_buckets());
query_.filter_tx_buckets());
}

void executor::dump_collisions() const
Expand All @@ -158,8 +156,8 @@ void executor::dump_collisions() const
(to_double(query_.ins_records()) / query_.ins_buckets()) %
(to_double(query_.strong_tx_records()) / query_.strong_tx_buckets()) %
(to_double(query_.tx_records()) / query_.validated_tx_buckets()) %
(query_.address_enabled() ? (to_double(query_.address_records()) /
query_.address_buckets()) : zero));
(query_.address_enabled() ? (to_double(query_.outs_records()) /
query_.outs_buckets()) : zero));
}

void executor::dump_progress() const
Expand Down
32 changes: 22 additions & 10 deletions console/executor_test_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ void executor::read_test(const hash_digest&) const

void executor::read_test(const hash_digest&) const
{
logger(format("Point table body searches: %1% / (%2% + %1%)") %
store_.point.positive_search_count() %
store_.point.negative_search_count());
logger(format("Ins table body searches: %1% / (%2% + %1%)") %
store_.ins.positive_search_count() %
store_.ins.negative_search_count());
}

void executor::read_test(const hash_digest&) const
Expand Down Expand Up @@ -142,7 +142,7 @@ void executor::read_test(const hash_digest&) const
return;

////size_t found{};
auto address_it = store_.address.it(key);
auto address_it = store_.outs.it({ key });
if (address_it.get().is_terminal())
{
// fault, missing address.
Expand All @@ -154,14 +154,26 @@ void executor::read_test(const hash_digest&) const
if (canceled())
break;

table::address::record address{};
if (!store_.address.get(address_it.get(), address))
// Outs is read unguarded, under the iterator's aggregate guard.
table::outs::get_output put{};
if (!store_.outs.puts.get_raw(address_it.get(), put))
{
// fault, missing address.
// fault, missing outs.
return;
}

const auto out_fk = address.output_fk;
// The table search is loose, so candidates are verified here.
const auto out_fk = put.out_fk;
table::output::match_script_hash script{ {}, key };
if (!store_.output.raw(store_.output.get_memory(), out_fk, script))
{
// fault, missing output.
return;
}

if (!script.match)
continue;

table::output::get_parent output{};
if (!store_.output.get(out_fk, output))
{
Expand Down Expand Up @@ -204,8 +216,8 @@ void executor::read_test(const hash_digest&) const
if (!points.empty())
{
pt_fk = points.front();
table::ins::record ins{};
if (!store_.ins.get(pt_fk, ins))
table::ins_sequence::record ins{};
if (!store_.ins.sequence.get(pt_fk, ins))
{
// fault, missing ins.
return;
Expand Down
24 changes: 11 additions & 13 deletions console/localize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@
" valid_bk :%17%\n" \
" valid_tx :%18%\n" \
" filter_bk :%19%\n" \
" filter_tx :%20%\n" \
" address :%21%"
" filter_tx :%20%"
#define BS_INFORMATION_RECORDS \
"Table records...\n" \
" header :%1%\n" \
Expand All @@ -139,8 +138,7 @@
" prevalid :%10%\n" \
" duplicate :%11%\n" \
" strong_tx :%12%\n" \
" filter_bk :%13%\n" \
" address :%14%"
" filter_bk :%13%"
#define BS_INFORMATION_SLABS \
"Table slabs..."
#define BS_INFORMATION_SLABS_ROW \
Expand All @@ -155,22 +153,22 @@
" txs :%2%\n" \
" tx :%3%\n" \
" ins :%4%\n" \
" prevout :%5%\n" \
" duplicate :%6%\n" \
" strong_tx :%7%\n" \
" valid_bk :%8%\n" \
" valid_tx :%9%\n" \
" filter_bk :%10%\n" \
" filter_tx :%11%\n" \
" address :%12%"
" outs :%5%\n" \
" prevout :%6%\n" \
" duplicate :%7%\n" \
" strong_tx :%8%\n" \
" valid_bk :%9%\n" \
" valid_tx :%10%\n" \
" filter_bk :%11%\n" \
" filter_tx :%12%"
#define BS_INFORMATION_COLLISION_RATES \
"Collision rates...\n" \
" header :%1%\n" \
" tx :%2%\n" \
" ins :%3%\n" \
" strong_tx :%4%\n" \
" valid_tx :%5%\n" \
" address :%6%"
" outs :%6%"
#define BS_INFORMATION_PROGRESS_START \
"Thinking..."
#define BS_INFORMATION_PROGRESS \
Expand Down
72 changes: 31 additions & 41 deletions src/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,39 +88,43 @@ parser::parser(system::chain::selection context,
////configured.server.stratum_v1.safes.emplace_back(asio::address{}, 8443_u16);
////configured.server.stratum_v2.binds.emplace_back(asio::address{}, 8580_u16);

// SCALE: LF2.2 @ 850K.
// database
// load factors are set to 2.5 @ 950K.

// Only used for electrum queries (255 is optimal otherwise).
configured.database.interval_depth = 11;

// database (archive)
// archive

configured.database.header.buckets = 386'364;
configured.database.header.buckets = 385'181;
configured.database.header.size = 21'000'000;

configured.database.txs.buckets = 950'001;
configured.database.txs.size = 1'050'000'000;

configured.database.tx.buckets = 469'222'525;
configured.database.tx.buckets = 543'948'678;
configured.database.tx.size = 17'000'000'000;

// ins table set to 2.2LF @ ~900k.
configured.database.ins.buckets = 1'365'977'136;
// ins (required)
configured.database.ins.buckets = 1'345'386'901;
configured.database.ins.size = 34'250'000'000;
configured.database.outs.size = 3'700'000'000;

// outs (optional)
configured.database.outs.buckets = 1'496'771'635;
configured.database.outs.size = 6'750'000'000;

configured.database.input.size = 92'500'000'000;
configured.database.output.size = 25'300'000'000;

// database (indexes)
// indexes

configured.database.candidate.size = 2'575'500;
configured.database.confirmed.size = 2'575'500;

configured.database.strong_tx.buckets = 469'222'525;
configured.database.strong_tx.buckets = 543'948'678;
configured.database.strong_tx.size = 2'900'000'000;

// database (caches)
// caches

configured.database.ecdsa.size = 1;
configured.database.schnorr.size = 1;
Expand All @@ -136,13 +140,11 @@ parser::parser(system::chain::selection context,
configured.database.validated_bk.buckets = 950'001;
configured.database.validated_bk.size = 1'700'000;

configured.database.validated_tx.buckets = 1;
// unused in v4
configured.database.validated_tx.buckets = 0;
configured.database.validated_tx.size = 1;

// database (optionals)

configured.database.address.buckets = 1;
configured.database.address.size = 1;
// optional

// also disabled by filter_tx
configured.database.filter_bk.buckets = 0;
Expand Down Expand Up @@ -1622,7 +1624,7 @@ options_metadata parser::load_settings() THROWS
(
"table.header.buckets",
value<uint32_t>(&configured.database.header.buckets),
"The number of buckets in the archive_header table head, defaults to '386364'."
"The number of buckets in the archive_header table head, defaults to '385181'."
)
(
"table.header.size",
Expand Down Expand Up @@ -1663,7 +1665,7 @@ options_metadata parser::load_settings() THROWS
(
"table.ins.buckets",
value<uint32_t>(&configured.database.ins.buckets),
"The number of buckets in the archive_ins table head, defaults to '1365977136'."
"The number of buckets in the archive_ins table head, defaults to '1345386901'."
)
(
"table.ins.size",
Expand All @@ -1677,22 +1679,27 @@ options_metadata parser::load_settings() THROWS
)

/* table.outs */
(
"table.outs.buckets",
value<uint32_t>(&configured.database.outs.buckets),
"The number of buckets in the archive_outs table head, defaults to '1496771635' (0 disables address index)."
)
(
"table.outs.size",
value<uint64_t>(&configured.database.outs.size),
"The minimum allocation of the archive_puts table body, defaults to '3700000000'."
"The minimum allocation of the archive_outs table body, defaults to '3700000000'."
)
(
"table.outs.rate",
value<uint16_t>(&configured.database.outs.rate),
"The percentage expansion of the archive_puts table body, defaults to '5'."
"The percentage expansion of the archive_outs table body, defaults to '5'."
)

/* table.tx */
(
"table.tx.buckets",
value<uint32_t>(&configured.database.tx.buckets),
"The number of buckets in the archive_tx table head, defaults to '469222525'."
"The number of buckets in the archive_tx table head, defaults to '543948678'."
)
(
"table.tx.size",
Expand All @@ -1709,7 +1716,7 @@ options_metadata parser::load_settings() THROWS
(
"table.txs.buckets",
value<uint32_t>(&configured.database.txs.buckets),
"The number of buckets in the archive_txs table head, defaults to '900001'."
"The number of buckets in the archive_txs table head, defaults to '950001'."
)
(
"table.txs.size",
Expand Down Expand Up @@ -1750,7 +1757,7 @@ options_metadata parser::load_settings() THROWS
(
"table.strong.buckets",
value<uint32_t>(&configured.database.strong_tx.buckets),
"The number of buckets in the index_strong table head, defaults to '469222525'."
"The number of buckets in the index_strong table head, defaults to '543948678'."
)
(
"table.strong.size",
Expand Down Expand Up @@ -1849,7 +1856,7 @@ options_metadata parser::load_settings() THROWS
(
"table.validated_bk.buckets",
value<uint32_t>(&configured.database.validated_bk.buckets),
"The number of buckets in the validated_bk table head, defaults to '900001'."
"The number of buckets in the validated_bk table head, defaults to '950001'."
)
(
"table.validated_bk.size",
Expand All @@ -1866,7 +1873,7 @@ options_metadata parser::load_settings() THROWS
(
"table.validated_tx.buckets",
value<uint32_t>(&configured.database.validated_tx.buckets),
"The number of buckets in the validated_tx table head, defaults to '1'."
"The number of buckets in the validated_tx table head, defaults to '0' (0 disables)."
)
(
"table.validated_tx.size",
Expand All @@ -1879,23 +1886,6 @@ options_metadata parser::load_settings() THROWS
"The percentage expansion of the validated_tx table body, defaults to '5'."
)

/* table.address */
(
"table.address.buckets",
value<uint32_t>(&configured.database.address.buckets),
"The number of buckets in the option_address table head, defaults to '1' (0|1 disables)."
)
(
"table.address.size",
value<uint64_t>(&configured.database.address.size),
"The minimum allocation of the option_address table body, defaults to '1'."
)
(
"table.address.rate",
value<uint16_t>(&configured.database.address.rate),
"The percentage expansion of the option_address table body, defaults to '5'."
)

/* table.filter_bk */
(
"table.filter_bk.buckets",
Expand Down
2 changes: 1 addition & 1 deletion test/protocols/btcd/btcd_setup_fixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ btcd_setup_fixture::btcd_setup_fixture(const initializer& setup,
[&]() NOEXCEPT -> const database::settings&
{
if (!address_index)
config_.database.address.buckets = 0;
config_.database.outs.buckets = 0;

config_.database.path = TEST_DIRECTORY;
return config_.database;
Expand Down
2 changes: 1 addition & 1 deletion test/protocols/electrum/electrum_setup_fixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ electrum_setup_fixture::electrum_setup_fixture(const initializer& setup,
[&]() NOEXCEPT -> const database::settings&
{
if (!address_index)
config_.database.address.buckets = 0;
config_.database.outs.buckets = 0;

config_.database.path = TEST_DIRECTORY;
return config_.database;
Expand Down
Loading