Skip to content

Commit fa0cbba

Browse files
authored
Merge pull request #728 from evoskuil/master
Adapt to store change of point table removal.
2 parents 4016527 + e7cf641 commit fa0cbba

File tree

5 files changed

+42
-129
lines changed

5 files changed

+42
-129
lines changed

console/executor_dumps.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ void executor::dump_body_sizes() const
9292
query_.header_body_size() %
9393
query_.txs_body_size() %
9494
query_.tx_body_size() %
95-
query_.point_body_size() %
9695
query_.input_body_size() %
9796
query_.output_body_size() %
9897
query_.puts_body_size() %
@@ -112,7 +111,6 @@ void executor::dump_records() const
112111
logger(format(BN_MEASURE_RECORDS) %
113112
query_.header_records() %
114113
query_.tx_records() %
115-
query_.point_records() %
116114
query_.candidate_records() %
117115
query_.confirmed_records() %
118116
query_.spend_records() %
@@ -127,7 +125,6 @@ void executor::dump_buckets() const
127125
query_.header_buckets() %
128126
query_.txs_buckets() %
129127
query_.tx_buckets() %
130-
query_.point_buckets() %
131128
query_.spend_buckets() %
132129
query_.prevout_buckets() %
133130
query_.strong_tx_buckets() %
@@ -144,7 +141,6 @@ void executor::dump_collisions() const
144141
(to_double(query_.header_records()) / query_.header_buckets()) %
145142
(to_double(query_.header_records()) / query_.txs_buckets()) %
146143
(to_double(query_.tx_records()) / query_.tx_buckets()) %
147-
(to_double(query_.point_records()) / query_.point_buckets()) %
148144
(to_double(query_.spend_records()) / query_.spend_buckets()) %
149145
(to_double(query_.prevout_records()) / query_.prevout_buckets()) %
150146
(to_double(query_.strong_tx_records()) / query_.strong_tx_buckets()) %

console/executor_scans.cpp

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -190,29 +190,6 @@ void executor::scan_buckets() const
190190

191191
// ------------------------------------------------------------------------
192192

193-
filled = zero;
194-
bucket = max_size_t;
195-
start = logger::now();
196-
while (!cancel_ && (++bucket < query_.point_buckets()))
197-
{
198-
const auto top = query_.top_point(bucket);
199-
if (!top.is_terminal())
200-
++filled;
201-
202-
if (is_zero(bucket % tx_frequency))
203-
logger(format("point" BN_READ_ROW) % bucket %
204-
duration_cast<seconds>(logger::now() - start).count());
205-
}
206-
207-
if (cancel_)
208-
logger(BN_OPERATION_CANCELED);
209-
210-
span = duration_cast<seconds>(logger::now() - start);
211-
logger(format("point" BN_READ_ROW) % (to_double(filled) / bucket) %
212-
span.count());
213-
214-
// ------------------------------------------------------------------------
215-
216193
filled = zero;
217194
bucket = max_size_t;
218195
start = logger::now();
@@ -381,42 +358,6 @@ void executor::scan_collisions() const
381358
strong_tx.clear();
382359
strong_tx.shrink_to_fit();
383360

384-
// point
385-
// ------------------------------------------------------------------------
386-
387-
index = max_size_t;
388-
start = logger::now();
389-
const auto point_buckets = query_.point_buckets();
390-
const auto point_records = query_.point_records();
391-
std_vector<size_t> point(point_buckets, empty);
392-
while (!cancel_ && (++index < point_records))
393-
{
394-
const tx_link link{ possible_narrow_cast<tx_link::integer>(index) };
395-
++point.at(hash(query_.get_point_key(link.value)) % point_buckets);
396-
397-
if (is_zero(index % tx_frequency))
398-
logger(format("point" BN_READ_ROW) % index %
399-
duration_cast<seconds>(logger::now() - start).count());
400-
}
401-
402-
if (cancel_)
403-
logger(BN_OPERATION_CANCELED);
404-
405-
// ........................................................................
406-
407-
const auto point_count = count(point);
408-
span = duration_cast<seconds>(logger::now() - start);
409-
logger(format("point: %1% in %2%s buckets %3% filled %4% rate %5%") %
410-
index % span.count() % point_buckets % point_count %
411-
(to_double(point_count) / point_buckets));
412-
413-
for (const auto& entry: dump(point))
414-
logger(format("point: %1% frequency: %2%") %
415-
entry.first % entry.second);
416-
417-
point.clear();
418-
point.shrink_to_fit();
419-
420361
// spend
421362
// ------------------------------------------------------------------------
422363

console/localize.hpp

Lines changed: 32 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -73,30 +73,28 @@ namespace node {
7373
" header :%1%\n" \
7474
" txs :%2%\n" \
7575
" tx :%3%\n" \
76-
" point :%4%\n" \
77-
" input :%5%\n" \
78-
" output :%6%\n" \
79-
" puts :%7%\n" \
80-
" candidate :%8%\n" \
81-
" 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%"
76+
" input :%4%\n" \
77+
" output :%5%\n" \
78+
" puts :%6%\n" \
79+
" candidate :%7%\n" \
80+
" confirmed :%8%\n" \
81+
" spend :%9%\n" \
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" \
93-
" point :%3%\n" \
94-
" candidate :%4%\n" \
95-
" confirmed :%5%\n" \
96-
" spend :%6%\n" \
97-
" prevout :%7%\n" \
98-
" strong_tx :%8%\n" \
99-
" address :%9%"
92+
" candidate :%3%\n" \
93+
" confirmed :%4%\n" \
94+
" spend :%5%\n" \
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,27 +108,25 @@ namespace node {
110108
" header :%1%\n" \
111109
" txs :%2%\n" \
112110
" tx :%3%\n" \
113-
" point :%4%\n" \
114-
" spend :%5%\n" \
115-
" prevout :%6%\n" \
116-
" strong_tx :%7%\n" \
117-
" valid_tx :%8%\n" \
118-
" valid_bk :%9%\n" \
119-
" address :%10%\n" \
120-
" neutrino :%11%"
111+
" spend :%4%\n" \
112+
" prevout :%5%\n" \
113+
" strong_tx :%6%\n" \
114+
" valid_tx :%7%\n" \
115+
" valid_bk :%8%\n" \
116+
" address :%9%\n" \
117+
" neutrino :%10%"
121118
#define BN_MEASURE_COLLISION_RATES \
122119
"Collision rates...\n" \
123120
" header :%1%\n" \
124121
" txs :%2%\n" \
125122
" tx :%3%\n" \
126-
" point :%4%\n" \
127-
" spend :%5%\n" \
128-
" prevout :%6%\n" \
129-
" strong_tx :%7%\n" \
130-
" valid_tx :%8%\n" \
131-
" valid_bk :%9%\n" \
132-
" address :%10%\n" \
133-
" neutrino :%11%"
123+
" spend :%4%\n" \
124+
" prevout :%5%\n" \
125+
" strong_tx :%6%\n" \
126+
" valid_tx :%7%\n" \
127+
" valid_bk :%8%\n" \
128+
" address :%9%\n" \
129+
" neutrino :%10%"
134130
#define BN_MEASURE_PROGRESS_START \
135131
"Thinking..."
136132
#define BN_MEASURE_PROGRESS \

src/chasers/chaser_check.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,12 @@ void chaser_check::do_confirmable(height_t height) NOEXCEPT
209209
{
210210
BC_ASSERT(stranded());
211211

212-
// Confirmations are ordered, but notification order isn't guaranteed.
213-
if (confirmed_ > height)
214-
confirmed_ = height;
212+
// Confirmations are ordered and notification order is guaranteed.
213+
confirmed_ = height;
215214

216215
// The full set of requested hashes has been confirmed.
217216
if (confirmed_ == requested_)
218-
do_headers(height_t{});
217+
do_headers(height);
219218
}
220219

221220
void chaser_check::do_checked(height_t height) NOEXCEPT
@@ -234,14 +233,17 @@ void chaser_check::do_bump(height_t) NOEXCEPT
234233
return;
235234

236235
const auto& query = archive();
236+
auto height = position();
237237

238238
// TODO: query.is_associated() is expensive (hashmap search).
239239
// Skip checked blocks starting immediately after last checked.
240-
while (!closed() && query.is_associated(
241-
query.to_candidate(add1(position()))))
242-
set_position(add1(position()));
240+
while (!closed() &&
241+
query.is_associated(query.to_candidate((height = add1(height)))))
242+
{
243+
set_position(height);
244+
}
243245

244-
do_headers(height_t{});
246+
do_headers(sub1(height));
245247
}
246248

247249
// add headers

src/parser.cpp

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

85-
// Full size too big for mini, so reduced to compressed size.
86-
configured.database.point_buckets = 546'188'501;
87-
configured.database.point_size = 8'389'074'978;
88-
configured.database.point_rate = 5;
89-
9085
configured.database.puts_size = 6'300'000'000;
9186
configured.database.puts_rate = 5;
9287

@@ -694,23 +689,6 @@ options_metadata parser::load_settings() THROWS
694689
"The percentage expansion of the output table body, defaults to '5'."
695690
)
696691

697-
/* point */
698-
(
699-
"database.point_buckets",
700-
value<uint32_t>(&configured.database.point_buckets),
701-
"The number of buckets in the point table head, defaults to '546188501'."
702-
)
703-
(
704-
"database.point_size",
705-
value<uint64_t>(&configured.database.point_size),
706-
"The minimum allocation of the point table body, defaults to '8389074978'."
707-
)
708-
(
709-
"database.point_rate",
710-
value<uint16_t>(&configured.database.point_rate),
711-
"The percentage expansion of the point table body, defaults to '5'."
712-
)
713-
714692
/* puts */
715693
(
716694
"database.puts_size",

0 commit comments

Comments
 (0)