Delay inactive/gap cache bootstrap start for 30 seconds (#2631)
instead of 5 seconds. To allow more frequent new blocks arrival with realtime network & kess usage for expensive bootstrap
This commit is contained in:
parent
7348d1e717
commit
7dcb20b076
4 changed files with 6 additions and 6 deletions
|
@ -975,11 +975,10 @@ bool nano::active_transactions::inactive_votes_bootstrap_check (std::vector<nano
|
|||
{
|
||||
start_bootstrap = true;
|
||||
}
|
||||
if (start_bootstrap)
|
||||
if (start_bootstrap && !node.ledger.block_exists (hash_a))
|
||||
{
|
||||
auto node_l (node.shared ());
|
||||
auto now (std::chrono::steady_clock::now ());
|
||||
node.alarm.add (node_l->network_params.network.is_test_network () ? now + std::chrono::milliseconds (5) : now + std::chrono::seconds (5), [node_l, hash_a]() {
|
||||
node.alarm.add (std::chrono::steady_clock::now () + node.network_params.bootstrap.gap_cache_bootstrap_start_interval, [node_l, hash_a]() {
|
||||
auto transaction (node_l->store.tx_begin_read ());
|
||||
if (!node_l->store.block_exists (transaction, hash_a))
|
||||
{
|
||||
|
|
|
@ -86,11 +86,10 @@ bool nano::gap_cache::bootstrap_check (std::vector<nano::account> const & voters
|
|||
{
|
||||
start_bootstrap = true;
|
||||
}
|
||||
if (start_bootstrap)
|
||||
if (start_bootstrap && !node.ledger.block_exists (hash_a))
|
||||
{
|
||||
auto node_l (node.shared ());
|
||||
auto now (std::chrono::steady_clock::now ());
|
||||
node.alarm.add (node_l->network_params.network.is_test_network () ? now + std::chrono::milliseconds (5) : now + std::chrono::seconds (5), [node_l, hash_a]() {
|
||||
node.alarm.add (std::chrono::steady_clock::now () + node.network_params.bootstrap.gap_cache_bootstrap_start_interval, [node_l, hash_a]() {
|
||||
auto transaction (node_l->store.tx_begin_read ());
|
||||
if (!node_l->store.block_exists (transaction, hash_a))
|
||||
{
|
||||
|
|
|
@ -158,6 +158,7 @@ nano::bootstrap_constants::bootstrap_constants (nano::network_constants & networ
|
|||
frontier_retry_limit = network_constants.is_test_network () ? 2 : 16;
|
||||
lazy_retry_limit = network_constants.is_test_network () ? 2 : frontier_retry_limit * 10;
|
||||
lazy_destinations_retry_limit = network_constants.is_test_network () ? 1 : frontier_retry_limit / 4;
|
||||
gap_cache_bootstrap_start_interval = network_constants.is_test_network () ? std::chrono::milliseconds (5) : std::chrono::milliseconds (30 * 1000);
|
||||
}
|
||||
|
||||
/* Convenience constants for core_test which is always on the test network */
|
||||
|
|
|
@ -455,6 +455,7 @@ public:
|
|||
unsigned frontier_retry_limit;
|
||||
unsigned lazy_retry_limit;
|
||||
unsigned lazy_destinations_retry_limit;
|
||||
std::chrono::milliseconds gap_cache_bootstrap_start_interval;
|
||||
};
|
||||
|
||||
/** Constants whose value depends on the active network */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue