From c314893f3fc9bf81b78ff2cc6fc4c9427f185974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Sat, 6 Jul 2024 20:40:06 +0200 Subject: [PATCH] Revert "Avoid bootstrap notifications from live traffic (#4463)" This reverts commit ebbc881ebbd9a1599afee35aeaf8893486c32563. --- nano/node/bootstrap_ascending/service.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/nano/node/bootstrap_ascending/service.cpp b/nano/node/bootstrap_ascending/service.cpp index 7d295b3215..8bceda97d3 100644 --- a/nano/node/bootstrap_ascending/service.cpp +++ b/nano/node/bootstrap_ascending/service.cpp @@ -31,27 +31,20 @@ nano::bootstrap_ascending::service::service (nano::node_config & config_a, nano: scoring{ config.bootstrap_ascending, config.network_params.network }, database_limiter{ config.bootstrap_ascending.database_requests_limit, 1.0 } { + // TODO: This is called from a very congested blockprocessor thread. Offload this work to a dedicated processing thread block_processor.batch_processed.add ([this] (auto const & batch) { - bool should_notify = false; { nano::lock_guard lock{ mutex }; auto transaction = ledger.tx_begin_read (); for (auto const & [result, context] : batch) { - // Do not try to unnecessarily bootstrap live traffic chains - if (context.source == nano::block_source::bootstrap) - { - release_assert (context.block != nullptr); - inspect (transaction, result, *context.block); - should_notify = true; - } + debug_assert (context.block != nullptr); + inspect (transaction, result, *context.block); } } - if (should_notify) - { - condition.notify_all (); - } + + condition.notify_all (); }); }