Use wallet workers
This commit is contained in:
parent
b6ee1692c5
commit
76e062e171
4 changed files with 11 additions and 1 deletions
|
|
@ -70,6 +70,9 @@ std::string nano::thread_role::get_string (nano::thread_role::name role)
|
||||||
case nano::thread_role::name::bootstrap_worker:
|
case nano::thread_role::name::bootstrap_worker:
|
||||||
thread_role_name_string = "Bootstrap work";
|
thread_role_name_string = "Bootstrap work";
|
||||||
break;
|
break;
|
||||||
|
case nano::thread_role::name::wallet_worker:
|
||||||
|
thread_role_name_string = "Wallet work";
|
||||||
|
break;
|
||||||
case nano::thread_role::name::request_aggregator:
|
case nano::thread_role::name::request_aggregator:
|
||||||
thread_role_name_string = "Req aggregator";
|
thread_role_name_string = "Req aggregator";
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ enum class name
|
||||||
confirmation_height_notifications,
|
confirmation_height_notifications,
|
||||||
worker,
|
worker,
|
||||||
bootstrap_worker,
|
bootstrap_worker,
|
||||||
|
wallet_worker,
|
||||||
request_aggregator,
|
request_aggregator,
|
||||||
state_block_signature_verification,
|
state_block_signature_verification,
|
||||||
epoch_upgrader,
|
epoch_upgrader,
|
||||||
|
|
|
||||||
|
|
@ -152,6 +152,7 @@ nano::node::node (std::shared_ptr<boost::asio::io_context> io_ctx_a, std::filesy
|
||||||
stats{ logger, config.stats_config },
|
stats{ logger, config.stats_config },
|
||||||
workers{ config.background_threads, nano::thread_role::name::worker },
|
workers{ config.background_threads, nano::thread_role::name::worker },
|
||||||
bootstrap_workers{ config.bootstrap_serving_threads, nano::thread_role::name::bootstrap_worker },
|
bootstrap_workers{ config.bootstrap_serving_threads, nano::thread_role::name::bootstrap_worker },
|
||||||
|
wallet_workers{ 1, nano::thread_role::name::wallet_worker },
|
||||||
flags (flags_a),
|
flags (flags_a),
|
||||||
work (work_a),
|
work (work_a),
|
||||||
distributed_work (*this),
|
distributed_work (*this),
|
||||||
|
|
@ -479,7 +480,7 @@ nano::node::node (std::shared_ptr<boost::asio::io_context> io_ctx_a, std::filesy
|
||||||
// TODO: Is it neccessary to call this for all blocks?
|
// TODO: Is it neccessary to call this for all blocks?
|
||||||
if (block->is_send ())
|
if (block->is_send ())
|
||||||
{
|
{
|
||||||
workers.push_task ([this, hash = block->hash (), destination = block->destination ()] () {
|
wallet_workers.push_task ([this, hash = block->hash (), destination = block->destination ()] () {
|
||||||
wallets.receive_confirmed (hash, destination);
|
wallets.receive_confirmed (hash, destination);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -572,6 +573,8 @@ std::unique_ptr<nano::container_info_component> nano::collect_container_info (no
|
||||||
composite->add_component (collect_container_info (node.network, "network"));
|
composite->add_component (collect_container_info (node.network, "network"));
|
||||||
composite->add_component (node.telemetry.collect_container_info ("telemetry"));
|
composite->add_component (node.telemetry.collect_container_info ("telemetry"));
|
||||||
composite->add_component (collect_container_info (node.workers, "workers"));
|
composite->add_component (collect_container_info (node.workers, "workers"));
|
||||||
|
composite->add_component (collect_container_info (node.bootstrap_workers, "bootstrap_workers"));
|
||||||
|
composite->add_component (collect_container_info (node.wallet_workers, "wallet_workers"));
|
||||||
composite->add_component (collect_container_info (node.observers, "observers"));
|
composite->add_component (collect_container_info (node.observers, "observers"));
|
||||||
composite->add_component (collect_container_info (node.wallets, "wallets"));
|
composite->add_component (collect_container_info (node.wallets, "wallets"));
|
||||||
composite->add_component (node.vote_processor.collect_container_info ("vote_processor"));
|
composite->add_component (node.vote_processor.collect_container_info ("vote_processor"));
|
||||||
|
|
@ -728,6 +731,8 @@ void nano::node::stop ()
|
||||||
|
|
||||||
logger.info (nano::log::type::node, "Node stopping...");
|
logger.info (nano::log::type::node, "Node stopping...");
|
||||||
|
|
||||||
|
bootstrap_workers.stop ();
|
||||||
|
wallet_workers.stop ();
|
||||||
vote_router.stop ();
|
vote_router.stop ();
|
||||||
peer_history.stop ();
|
peer_history.stop ();
|
||||||
// Cancels ongoing work generation tasks, which may be blocking other threads
|
// Cancels ongoing work generation tasks, which may be blocking other threads
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,7 @@ public:
|
||||||
nano::stats stats;
|
nano::stats stats;
|
||||||
nano::thread_pool workers;
|
nano::thread_pool workers;
|
||||||
nano::thread_pool bootstrap_workers;
|
nano::thread_pool bootstrap_workers;
|
||||||
|
nano::thread_pool wallet_workers;
|
||||||
nano::node_flags flags;
|
nano::node_flags flags;
|
||||||
nano::work_pool & work;
|
nano::work_pool & work;
|
||||||
nano::distributed_work_factory distributed_work;
|
nano::distributed_work_factory distributed_work;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue