diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0422e60b..1bf8e2e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,8 @@ on: - 'src/**' - 'test/**' push: + branches: + - "**" tags-ignore: - "**" paths: diff --git a/console/executor_dumps.cpp b/console/executor_dumps.cpp index fb3c03d3..a95bd5fb 100644 --- a/console/executor_dumps.cpp +++ b/console/executor_dumps.cpp @@ -163,11 +163,12 @@ void executor::dump_body_sizes() const query_.silent1_prefix_body_size(), query_.prevout_body_size(), query_.duplicate_body_size(), - query_.strong_tx_body_size(), + query_.strong_body_size(), query_.scan_body_size(), query_.scan_prefix_body_size(), query_.state_body_size(), query_.pool_body_size(), + query_.wtxid_body_size(), query_.spends_body_size(), query_.filter_bk_body_size(), query_.filter_tx_body_size())); @@ -195,11 +196,12 @@ void executor::dump_records() const query_.silent0_prefix_records(), query_.silent1_prefix_records(), query_.duplicate_records(), - query_.strong_tx_records(), + query_.strong_records(), query_.scan_records(), query_.scan_prefix_records(), query_.state_records(), query_.pool_records(), + query_.wtxid_records(), query_.spends_records(), query_.filter_bk_records())); } @@ -214,8 +216,9 @@ void executor::dump_buckets() const query_.outs_buckets(), query_.prevout_buckets(), query_.duplicate_buckets(), - query_.strong_tx_buckets(), + query_.strong_buckets(), query_.pool_buckets(), + query_.wtxid_buckets(), query_.filter_bk_buckets(), query_.filter_tx_buckets())); } @@ -230,19 +233,20 @@ void executor::dump_collisions() const const auto header = rate(query_.header_records(), query_.header_buckets()); const auto tx = rate(query_.tx_records(), query_.tx_buckets()); const auto ins = rate(query_.ins_records(), query_.ins_buckets()); - const auto strong = rate(query_.strong_tx_records(), query_.strong_tx_buckets()); + const auto strong = rate(query_.strong_records(), query_.strong_buckets()); const auto pool = rate(query_.pool_records(), query_.pool_buckets()); + const auto wtxid = rate(query_.wtxid_records(), query_.wtxid_buckets()); if (query_.address_enabled()) { const auto outs = rate(query_.outs_records(), query_.outs_buckets()); - logger(std::format(BS_INFORMATION_COLLISION_RATES_ADDRESS, - header, tx, ins, outs, strong, pool)); + logger(std::format(BS_INFORMATION_COLLISION_RATES_OUTS, + header, tx, ins, outs, strong, pool, wtxid)); return; } logger(std::format(BS_INFORMATION_COLLISION_RATES, - header, tx, ins, strong, pool)); + header, tx, ins, strong, pool, wtxid)); } void executor::dump_progress() const diff --git a/console/executor_scans.cpp b/console/executor_scans.cpp index 04e58fcf..53b5e3ca 100644 --- a/console/executor_scans.cpp +++ b/console/executor_scans.cpp @@ -131,8 +131,8 @@ void executor::scan_buckets() const scan_buckets("header", store_.header, query_.header_records()); scan_buckets("tx", store_.tx, query_.tx_records()); scan_buckets("ins", store_.ins, query_.ins_records()); - scan_buckets("address", store_.outs, query_.outs_records()); - scan_buckets("strong_tx", store_.strong_tx, query_.strong_tx_records()); + scan_buckets("outs", store_.outs, query_.outs_records()); + scan_buckets("strong", store_.strong, query_.strong_records()); scan_buckets("duplicate", store_.duplicate, query_.duplicate_records()); scan_buckets("pool", store_.pool, query_.pool_records()); scan_buckets("wtxid", store_.wtxid, query_.wtxid_records()); @@ -372,13 +372,13 @@ void executor::scan_collisions() tx_link::integer>(index)); }); - scan_collisions("strong_tx", - query_.strong_tx_records(), query_.strong_tx_buckets(), - store_.strong_tx.filter_k(), distributions, filters, + scan_collisions("strong", + query_.strong_records(), query_.strong_buckets(), + store_.strong.filter_k(), distributions, filters, [&](size_t index) { - return store_.strong_tx.get_key(possible_narrow_cast< - table::strong_tx::link::integer>(index)); + return store_.strong.get_key(possible_narrow_cast< + table::strong::link::integer>(index)); }); scan_collisions("ins", query_.ins_records(), diff --git a/console/localize.hpp b/console/localize.hpp index d91d07b9..bc768d5f 100644 --- a/console/localize.hpp +++ b/console/localize.hpp @@ -128,97 +128,102 @@ // --information #define BS_INFORMATION_START \ "Configuration...\n" \ - " dirty :{:d}\n" \ - " interval :{}" + " dirty :{:d}\n" \ + " interval :{}" #define BS_INFORMATION_SIZES \ "Body sizes...\n" \ - " header :{}\n" \ - " txs :{}\n" \ - " tx :{}\n" \ - " input :{}\n" \ - " output :{}\n" \ - " ins :{}\n" \ - " outs :{}\n" \ - " candidate :{}\n" \ - " confirmed :{}\n" \ - " ecdsa0 :{}\n" \ - " ecdsa1 :{}\n" \ - " schnorr0 :{}\n" \ - " schnorr1 :{}\n" \ - " prevalid0 :{}\n" \ - " prevalid1 :{}\n" \ - " presilent0:{}\n" \ - " presilent1:{}\n" \ - " silent0 :{}\n" \ - " silent1 :{}\n" \ - " silent0pfx:{}\n" \ - " silent1pfx:{}\n" \ - " prevout :{}\n" \ - " duplicate :{}\n" \ - " strong_tx :{}\n" \ - " scan :{}\n" \ - " scanprefix:{}\n" \ - " state :{}\n" \ - " pool :{}\n" \ - " spends :{}\n" \ - " filter_bk :{}\n" \ - " filter_tx :{}" + " header :{}\n" \ + " txs :{}\n" \ + " tx :{}\n" \ + " input :{}\n" \ + " output :{}\n" \ + " ins :{}\n" \ + " outs :{}\n" \ + " candidate :{}\n" \ + " confirmed :{}\n" \ + " ecdsa0 :{}\n" \ + " ecdsa1 :{}\n" \ + " schnorr0 :{}\n" \ + " schnorr1 :{}\n" \ + " prevalid0 :{}\n" \ + " prevalid1 :{}\n" \ + " presilent0 :{}\n" \ + " presilent1 :{}\n" \ + " silent0 :{}\n" \ + " silent1 :{}\n" \ + " silent0_prefix:{}\n" \ + " silent1_prefix:{}\n" \ + " prevout :{}\n" \ + " duplicate :{}\n" \ + " strong :{}\n" \ + " scan :{}\n" \ + " scan_prefix :{}\n" \ + " state :{}\n" \ + " pool :{}\n" \ + " wtxid :{}\n" \ + " spends :{}\n" \ + " filter_bk :{}\n" \ + " filter_tx :{}" #define BS_INFORMATION_RECORDS \ "Table records...\n" \ - " header :{}\n" \ - " tx :{}\n" \ - " ins :{}\n" \ - " outs :{}\n" \ - " candidate :{}\n" \ - " confirmed :{}\n" \ - " ecdsa0 :{}\n" \ - " ecdsa1 :{}\n" \ - " schnorr0 :{}\n" \ - " schnorr1 :{}\n" \ - " prevalid0 :{}\n" \ - " prevalid1 :{}\n" \ - " presilent0:{}\n" \ - " presilent1:{}\n" \ - " silent0 :{}\n" \ - " silent1 :{}\n" \ - " silent0pfx:{}\n" \ - " silent1pfx:{}\n" \ - " duplicate :{}\n" \ - " strong_tx :{}\n" \ - " scan :{}\n" \ - " scanprefix:{}\n" \ - " state :{}\n" \ - " pool :{}\n" \ - " spends :{}\n" \ - " filter_bk :{}" + " header :{}\n" \ + " tx :{}\n" \ + " ins :{}\n" \ + " outs :{}\n" \ + " candidate :{}\n" \ + " confirmed :{}\n" \ + " ecdsa0 :{}\n" \ + " ecdsa1 :{}\n" \ + " schnorr0 :{}\n" \ + " schnorr1 :{}\n" \ + " prevalid0 :{}\n" \ + " prevalid1 :{}\n" \ + " presilent0 :{}\n" \ + " presilent1 :{}\n" \ + " silent0 :{}\n" \ + " silent1 :{}\n" \ + " silent0_prefix:{}\n" \ + " silent1_prefix:{}\n" \ + " duplicate :{}\n" \ + " strong :{}\n" \ + " scan :{}\n" \ + " scan_prefix :{}\n" \ + " state :{}\n" \ + " pool :{}\n" \ + " wtxid :{}\n" \ + " spends :{}\n" \ + " filter_bk :{}" #define BS_INFORMATION_BUCKETS \ "Head buckets...\n" \ - " header :{}\n" \ - " txs :{}\n" \ - " tx :{}\n" \ - " ins :{}\n" \ - " outs :{}\n" \ - " prevout :{}\n" \ - " duplicate :{}\n" \ - " strong_tx :{}\n" \ - " pool :{}\n" \ - " filter_bk :{}\n" \ - " filter_tx :{}" + " header :{}\n" \ + " txs :{}\n" \ + " tx :{}\n" \ + " ins :{}\n" \ + " outs :{}\n" \ + " prevout :{}\n" \ + " duplicate :{}\n" \ + " strong :{}\n" \ + " pool :{}\n" \ + " wtxid :{}\n" \ + " filter_bk :{}\n" \ + " filter_tx :{}" #define BS_INFORMATION_COLLISION_RATES \ "Collision rates...\n" \ - " header :{}\n" \ - " tx :{}\n" \ - " ins :{}\n" \ - " strong_tx :{}\n" \ - " pool :{}" -#define BS_INFORMATION_COLLISION_RATES_ADDRESS \ + " header :{}\n" \ + " tx :{}\n" \ + " ins :{}\n" \ + " strong :{}\n" \ + " pool :{}\n" \ + " wtxid :{}" +#define BS_INFORMATION_COLLISION_RATES_OUTS \ "Collision rates...\n" \ - " header :{}\n" \ - " tx :{}\n" \ - " ins :{}\n" \ - " outs :{}\n" \ - " strong_tx :{}\n" \ - " pool :{}" + " header :{}\n" \ + " tx :{}\n" \ + " ins :{}\n" \ + " outs :{}\n" \ + " strong :{}\n" \ + " pool :{}\n" \ + " wtxid :{}" #define BS_INFORMATION_PROGRESS_START \ "Thinking..." #define BS_INFORMATION_PROGRESS \ diff --git a/src/parser.cpp b/src/parser.cpp index 72493cf1..bba29fa7 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -156,9 +156,9 @@ parser::parser(system::chain::selection context, configured.database.confirmed.buckets = 950'001; configured.database.confirmed.rate = 1; - configured.database.strong_tx.expected = 1'359'871'695; - configured.database.strong_tx.size = 149'585'887; - configured.database.strong_tx.rate = 1; + configured.database.strong.expected = 1'359'871'695; + configured.database.strong.size = 149'585'887; + configured.database.strong.rate = 1; configured.database.scan.buckets = 950'001; configured.database.scan.size = 0; configured.database.scan.rate = 1; @@ -192,6 +192,9 @@ parser::parser(system::chain::selection context, configured.database.pool.expected = 10'000'000; configured.database.pool.size = 0; configured.database.pool.rate = 1; + configured.database.wtxid.expected = 10'000'000; + configured.database.wtxid.size = 0; + configured.database.wtxid.rate = 1; configured.database.spends.size = 0; configured.database.spends.rate = 1; @@ -235,12 +238,16 @@ void parser::derive_buckets() NOEXCEPT database.outs.expected, address_contested, address_target); if (!is_configured("table.strong.buckets")) - database.strong_tx.buckets = table::strong_tx::derive_buckets( - database.strong_tx.expected, contested, target); + database.strong.buckets = table::strong::derive_buckets( + database.strong.expected, contested, target); if (!is_configured("table.pool.buckets")) database.pool.buckets = table::pool::derive_buckets( database.pool.expected, contested, target); + + if (!is_configured("table.wtxid.buckets")) + database.wtxid.buckets = table::wtxid::derive_buckets( + database.wtxid.expected, contested, target); } // Composes a variable name with its command line shortcut. @@ -2248,192 +2255,214 @@ options_metadata parser::load_settings() THROWS ( "table.header.buckets", setting(&configured.database.header.buckets), - "The number of buckets in the archive_header table head, dynamic default." + "The number of buckets in the header table head, dynamic default." ) ( "table.header.expected", setting(&configured.database.header.expected), - "The expected element count of the archive_header table, defaults to {}." + "The expected element count of the header table, defaults to {}." ) ( "table.header.size", setting(&configured.database.header.size), - "The minimum allocation of the archive_header table body, defaults to {}." + "The minimum allocation of the header table body, defaults to {}." ) ( "table.header.rate", setting(&configured.database.header.rate), - "The percentage expansion of the archive_header table body, defaults to {}." + "The percentage expansion of the header table body, defaults to {}." ) /* table.input */ ( "table.input.size", setting(&configured.database.input.size), - "The minimum allocation of the archive_input table body, defaults to {}." + "The minimum allocation of the input table body, defaults to {}." ) ( "table.input.rate", setting(&configured.database.input.rate), - "The percentage expansion of the archive_input table body, defaults to {}." + "The percentage expansion of the input table body, defaults to {}." ) /* table.output */ ( "table.output.size", setting(&configured.database.output.size), - "The minimum allocation of the archive_output table body, defaults to {}." + "The minimum allocation of the output table body, defaults to {}." ) ( "table.output.rate", setting(&configured.database.output.rate), - "The percentage expansion of the archive_output table body, defaults to {}." + "The percentage expansion of the output table body, defaults to {}." ) /* table.ins */ ( "table.ins.buckets", setting(&configured.database.ins.buckets), - "The number of buckets in the archive_ins table head, dynamic default." + "The number of buckets in the ins table head, dynamic default." ) ( "table.ins.expected", setting(&configured.database.ins.expected), - "The expected element count of the archive_ins table, defaults to {}." + "The expected element count of the ins table, defaults to {}." ) ( "table.ins.size", setting(&configured.database.ins.size), - "The minimum allocation of the archive_ins table body, defaults to {}." + "The minimum allocation of the ins table body, defaults to {}." ) ( "table.ins.rate", setting(&configured.database.ins.rate), - "The percentage expansion of the archive_ins table body, defaults to {}." + "The percentage expansion of the ins table body, defaults to {}." ) /* table.outs */ ( "table.outs.buckets", setting(&configured.database.outs.buckets), - "The number of buckets in the archive_outs table head, dynamic default (0 disables address index)." + "The number of buckets in the outs table head, dynamic default (0 disables address index)." ) ( "table.outs.expected", setting(&configured.database.outs.expected), - "The expected element count of the archive_outs table, defaults to {}." + "The expected element count of the outs table, defaults to {}." ) ( "table.outs.size", setting(&configured.database.outs.size), - "The minimum allocation of the archive_outs table body, defaults to {}." + "The minimum allocation of the outs table body, defaults to {}." ) ( "table.outs.rate", setting(&configured.database.outs.rate), - "The percentage expansion of the archive_outs table body, defaults to {}." + "The percentage expansion of the outs table body, defaults to {}." ) /* table.tx */ ( "table.tx.buckets", setting(&configured.database.tx.buckets), - "The number of buckets in the archive_tx table head, dynamic default." + "The number of buckets in the tx table head, dynamic default." ) ( "table.tx.expected", setting(&configured.database.tx.expected), - "The expected element count of the archive_tx table, defaults to {}." + "The expected element count of the tx table, defaults to {}." ) ( "table.tx.size", setting(&configured.database.tx.size), - "The minimum allocation of the archive_tx table body, defaults to {}." + "The minimum allocation of the tx table body, defaults to {}." ) ( "table.tx.rate", setting(&configured.database.tx.rate), - "The percentage expansion of the archive_tx table body, defaults to {}." + "The percentage expansion of the tx table body, defaults to {}." ) /* table.txs */ ( "table.txs.buckets", setting(&configured.database.txs.buckets), - "The number of buckets in the archive_txs table head, defaults to {}." + "The number of buckets in the txs table head, defaults to {}." ) ( "table.txs.size", setting(&configured.database.txs.size), - "The minimum allocation of the archive_txs table body, defaults to {}." + "The minimum allocation of the txs table body, defaults to {}." ) ( "table.txs.rate", setting(&configured.database.txs.rate), - "The percentage expansion of the archive_txs table body, defaults to {}." + "The percentage expansion of the txs table body, defaults to {}." ) /* table.candidate */ ( "table.candidate.buckets", setting(&configured.database.candidate.buckets), - "The number of buckets provisioned in the index_candidate table head, defaults to {}." + "The number of buckets provisioned in the candidate table head, defaults to {}." ) ( "table.candidate.rate", setting(&configured.database.candidate.rate), - "The percentage expansion of the index_candidate table head, defaults to {}." + "The percentage expansion of the candidate table head, defaults to {}." ) /* table.confirmed */ ( "table.confirmed.buckets", setting(&configured.database.confirmed.buckets), - "The number of buckets provisioned in the index_confirmed table head, defaults to {}." + "The number of buckets provisioned in the confirmed table head, defaults to {}." ) ( "table.confirmed.rate", setting(&configured.database.confirmed.rate), - "The percentage expansion of the index_confirmed table head, defaults to {}." + "The percentage expansion of the confirmed table head, defaults to {}." ) /* table.strong */ ( "table.strong.buckets", - setting(&configured.database.strong_tx.buckets), - "The number of buckets in the index_strong table head, dynamic default." + setting(&configured.database.strong.buckets), + "The number of buckets in the strong table head, dynamic default." ) ( "table.strong.expected", - setting(&configured.database.strong_tx.expected), - "The expected element count of the index_strong table, defaults to {}." + setting(&configured.database.strong.expected), + "The expected element count of the strong table, defaults to {}." ) ( "table.strong.size", - setting(&configured.database.strong_tx.size), - "The minimum allocation of the index_strong table body, defaults to {}." + setting(&configured.database.strong.size), + "The minimum allocation of the strong table body, defaults to {}." ) ( "table.strong.rate", - setting(&configured.database.strong_tx.rate), - "The percentage expansion of the index_strong table body, defaults to {}." + setting(&configured.database.strong.rate), + "The percentage expansion of the strong table body, defaults to {}." ) /* table.scan */ ( "table.scan.buckets", setting(&configured.database.scan.buckets), - "The number of buckets provisioned in the index_scan table head, defaults to {}." + "The number of buckets provisioned in the scan table head, defaults to {}." ) ( "table.scan.size", setting(&configured.database.scan.size), - "The minimum allocation of the index_scan table body, defaults to {}." + "The minimum allocation of the scan table body, defaults to {}." ) ( "table.scan.rate", setting(&configured.database.scan.rate), - "The percentage expansion of the index_scan table body, defaults to {}." + "The percentage expansion of the scan table body, defaults to {}." + ) + + /* table.wtxid */ + ( + "table.wtxid.buckets", + setting(&configured.database.wtxid.buckets), + "The number of buckets in the wtxid table head, dynamic default (0 disables)." + ) + ( + "table.wtxid.expected", + setting(&configured.database.wtxid.expected), + "The expected element count of the wtxid table, defaults to {}." + ) + ( + "table.wtxid.size", + setting(&configured.database.wtxid.size), + "The minimum allocation of the wtxid table body, defaults to {}." + ) + ( + "table.wtxid.rate", + setting(&configured.database.wtxid.rate), + "The percentage expansion of the wtxid table body, defaults to {}." ) /* table.ecdsa */ @@ -2500,51 +2529,51 @@ options_metadata parser::load_settings() THROWS ( "table.prevout.buckets", setting(&configured.database.prevout.buckets), - "The minimum number of buckets in the cache_prevout table head, defaults to {}." + "The minimum number of buckets in the prevout table head, defaults to {}." ) ( "table.prevout.size", setting(&configured.database.prevout.size), - "The minimum allocation of the cache_prevout table body, defaults to {}." + "The minimum allocation of the prevout table body, defaults to {}." ) ( "table.prevout.rate", setting(&configured.database.prevout.rate), - "The percentage expansion of the cache_prevout table, defaults to {}." + "The percentage expansion of the prevout table, defaults to {}." ) /* table.duplicate */ ( "table.duplicate.buckets", setting(&configured.database.duplicate.buckets), - "The minimum number of buckets in the cache_duplicate table head, defaults to {}." + "The minimum number of buckets in the duplicate table head, defaults to {}." ) ( "table.duplicate.expected", setting(&configured.database.duplicate.expected), - "The expected element count of the cache_duplicate table, defaults to {}." + "The expected element count of the duplicate table, defaults to {}." ) ( "table.duplicate.size", setting(&configured.database.duplicate.size), - "The minimum allocation of the cache_duplicate table body, defaults to {}." + "The minimum allocation of the duplicate table body, defaults to {}." ) ( "table.duplicate.rate", setting(&configured.database.duplicate.rate), - "The percentage expansion of the cache_duplicate table, defaults to {}." + "The percentage expansion of the duplicate table, defaults to {}." ) /* table.state */ ( "table.state.buckets", setting(&configured.database.state.buckets), - "The number of buckets provisioned in the index_state table head, defaults to {}." + "The number of buckets provisioned in the state table head, defaults to {}." ) ( "table.state.rate", setting(&configured.database.state.rate), - "The percentage expansion of the index_state table head, defaults to {}." + "The percentage expansion of the state table head, defaults to {}." ) /* table.pool */ @@ -2585,34 +2614,34 @@ options_metadata parser::load_settings() THROWS ( "table.filter_bk.buckets", setting(&configured.database.filter_bk.buckets), - "The number of buckets in the option_filter_bk table head, defaults to {} (0 disables)." + "The number of buckets in the filter_bk table head, defaults to {} (0 disables)." ) ( "table.filter_bk.size", setting(&configured.database.filter_bk.size), - "The minimum allocation of the option_filter_bk table body, defaults to {}." + "The minimum allocation of the filter_bk table body, defaults to {}." ) ( "table.filter_bk.rate", setting(&configured.database.filter_bk.rate), - "The percentage expansion of the option_filter_bk table body, defaults to {}." + "The percentage expansion of the filter_bk table body, defaults to {}." ) /* table.filter_tx */ ( "table.filter_tx.buckets", setting(&configured.database.filter_tx.buckets), - "The number of buckets in the option_filter_tx table head, defaults to {} (0 disables)." + "The number of buckets in the filter_tx table head, defaults to {} (0 disables)." ) ( "table.filter_tx.size", setting(&configured.database.filter_tx.size), - "The minimum allocation of the option_filter_tx table body, defaults to {}." + "The minimum allocation of the filter_tx table body, defaults to {}." ) ( "table.filter_tx.rate", setting(&configured.database.filter_tx.rate), - "The percentage expansion of the option_filter_tx table body, defaults to {}." + "The percentage expansion of the filter_tx table body, defaults to {}." ) /* [log] */