From ac18c594776651a69bcd6f15a4be9f6a4ba167bd Mon Sep 17 00:00:00 2001 From: evoskuil Date: Mon, 10 Feb 2025 22:03:15 -0500 Subject: [PATCH 1/4] Adapt to database changes. --- console/executor_scans.cpp | 6 +++--- console/executor_test_reader.cpp | 34 ++++++++++++++++---------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/console/executor_scans.cpp b/console/executor_scans.cpp index e8ee53fba..80e3b7d24 100644 --- a/console/executor_scans.cpp +++ b/console/executor_scans.cpp @@ -372,11 +372,11 @@ void executor::scan_collisions() const const auto transactions = query_.to_transactions(link); for (const auto& transaction: transactions) { - const auto inputs = query_.to_spends(transaction); - for (const auto& in: inputs) + const auto points = query_.to_points(transaction); + for (const auto& point: points) { ++total; - ++spend.at(hash(query_.get_spend_key(in)) % spend_buckets); + ++spend.at(hash(query_.to_spend_key(point)) % spend_buckets); if (is_zero(index % put_frequency)) logger(format("spend" BN_READ_ROW) % total % diff --git a/console/executor_test_reader.cpp b/console/executor_test_reader.cpp index 30dbe7ac7..6469ac29c 100644 --- a/console/executor_test_reader.cpp +++ b/console/executor_test_reader.cpp @@ -87,8 +87,8 @@ void executor::read_test(bool dump) const size_t tx_position; hash_digest tx_hash; - uint32_t sp_tx_fk; - hash_digest sp_tx_hash; + uint32_t pt_tx_fk; + hash_digest pt_tx_hash; uint64_t input_fk; chain::input::cptr input{}; @@ -160,24 +160,24 @@ void executor::read_test(bool dump) const return; } - spend_link sp_fk{}; + point_link pt_fk{}; input_link in_fk{}; - tx_link sp_tx_fk{}; + tx_link pt_tx_fk{}; // Get first spender only (may or may not be confirmed). - const auto spenders = query_.to_spenders(out_fk); - if (!spenders.empty()) + const auto points = query_.to_spenders(out_fk); + if (!points.empty()) { - sp_fk = spenders.front(); - table::spend::record spend{}; - if (!store_.spend.get(sp_fk, spend)) + pt_fk = points.front(); + table::point::record point{}; + if (!store_.point.get(pt_fk, point)) { - // fault, missing spender. + // fault, missing point. return; } - in_fk = spend.input_fk; - sp_tx_fk = spend.parent_fk; + in_fk = point.input_fk; + pt_tx_fk = point.parent_fk; } ////++found; @@ -193,11 +193,11 @@ void executor::read_test(bool dump) const txs.position, query_.get_tx_key(tx_fk), - sp_tx_fk, - query_.get_tx_key(sp_tx_fk), + pt_tx_fk, + query_.get_tx_key(pt_tx_fk), in_fk, - query_.get_input(sp_fk), + query_.get_input(pt_fk), out_fk, query_.get_output(out_fk) @@ -261,8 +261,8 @@ void executor::read_test(bool dump) const row.tx_position % encode_hash(row.tx_hash) % - row.sp_tx_fk % - encode_hash(row.sp_tx_hash) % + row.pt_tx_fk % + encode_hash(row.pt_tx_hash) % row.output_fk % output % From b7312793efe879c4cd9d824cae4ec6a957234d41 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Mon, 10 Feb 2025 22:37:17 -0500 Subject: [PATCH 2/4] Change spend and point table side defaults. --- src/parser.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/parser.cpp b/src/parser.cpp index a7d8a819f..91788f406 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -82,14 +82,14 @@ parser::parser(system::chain::selection context) NOEXCEPT configured.database.output_size = 25'300'000'000; configured.database.output_rate = 5; - configured.database.point_size = 8'389'074'978; + configured.database.point_size = 32'000'000'000; configured.database.point_rate = 5; configured.database.puts_size = 6'300'000'000; configured.database.puts_rate = 5; configured.database.spend_buckets = 1'751'471'741; - configured.database.spend_size = 16'000'000'000; + configured.database.spend_size = 10'000'000'000; configured.database.spend_rate = 5; configured.database.tx_buckets = 688'193'037; @@ -696,7 +696,7 @@ options_metadata parser::load_settings() THROWS ( "database.point_size", value(&configured.database.point_size), - "The minimum allocation of the point table body, defaults to '8389074978'." + "The minimum allocation of the point table body, defaults to '32000000000'." ) ( "database.point_rate", @@ -725,7 +725,7 @@ options_metadata parser::load_settings() THROWS ( "database.spend_size", value(&configured.database.spend_size), - "The minimum allocation of the spend table body, defaults to '16000000000'." + "The minimum allocation of the spend table body, defaults to '10000000000'." ) ( "database.spend_rate", From d53ea38b8510be39149957f0b0b15fd055532dbb Mon Sep 17 00:00:00 2001 From: evoskuil Date: Mon, 10 Feb 2025 22:37:52 -0500 Subject: [PATCH 3/4] Change spend buckets to previous point buckets (index swap). --- src/parser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser.cpp b/src/parser.cpp index 91788f406..ebef87e0d 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -88,7 +88,7 @@ parser::parser(system::chain::selection context) NOEXCEPT configured.database.puts_size = 6'300'000'000; configured.database.puts_rate = 5; - configured.database.spend_buckets = 1'751'471'741; + configured.database.spend_buckets = 1'750'905'073; configured.database.spend_size = 10'000'000'000; configured.database.spend_rate = 5; @@ -720,7 +720,7 @@ options_metadata parser::load_settings() THROWS ( "database.spend_buckets", value(&configured.database.spend_buckets), - "The number of buckets in the spend table head, defaults to '1751471741'." + "The number of buckets in the spend table head, defaults to '1750905073'." ) ( "database.spend_size", From 5c93c06a455c6671d9e849d4d41557919f71fbd7 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Wed, 12 Feb 2025 03:56:30 -0500 Subject: [PATCH 4/4] Reduce puts and increase tx table default initial sizes. --- src/parser.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/parser.cpp b/src/parser.cpp index ebef87e0d..9ebdd4c58 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -85,7 +85,7 @@ parser::parser(system::chain::selection context) NOEXCEPT configured.database.point_size = 32'000'000'000; configured.database.point_rate = 5; - configured.database.puts_size = 6'300'000'000; + configured.database.puts_size = 3'700'000'000; configured.database.puts_rate = 5; configured.database.spend_buckets = 1'750'905'073; @@ -93,7 +93,7 @@ parser::parser(system::chain::selection context) NOEXCEPT configured.database.spend_rate = 5; configured.database.tx_buckets = 688'193'037; - configured.database.tx_size = 16'150'000'000; + configured.database.tx_size = 17'050'000'000; configured.database.tx_rate = 5; configured.database.txs_buckets = 566'667; @@ -708,7 +708,7 @@ options_metadata parser::load_settings() THROWS ( "database.puts_size", value(&configured.database.puts_size), - "The minimum allocation of the puts table body, defaults to '6300000000'." + "The minimum allocation of the puts table body, defaults to '3700000000'." ) ( "database.puts_rate", @@ -742,7 +742,7 @@ options_metadata parser::load_settings() THROWS ( "database.tx_size", value(&configured.database.tx_size), - "The minimum allocation of the tx table body, defaults to '16150000000'." + "The minimum allocation of the tx table body, defaults to '17050000000'." ) ( "database.tx_rate",