Skip to content

Commit

Permalink
Merge pull request #735 from evoskuil/master
Browse files Browse the repository at this point in the history
Adapt to database changes, update table config.
  • Loading branch information
evoskuil authored Feb 14, 2025
2 parents 7e3878d + 5c93c06 commit 0f74846
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
6 changes: 3 additions & 3 deletions console/executor_scans.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 %
Expand Down
34 changes: 17 additions & 17 deletions console/executor_test_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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{};
Expand Down Expand Up @@ -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;
Expand All @@ -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)
Expand Down Expand Up @@ -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 %
Expand Down
20 changes: 10 additions & 10 deletions src/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,18 @@ 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_size = 3'700'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_buckets = 1'750'905'073;
configured.database.spend_size = 10'000'000'000;
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;
Expand Down Expand Up @@ -696,7 +696,7 @@ options_metadata parser::load_settings() THROWS
(
"database.point_size",
value<uint64_t>(&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",
Expand All @@ -708,7 +708,7 @@ options_metadata parser::load_settings() THROWS
(
"database.puts_size",
value<uint64_t>(&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",
Expand All @@ -720,12 +720,12 @@ options_metadata parser::load_settings() THROWS
(
"database.spend_buckets",
value<uint32_t>(&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",
value<uint64_t>(&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",
Expand All @@ -742,7 +742,7 @@ options_metadata parser::load_settings() THROWS
(
"database.tx_size",
value<uint64_t>(&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",
Expand Down

0 comments on commit 0f74846

Please sign in to comment.