Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add launch flag --disable_block_processor_unchecked_deletion #2557

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
7 changes: 2 additions & 5 deletions nano/node/blockprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,7 @@ nano::process_return nano::block_processor::process_one (nano::write_transaction
{
node.logger.try_log (boost::str (boost::format ("Old for: %1%") % hash.to_string ()));
}
if (!node.flags.fast_bootstrap)
{
queue_unchecked (transaction_a, hash);
}
queue_unchecked (transaction_a, hash);
node.active.update_difficulty (info_a.block, transaction_a);
node.stats.inc (nano::stat::type::ledger, nano::stat::detail::old);
break;
Expand Down Expand Up @@ -555,7 +552,7 @@ void nano::block_processor::queue_unchecked (nano::write_transaction const & tra
auto unchecked_blocks (node.store.unchecked_get (transaction_a, hash_a));
for (auto & info : unchecked_blocks)
{
if (!node.flags.fast_bootstrap)
if (!node.flags.disable_block_processor_unchecked_deletion)
{
if (!node.store.unchecked_del (transaction_a, nano::unchecked_key (hash_a, info.block->hash ())))
{
Expand Down
3 changes: 3 additions & 0 deletions nano/node/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ void nano::add_node_flag_options (boost::program_options::options_description &
("disable_unchecked_cleanup", "Disables periodic cleanup of old records from unchecked table")
("disable_unchecked_drop", "Disables drop of unchecked table at startup")
("disable_providing_telemetry_metrics", "Disable using any node information in the telemetry_ack messages.")
("disable_block_processor_unchecked_deletion", "Disable deletion of unchecked blocks after processing")
("fast_bootstrap", "Increase bootstrap speed for high end nodes with higher limits")
("batch_size", boost::program_options::value<std::size_t>(), "Increase sideband batch size, default 512")
("block_processor_batch_size", boost::program_options::value<std::size_t>(), "Increase block processor transaction batch write size, default 0 (limited by config block_processor_batch_max_time), 256k for fast_bootstrap")
Expand Down Expand Up @@ -122,9 +123,11 @@ std::error_code nano::update_flags (nano::node_flags & flags_a, boost::program_o
}
flags_a.disable_unchecked_cleanup = (vm.count ("disable_unchecked_cleanup") > 0);
flags_a.disable_unchecked_drop = (vm.count ("disable_unchecked_drop") > 0);
flags_a.disable_block_processor_unchecked_deletion = (vm.count ("disable_block_processor_unchecked_deletion") > 0);
flags_a.fast_bootstrap = (vm.count ("fast_bootstrap") > 0);
if (flags_a.fast_bootstrap)
{
flags_a.disable_block_processor_unchecked_deletion = true;
flags_a.block_processor_batch_size = 256 * 1024;
flags_a.block_processor_full_size = 1024 * 1024;
flags_a.block_processor_verification_size = std::numeric_limits<size_t>::max ();
Expand Down
1 change: 1 addition & 0 deletions nano/node/nodeconfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class node_flags final
bool disable_unchecked_cleanup{ false };
bool disable_unchecked_drop{ true };
bool disable_providing_telemetry_metrics{ false };
bool disable_block_processor_unchecked_deletion{ false };
bool fast_bootstrap{ false };
bool read_only{ false };
nano::generate_cache generate_cache;
Expand Down