Skip to content

Commit 2e984ee

Browse files
authored
Merge pull request #740 from evoskuil/master
Adapt to store removal of spend index.
2 parents f85e649 + 3e78cf7 commit 2e984ee

File tree

5 files changed

+27
-46
lines changed

5 files changed

+27
-46
lines changed

console/executor_dumps.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ void executor::dump_body_sizes() const
9898
query_.puts_body_size() %
9999
query_.candidate_body_size() %
100100
query_.confirmed_body_size() %
101-
query_.spend_body_size() %
102101
query_.prevout_body_size() %
103102
query_.strong_tx_body_size() %
104103
query_.validated_tx_body_size() %
@@ -115,7 +114,6 @@ void executor::dump_records() const
115114
query_.point_records() %
116115
query_.candidate_records() %
117116
query_.confirmed_records() %
118-
query_.spend_records() %
119117
query_.prevout_records() %
120118
query_.strong_tx_records() %
121119
query_.address_records());
@@ -127,7 +125,7 @@ void executor::dump_buckets() const
127125
query_.header_buckets() %
128126
query_.txs_buckets() %
129127
query_.tx_buckets() %
130-
query_.spend_buckets() %
128+
query_.point_buckets() %
131129
query_.prevout_buckets() %
132130
query_.strong_tx_buckets() %
133131
query_.validated_tx_buckets() %
@@ -143,7 +141,7 @@ void executor::dump_collisions() const
143141
(to_double(query_.header_records()) / query_.header_buckets()) %
144142
(to_double(query_.header_records()) / query_.txs_buckets()) %
145143
(to_double(query_.tx_records()) / query_.tx_buckets()) %
146-
(to_double(query_.spend_records()) / query_.spend_buckets()) %
144+
(to_double(query_.point_records()) / query_.point_buckets()) %
147145
(to_double(query_.prevout_records()) / query_.prevout_buckets()) %
148146
(to_double(query_.strong_tx_records()) / query_.strong_tx_buckets()) %
149147
(to_double(query_.tx_records()) / query_.validated_tx_buckets()) %

console/executor_scans.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,22 +193,22 @@ void executor::scan_buckets() const
193193
filled = zero;
194194
bucket = max_size_t;
195195
start = logger::now();
196-
while (!cancel_ && (++bucket < query_.spend_buckets()))
196+
while (!cancel_ && (++bucket < query_.point_buckets()))
197197
{
198-
const auto top = query_.top_spend(bucket);
198+
const auto top = query_.top_point(bucket);
199199
if (!top.is_terminal())
200200
++filled;
201201

202202
if (is_zero(bucket % put_frequency))
203-
logger(format("spend" BN_READ_ROW) % bucket %
203+
logger(format("point" BN_READ_ROW) % bucket %
204204
duration_cast<seconds>(logger::now() - start).count());
205205
}
206206

207207
if (cancel_)
208208
logger(BN_OPERATION_CANCELED);
209209

210210
span = duration_cast<seconds>(logger::now() - start);
211-
logger(format("spend" BN_READ_ROW) % (to_double(filled) / bucket) %
211+
logger(format("point" BN_READ_ROW) % (to_double(filled) / bucket) %
212212
span.count());
213213
}
214214

@@ -358,13 +358,13 @@ void executor::scan_collisions() const
358358
strong_tx.clear();
359359
strong_tx.shrink_to_fit();
360360

361-
// spend
361+
// point
362362
// ------------------------------------------------------------------------
363363

364364
auto total = zero;
365365
index = max_size_t;
366366
start = logger::now();
367-
const auto spend_buckets = query_.spend_buckets();
367+
const auto spend_buckets = query_.point_buckets();
368368
std_vector<size_t> spend(spend_buckets, empty);
369369
while (!cancel_ && (++index < query_.header_records()))
370370
{
@@ -376,7 +376,7 @@ void executor::scan_collisions() const
376376
for (const auto& point: points)
377377
{
378378
++total;
379-
++spend.at(hash(query_.to_spend_key(point)) % spend_buckets);
379+
++spend.at(hash(query_.get_point_key(point)) % spend_buckets);
380380

381381
if (is_zero(index % put_frequency))
382382
logger(format("spend" BN_READ_ROW) % total %

console/localize.hpp

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,24 +79,22 @@ namespace node {
7979
" puts :%7%\n" \
8080
" candidate :%8%\n" \
8181
" confirmed :%9%\n" \
82-
" spend :%10%\n" \
83-
" prevout :%11%\n" \
84-
" strong_tx :%12%\n" \
85-
" valid_tx :%13%\n" \
86-
" valid_bk :%14%\n" \
87-
" address :%15%\n" \
88-
" neutrino :%16%"
82+
" prevout :%10%\n" \
83+
" strong_tx :%11%\n" \
84+
" valid_tx :%12%\n" \
85+
" valid_bk :%13%\n" \
86+
" address :%14%\n" \
87+
" neutrino :%15%"
8988
#define BN_MEASURE_RECORDS \
9089
"Table records...\n" \
9190
" header :%1%\n" \
9291
" tx :%2%\n" \
9392
" point :%3%\n" \
9493
" candidate :%4%\n" \
9594
" confirmed :%5%\n" \
96-
" spend :%6%\n" \
97-
" prevout :%7%\n" \
98-
" strong_tx :%8%\n" \
99-
" address :%9%"
95+
" prevout :%6%\n" \
96+
" strong_tx :%7%\n" \
97+
" address :%8%"
10098
#define BN_MEASURE_SLABS \
10199
"Table slabs..."
102100
#define BN_MEASURE_SLABS_ROW \
@@ -110,7 +108,7 @@ namespace node {
110108
" header :%1%\n" \
111109
" txs :%2%\n" \
112110
" tx :%3%\n" \
113-
" spend :%4%\n" \
111+
" point :%4%\n" \
114112
" prevout :%5%\n" \
115113
" strong_tx :%6%\n" \
116114
" valid_tx :%7%\n" \
@@ -122,7 +120,7 @@ namespace node {
122120
" header :%1%\n" \
123121
" txs :%2%\n" \
124122
" tx :%3%\n" \
125-
" spend :%4%\n" \
123+
" point :%4%\n" \
126124
" prevout :%5%\n" \
127125
" strong_tx :%6%\n" \
128126
" valid_tx :%7%\n" \

src/chasers/chaser_check.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ code chaser_check::start() NOEXCEPT
7373
{
7474
start_tracking();
7575
set_position(archive().get_fork());
76-
requested_ = position();
76+
requested_ = advanced_ = position();
7777
const auto added = set_unassociated();
7878
LOGN("Fork point (" << requested_ << ") unassociated (" << added << ").");
7979

src/parser.cpp

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ parser::parser(system::chain::selection context) NOEXCEPT
8282
configured.database.output_size = 25'300'000'000;
8383
configured.database.output_rate = 5;
8484

85+
configured.database.point_buckets = 1'750'905'073;
8586
configured.database.point_size = 21'100'000'000;
8687
configured.database.point_rate = 5;
8788

@@ -91,10 +92,6 @@ parser::parser(system::chain::selection context) NOEXCEPT
9192
configured.database.puts_size = 3'700'000'000;
9293
configured.database.puts_rate = 5;
9394

94-
configured.database.spend_buckets = 1'750'905'073;
95-
configured.database.spend_size = 10'000'000'000;
96-
configured.database.spend_rate = 5;
97-
9895
configured.database.tx_buckets = 688'193'037;
9996
configured.database.tx_size = 17'050'000'000;
10097
configured.database.tx_rate = 5;
@@ -696,6 +693,11 @@ options_metadata parser::load_settings() THROWS
696693
)
697694

698695
/* point */
696+
(
697+
"database.point_buckets",
698+
value<uint32_t>(&configured.database.point_buckets),
699+
"The number of buckets in the spend table head, defaults to '1750905073'."
700+
)
699701
(
700702
"database.point_size",
701703
value<uint64_t>(&configured.database.point_size),
@@ -731,23 +733,6 @@ options_metadata parser::load_settings() THROWS
731733
"The percentage expansion of the puts table body, defaults to '5'."
732734
)
733735

734-
/* spend */
735-
(
736-
"database.spend_buckets",
737-
value<uint32_t>(&configured.database.spend_buckets),
738-
"The number of buckets in the spend table head, defaults to '1750905073'."
739-
)
740-
(
741-
"database.spend_size",
742-
value<uint64_t>(&configured.database.spend_size),
743-
"The minimum allocation of the spend table body, defaults to '10000000000'."
744-
)
745-
(
746-
"database.spend_rate",
747-
value<uint16_t>(&configured.database.spend_rate),
748-
"The percentage expansion of the spend table body, defaults to '5'."
749-
)
750-
751736
/* tx */
752737
(
753738
"database.tx_buckets",

0 commit comments

Comments
 (0)