Skip to content

Commit 8ac3008

Browse files
authored
Merge pull request #752 from evoskuil/master
Adapt to store changes.
2 parents 31b1ae9 + 003560b commit 8ac3008

File tree

5 files changed

+129
-82
lines changed

5 files changed

+129
-82
lines changed

console/executor_dumps.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,14 @@ void executor::dump_body_sizes() const
9999
query_.outs_body_size() %
100100
query_.candidate_body_size() %
101101
query_.confirmed_body_size() %
102+
query_.duplicate_body_size() %
102103
query_.prevout_body_size() %
103104
query_.strong_tx_body_size() %
104-
query_.validated_tx_body_size() %
105105
query_.validated_bk_body_size() %
106-
query_.address_body_size() %
107-
query_.neutrino_body_size());
106+
query_.validated_tx_body_size() %
107+
query_.filter_bk_body_size() %
108+
query_.filter_tx_body_size() %
109+
query_.address_body_size());
108110
}
109111

110112
void executor::dump_records() const
@@ -117,8 +119,9 @@ void executor::dump_records() const
117119
query_.outs_records() %
118120
query_.candidate_records() %
119121
query_.confirmed_records() %
120-
query_.prevout_records() %
122+
query_.duplicate_records() %
121123
query_.strong_tx_records() %
124+
query_.filter_bk_records() %
122125
query_.address_records());
123126
}
124127

@@ -129,12 +132,14 @@ void executor::dump_buckets() const
129132
query_.txs_buckets() %
130133
query_.tx_buckets() %
131134
query_.point_buckets() %
135+
query_.duplicate_buckets() %
132136
query_.prevout_buckets() %
133137
query_.strong_tx_buckets() %
134-
query_.validated_tx_buckets() %
135138
query_.validated_bk_buckets() %
136-
query_.address_buckets() %
137-
query_.neutrino_buckets());
139+
query_.validated_tx_buckets() %
140+
query_.filter_bk_buckets() %
141+
query_.filter_tx_buckets() %
142+
query_.address_buckets());
138143
}
139144

140145
// txs, validated_tx, validated_bk collision rates assume 1:1 records.
@@ -145,26 +150,21 @@ void executor::dump_collisions() const
145150
(to_double(query_.header_records()) / query_.txs_buckets()) %
146151
(to_double(query_.tx_records()) / query_.tx_buckets()) %
147152
(to_double(query_.point_records()) / query_.point_buckets()) %
148-
(to_double(query_.prevout_records()) / query_.prevout_buckets()) %
149153
(to_double(query_.strong_tx_records()) / query_.strong_tx_buckets()) %
150-
(to_double(query_.tx_records()) / query_.validated_tx_buckets()) %
151154
(to_double(query_.header_records()) / query_.validated_bk_buckets()) %
152-
(query_.address_enabled() ? (to_double(query_.address_records()) /
153-
query_.address_buckets()) : 0) %
154-
(query_.neutrino_enabled() ? (to_double(query_.header_records()) /
155-
query_.neutrino_buckets()) : 0));
155+
(to_double(query_.tx_records()) / query_.validated_tx_buckets()) %
156+
(query_.address_enabled() ?
157+
(to_double(query_.address_records()) / query_.address_buckets()) : zero));
156158
}
157159

158160
void executor::dump_progress() const
159161
{
160162
logger(format(BN_MEASURE_PROGRESS) %
161163
query_.get_fork() %
162164
query_.get_top_confirmed() %
163-
encode_hash(query_.get_header_key(query_.to_confirmed(
164-
query_.get_top_confirmed()))) %
165+
encode_hash(query_.get_header_key(query_.to_confirmed(query_.get_top_confirmed()))) %
165166
query_.get_top_candidate() %
166-
encode_hash(query_.get_header_key(query_.to_candidate(
167-
query_.get_top_candidate()))) %
167+
encode_hash(query_.get_header_key(query_.to_candidate(query_.get_top_candidate()))) %
168168
query_.get_top_associated() %
169169
(query_.get_top_candidate() - query_.get_unassociated_count()) %
170170
query_.get_confirmed_size() %

console/localize.hpp

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -77,27 +77,30 @@ namespace node {
7777
" input :%5%\n" \
7878
" output :%6%\n" \
7979
" ins :%7%\n" \
80-
" puts :%8%\n" \
80+
" outs :%8%\n" \
8181
" candidate :%9%\n" \
8282
" confirmed :%10%\n" \
83-
" prevout :%11%\n" \
84-
" strong_tx :%12%\n" \
85-
" valid_tx :%13%\n" \
83+
" duplicate :%11%\n" \
84+
" prevout :%12%\n" \
85+
" strong_tx :%13%\n" \
8686
" valid_bk :%14%\n" \
87-
" address :%15%\n" \
88-
" neutrino :%16%"
87+
" valid_tx :%15%\n" \
88+
" filter_bk :%16%\n" \
89+
" filter_tx :%17%\n" \
90+
" address :%18%"
8991
#define BN_MEASURE_RECORDS \
9092
"Table records...\n" \
9193
" header :%1%\n" \
9294
" tx :%2%\n" \
9395
" point :%3%\n" \
9496
" ins :%4%\n" \
95-
" puts :%5%\n" \
97+
" outs :%5%\n" \
9698
" candidate :%6%\n" \
9799
" confirmed :%7%\n" \
98-
" prevout :%8%\n" \
100+
" duplicate :%8%\n" \
99101
" strong_tx :%9%\n" \
100-
" address :%10%"
102+
" filter_bk :%10%\n" \
103+
" address :%11%"
101104
#define BN_MEASURE_SLABS \
102105
"Table slabs..."
103106
#define BN_MEASURE_SLABS_ROW \
@@ -112,24 +115,24 @@ namespace node {
112115
" txs :%2%\n" \
113116
" tx :%3%\n" \
114117
" point :%4%\n" \
115-
" prevout :%5%\n" \
116-
" strong_tx :%6%\n" \
117-
" valid_tx :%7%\n" \
118+
" duplicate :%5%\n" \
119+
" prevout :%6%\n" \
120+
" strong_tx :%7%\n" \
118121
" valid_bk :%8%\n" \
119-
" address :%9%\n" \
120-
" neutrino :%10%"
122+
" valid_tx :%9%\n" \
123+
" filter_bk :%10%\n" \
124+
" filter_tx :%11%\n" \
125+
" address :%12%"
121126
#define BN_MEASURE_COLLISION_RATES \
122127
"Collision rates...\n" \
123128
" header :%1%\n" \
124129
" txs :%2%\n" \
125130
" tx :%3%\n" \
126131
" point :%4%\n" \
127-
" prevout :%5%\n" \
128-
" strong_tx :%6%\n" \
132+
" strong_tx :%5%\n" \
133+
" valid_bk :%6%\n" \
129134
" valid_tx :%7%\n" \
130-
" valid_bk :%8%\n" \
131-
" address :%9%\n" \
132-
" neutrino :%10%"
135+
" address :%8%"
133136
#define BN_MEASURE_PROGRESS_START \
134137
"Thinking..."
135138
#define BN_MEASURE_PROGRESS \

src/chasers/chaser_confirm.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,11 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT
258258
return;
259259
}
260260

261-
if (!query.set_filter_head(link))
262-
{
263-
fault(error::confirm9);
264-
return;
265-
}
261+
////if (!query.set_filter_head(link))
262+
////{
263+
//// fault(error::confirm9);
264+
//// return;
265+
////}
266266

267267
if (!set_organized(link, height))
268268
{

src/chasers/chaser_validate.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ chaser_validate::chaser_validate(full_node& node) NOEXCEPT
4646
subsidy_interval_(node.config().bitcoin.subsidy_interval_blocks),
4747
initial_subsidy_(node.config().bitcoin.initial_subsidy()),
4848
maximum_backlog_(node.config().node.maximum_concurrency_()),
49-
filter_(node.archive().neutrino_enabled())
49+
filter_(node.archive().filter_enabled())
5050
{
5151
}
5252

@@ -227,10 +227,10 @@ void chaser_validate::validate_block(const header_link& link,
227227
if (!query.set_block_unconfirmable(link))
228228
ec = error::validate4;
229229
}
230-
else if (!query.set_filter_body(link, *block))
231-
{
232-
ec = error::validate5;
233-
}
230+
////else if (!query.set_filter_body(link, *block))
231+
////{
232+
//// ec = error::validate5;
233+
////}
234234

235235
backlog_.fetch_sub(one, std::memory_order_relaxed);
236236

src/parser.cpp

Lines changed: 80 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -114,27 +114,37 @@ parser::parser(system::chain::selection context) NOEXCEPT
114114

115115
// database (caches)
116116

117+
configured.database.duplicate_buckets = 10;
118+
configured.database.duplicate_size = 44;
119+
configured.database.duplicate_rate = 5;
120+
117121
configured.database.prevout_buckets = 850'001;
118122
configured.database.prevout_size = 5'250'000'000;
119123
configured.database.prevout_rate = 5;
120124

121-
configured.database.validated_tx_buckets = 1;
122-
configured.database.validated_tx_size = 1;
123-
configured.database.validated_tx_rate = 5;
124-
125125
configured.database.validated_bk_buckets = 740'001;
126126
configured.database.validated_bk_size = 3'400'000;
127127
configured.database.validated_bk_rate = 5;
128128

129+
configured.database.validated_tx_buckets = 1;
130+
configured.database.validated_tx_size = 1;
131+
configured.database.validated_tx_rate = 5;
132+
129133
// database (optionals)
130134

131135
configured.database.address_buckets = 1;
132136
configured.database.address_size = 1;
133137
configured.database.address_rate = 5;
134138

135-
configured.database.neutrino_buckets = 1;
136-
configured.database.neutrino_size = 1;
137-
configured.database.neutrino_rate = 5;
139+
// also disabled by filter_tx
140+
configured.database.filter_bk_buckets = 0;
141+
configured.database.filter_bk_size = 1;
142+
configured.database.filter_bk_rate = 5;
143+
144+
// also disabled by filter_bk
145+
configured.database.filter_tx_buckets = 0;
146+
configured.database.filter_tx_size = 1;
147+
configured.database.filter_tx_rate = 5;
138148
}
139149

140150
options_metadata parser::load_options() THROWS
@@ -808,6 +818,23 @@ options_metadata parser::load_settings() THROWS
808818
"The percentage expansion of the strong_tx table body, defaults to '5'."
809819
)
810820

821+
/* duplicate */
822+
(
823+
"database.duplicate_buckets",
824+
value<uint16_t>(&configured.database.duplicate_buckets),
825+
"The minimum number of buckets in the duplicate table head, defaults to '10'."
826+
)
827+
(
828+
"database.duplicate_size",
829+
value<uint64_t>(&configured.database.duplicate_size),
830+
"The minimum allocation of the duplicate table body, defaults to '44'."
831+
)
832+
(
833+
"database.duplicate_rate",
834+
value<uint16_t>(&configured.database.duplicate_rate),
835+
"The percentage expansion of the duplicate table, defaults to '5'."
836+
)
837+
811838
/* prevout */
812839
(
813840
"database.prevout_buckets",
@@ -822,24 +849,7 @@ options_metadata parser::load_settings() THROWS
822849
(
823850
"database.prevout_rate",
824851
value<uint16_t>(&configured.database.prevout_rate),
825-
"The percentage expansion of the prevout table and body, defaults to '5'."
826-
)
827-
828-
/* validated_tx */
829-
(
830-
"database.validated_tx_buckets",
831-
value<uint32_t>(&configured.database.validated_tx_buckets),
832-
"The number of buckets in the validated_tx table head, defaults to '1' (0|1 disables)."
833-
)
834-
(
835-
"database.validated_tx_size",
836-
value<uint64_t>(&configured.database.validated_tx_size),
837-
"The minimum allocation of the validated_tx table body, defaults to '1'."
838-
)
839-
(
840-
"database.validated_tx_rate",
841-
value<uint16_t>(&configured.database.validated_tx_rate),
842-
"The percentage expansion of the validated_tx table body, defaults to '5'."
852+
"The percentage expansion of the prevout table, defaults to '5'."
843853
)
844854

845855
/* validated_bk */
@@ -859,6 +869,23 @@ options_metadata parser::load_settings() THROWS
859869
"The percentage expansion of the validated_bk table body, defaults to '5'."
860870
)
861871

872+
/* validated_tx */
873+
(
874+
"database.validated_tx_buckets",
875+
value<uint32_t>(&configured.database.validated_tx_buckets),
876+
"The number of buckets in the validated_tx table head, defaults to '1'."
877+
)
878+
(
879+
"database.validated_tx_size",
880+
value<uint64_t>(&configured.database.validated_tx_size),
881+
"The minimum allocation of the validated_tx table body, defaults to '1'."
882+
)
883+
(
884+
"database.validated_tx_rate",
885+
value<uint16_t>(&configured.database.validated_tx_rate),
886+
"The percentage expansion of the validated_tx table body, defaults to '5'."
887+
)
888+
862889
/* address */
863890
(
864891
"database.address_buckets",
@@ -873,24 +900,41 @@ options_metadata parser::load_settings() THROWS
873900
(
874901
"database.address_rate",
875902
value<uint16_t>(&configured.database.address_rate),
876-
"The percentage expansion of the address table body, defaults to '0'."
903+
"The percentage expansion of the address table body, defaults to '5'."
904+
)
905+
906+
/* filter_bk */
907+
(
908+
"database.filter_bk_buckets",
909+
value<uint32_t>(&configured.database.filter_bk_buckets),
910+
"The log2 number of buckets in the filter_bk table head, defaults to '0' (0 disables)."
911+
)
912+
(
913+
"database.filter_bk_size",
914+
value<uint64_t>(&configured.database.filter_bk_size),
915+
"The minimum allocation of the filter_bk table body, defaults to '1'."
916+
)
917+
(
918+
"database.filter_bk_rate",
919+
value<uint16_t>(&configured.database.filter_bk_rate),
920+
"The percentage expansion of the filter_bk table body, defaults to '5'."
877921
)
878922

879-
/* neutrino */
923+
/* filter_tx */
880924
(
881-
"database.neutrino_buckets",
882-
value<uint32_t>(&configured.database.neutrino_buckets),
883-
"The log2 number of buckets in the neutrino table head, defaults to '1' (0|1 disables)."
925+
"database.filter_tx_buckets",
926+
value<uint32_t>(&configured.database.filter_tx_buckets),
927+
"The log2 number of buckets in the filter_tx table head, defaults to '0' (0 disables)."
884928
)
885929
(
886-
"database.neutrino_size",
887-
value<uint64_t>(&configured.database.neutrino_size),
888-
"The minimum allocation of the neutrino table body, defaults to '1'."
930+
"database.filter_tx_size",
931+
value<uint64_t>(&configured.database.filter_tx_size),
932+
"The minimum allocation of the filter_tx table body, defaults to '1'."
889933
)
890934
(
891-
"database.neutrino_rate",
892-
value<uint16_t>(&configured.database.neutrino_rate),
893-
"The percentage expansion of the neutrino table body, defaults to '0'."
935+
"database.filter_tx_rate",
936+
value<uint16_t>(&configured.database.filter_tx_rate),
937+
"The percentage expansion of the filter_tx table body, defaults to '5'."
894938
)
895939

896940
/* [node] */

0 commit comments

Comments
 (0)