Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/bitcoin/node/chasers/chaser_validate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,11 @@ class BCN_API chaser_validate
network::asio::strand validation_strand_;
const uint32_t subsidy_interval_;
const uint64_t initial_subsidy_;
const size_t silent_start_height_;
const size_t maximum_backlog_;
const size_t maximum_height_;
const uint64_t batch_target_;
const bool allow_batch_race_;
////const bool allow_batch_race_;
const bool batch_enabled_;
const bool node_witness_;
const bool filter_;
Expand Down
1 change: 1 addition & 0 deletions include/bitcoin/node/error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ enum error_t : uint8_t
validate6,
validate7,
validate8,
validate9,
confirm1,
confirm2,
confirm3,
Expand Down
5 changes: 3 additions & 2 deletions include/bitcoin/node/events.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ enum events : uint8_t
filter_msecs, // getfilter timespan in milliseconds.
filterhashes_msecs, // getfilterhashes timespan in milliseconds.
filterchecks_msecs, // getcfcheckpt timespan in milliseconds.
ecdsa_secs, // process_batch ecdsa timespan in seconds.
schnorr_secs, // process_batch schnorr timespan in seconds.
ecdsa_secs, // ecdsa batch verify timespan in seconds.
schnorr_secs, // schnorr batch verify timespan in seconds.
silent_secs, // silent payment scan timespan in seconds.

unknown
};
Expand Down
1 change: 1 addition & 0 deletions include/bitcoin/node/settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class BCN_API settings
uint16_t fee_estimate_horizon;
uint32_t maximum_height;
uint32_t maximum_concurrency;
uint32_t silent_start_height;
uint16_t sample_period_seconds;
uint32_t currency_window_minutes;
uint16_t warn_dirty_background_ratio;
Expand Down
3 changes: 2 additions & 1 deletion src/chasers/chaser_validate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ chaser_validate::chaser_validate(full_node& node) NOEXCEPT
validation_strand_(validation_threadpool_.service().get_executor()),
subsidy_interval_(node.system_settings().subsidy_interval_blocks),
initial_subsidy_(node.system_settings().initial_subsidy()),
silent_start_height_(node.node_settings().silent_start_height),
maximum_backlog_(node.node_settings().maximum_concurrency_()),
maximum_height_(node.node_settings().maximum_height_()),
batch_target_(node.node_settings().batch_signatures),
allow_batch_race_(node.node_settings().allow_batch_race),
////allow_batch_race_(node.node_settings().allow_batch_race),
batch_enabled_(node.node_settings().batch_signatures_enabled()),
node_witness_(node.network_settings().witness_node()),
filter_(node.archive().filter_enabled())
Expand Down
4 changes: 2 additions & 2 deletions src/chasers/chaser_validate_batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ void chaser_validate::push_batch(const header_link& link, size_t height) NOEXCEP
--batch_backlog_;

// Unblocks check chaser for download while verifying.
if (allow_batch_race_)
notify({}, chase::prevalid, possible_wide_cast<height_t>(height));
////if (allow_batch_race_)
notify({}, chase::prevalid, possible_wide_cast<height_t>(height));

// Process both tables when one hits target, allowing batched_ clearance
// and therefore forward confirmation progress. Drain batch if no backlogs
Expand Down
9 changes: 7 additions & 2 deletions src/chasers/chaser_validate_parallel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,15 @@ code chaser_validate::validate(bool& batched, bool& faulted, bool& capturing,
if (!faulted && !query.set_filter_body(link, block))
return error::validate7;

// Block will be retried if batch is faulted.
if (!faulted && (ctx.height >= silent_start_height_) &&
!query.set_silent(link, block))
return error::validate8;

// Defer block state change when batched (or faulted).
// Valid must be set after set_prevouts and set_filter_body.
// Valid must be set after set_prevouts, set_filter_body, and set_silent.
if (!batched && !bypass && !query.set_block_valid(link))
return error::validate8;
return error::validate9;

return error::success;
}
Expand Down
1 change: 1 addition & 0 deletions src/error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ DEFINE_ERROR_T_MESSAGE_MAP(error)
{ validate6, "validate6" },
{ validate7, "validate7" },
{ validate8, "validate8" },
{ validate9, "validate9" },
{ confirm1, "confirm1" },
{ confirm2, "confirm2" },
{ confirm3, "confirm3" },
Expand Down
1 change: 1 addition & 0 deletions src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ settings::settings() NOEXCEPT
////snapshot_valid{ 250'000 },
////snapshot_confirm{ 500'000 },
maximum_height{ 0 },
silent_start_height{ 0xffffffff_u32 },
maximum_concurrency{ 50'000 },
sample_period_seconds{ 10 },
currency_window_minutes{ 1440 },
Expand Down
1 change: 1 addition & 0 deletions test/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ BOOST_AUTO_TEST_CASE(settings__node__default_context__expected)
BOOST_REQUIRE_EQUAL(node.fee_estimate_horizon, 0u);
BOOST_REQUIRE_EQUAL(node.maximum_height, 0_u32);
BOOST_REQUIRE_EQUAL(node.maximum_height_(), max_size_t);
BOOST_REQUIRE_EQUAL(node.silent_start_height, 0xffffffff_u32);
BOOST_REQUIRE_EQUAL(node.maximum_concurrency, 50000_u32);
BOOST_REQUIRE_EQUAL(node.maximum_concurrency_(), 50000_size);
BOOST_REQUIRE_EQUAL(node.sample_period_seconds, 10_u16);
Expand Down
Loading