diff --git a/nano/core_test/CMakeLists.txt b/nano/core_test/CMakeLists.txt index 430ceee78..b53c4a4de 100644 --- a/nano/core_test/CMakeLists.txt +++ b/nano/core_test/CMakeLists.txt @@ -3,7 +3,7 @@ add_executable( entry.cpp fakes/websocket_client.hpp fakes/work_peer.hpp - active_transactions.cpp + active_elections.cpp async.cpp backlog.cpp block.cpp diff --git a/nano/core_test/active_transactions.cpp b/nano/core_test/active_elections.cpp similarity index 97% rename from nano/core_test/active_transactions.cpp rename to nano/core_test/active_elections.cpp index 931598d49..627e17cf9 100644 --- a/nano/core_test/active_transactions.cpp +++ b/nano/core_test/active_elections.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include @@ -29,7 +29,7 @@ using namespace std::chrono_literals; * - node2 with: * - disabled rep crawler -> this inhibits node2 from learning that node1 is a rep */ -TEST (active_transactions, confirm_election_by_request) +TEST (active_elections, confirm_election_by_request) { nano::test::system system{}; auto & node1 = *system.add_node (); @@ -99,7 +99,7 @@ TEST (active_transactions, confirm_election_by_request) ASSERT_TIMELY (5s, nano::test::confirmed (node2, { send1 })); } -TEST (active_transactions, confirm_frontier) +TEST (active_elections, confirm_frontier) { nano::test::system system; @@ -156,14 +156,14 @@ TEST (active_transactions, confirm_frontier) ASSERT_GT (election2->confirmation_request_count, 0u); } -TEST (active_transactions, keep_local) +TEST (active_elections, keep_local) { nano::test::system system{}; nano::node_config node_config = system.default_config (); node_config.enable_voting = false; // Bound to 2, won't drop wallet created transactions, but good to test dropping remote - node_config.active_transactions.size = 2; + node_config.active_elections.size = 2; // Disable frontier confirmation to allow the test to finish before node_config.frontiers_confirmation = nano::frontiers_confirmation_mode::disabled; @@ -234,7 +234,7 @@ TEST (active_transactions, keep_local) node.process_active (receive3); /// bound elections, should drop after one loop - ASSERT_TIMELY_EQ (5s, node.active.size (), node_config.active_transactions.size); + ASSERT_TIMELY_EQ (5s, node.active.size (), node_config.active_elections.size); // ASSERT_EQ (1, node.scheduler.size ()); } @@ -543,7 +543,7 @@ TEST (inactive_votes_cache, election_start) namespace nano { -TEST (active_transactions, vote_replays) +TEST (active_elections, vote_replays) { nano::test::system system; nano::node_config node_config = system.default_config (); @@ -643,7 +643,7 @@ TEST (active_transactions, vote_replays) } // Tests that blocks are correctly cleared from the duplicate filter for unconfirmed elections -TEST (active_transactions, dropped_cleanup) +TEST (active_elections, dropped_cleanup) { nano::test::system system; nano::node_flags flags; @@ -700,7 +700,7 @@ TEST (active_transactions, dropped_cleanup) ASSERT_FALSE (node.active.active (hash)); } -TEST (active_transactions, republish_winner) +TEST (active_elections, republish_winner) { nano::test::system system; nano::node_config node_config = system.default_config (); @@ -765,7 +765,7 @@ TEST (active_transactions, republish_winner) ASSERT_TIMELY (5s, node2.block_confirmed (fork->hash ())); } -TEST (active_transactions, fork_filter_cleanup) +TEST (active_elections, fork_filter_cleanup) { nano::test::system system{}; @@ -847,7 +847,7 @@ TEST (active_transactions, fork_filter_cleanup) * (9 votes from this batch should survive and replace existing blocks in the election, why not 10?) * Then send winning block and it should replace one of the existing blocks */ -TEST (active_transactions, fork_replacement_tally) +TEST (active_elections, fork_replacement_tally) { nano::test::system system; nano::node_config node_config = system.default_config (); @@ -1004,7 +1004,7 @@ TEST (active_transactions, fork_replacement_tally) namespace nano { // Blocks that won an election must always be seen as confirming or cemented -TEST (active_transactions, confirmation_consistency) +TEST (active_elections, confirmation_consistency) { nano::test::system system; nano::node_config node_config = system.default_config (); @@ -1031,7 +1031,7 @@ TEST (active_transactions, confirmation_consistency) } } -TEST (active_transactions, confirm_new) +TEST (active_elections, confirm_new) { nano::test::system system (1); auto & node1 = *system.nodes[0]; @@ -1056,7 +1056,7 @@ TEST (active_transactions, confirm_new) } // Ensures votes are tallied on election::publish even if no vote is inserted through inactive_votes_cache -TEST (active_transactions, conflicting_block_vote_existing_election) +TEST (active_elections, conflicting_block_vote_existing_election) { nano::test::system system; nano::node_flags node_flags; @@ -1099,7 +1099,7 @@ TEST (active_transactions, conflicting_block_vote_existing_election) ASSERT_TIMELY (3s, election->confirmed ()); } -TEST (active_transactions, activate_account_chain) +TEST (active_elections, activate_account_chain) { nano::test::system system; nano::node_flags flags; @@ -1199,7 +1199,7 @@ TEST (active_transactions, activate_account_chain) ASSERT_TIMELY (3s, node.active.active (receive->qualified_root ())); } -TEST (active_transactions, activate_inactive) +TEST (active_elections, activate_inactive) { nano::test::system system; nano::node_flags flags; @@ -1257,7 +1257,7 @@ TEST (active_transactions, activate_inactive) ASSERT_FALSE (node.active.active (open->qualified_root ()) || node.block_confirmed_or_being_confirmed (open->hash ())); } -TEST (active_transactions, list_active) +TEST (active_elections, list_active) { nano::test::system system (1); auto & node = *system.nodes[0]; @@ -1312,13 +1312,13 @@ TEST (active_transactions, list_active) auto active = node.active.list_active (); } -TEST (active_transactions, vacancy) +TEST (active_elections, vacancy) { std::atomic updated = false; { nano::test::system system; nano::node_config config = system.default_config (); - config.active_transactions.size = 1; + config.active_elections.size = 1; auto & node = *system.add_node (config); nano::state_block_builder builder; auto send = builder.make_block () @@ -1349,12 +1349,12 @@ TEST (active_transactions, vacancy) } // Ensure transactions in excess of capacity are removed in fifo order -TEST (active_transactions, fifo) +TEST (active_elections, fifo) { nano::test::system system{}; nano::node_config config = system.default_config (); - config.active_transactions.size = 1; + config.active_elections.size = 1; config.frontiers_confirmation = nano::frontiers_confirmation_mode::disabled; auto & node = *system.add_node (config); @@ -1434,15 +1434,15 @@ TEST (active_transactions, fifo) /* * Ensures we limit the number of vote hinted elections in AEC */ -TEST (active_transactions, limit_vote_hinted_elections) +TEST (active_elections, limit_vote_hinted_elections) { nano::test::system system; nano::node_config config = system.default_config (); const int aec_limit = 10; config.frontiers_confirmation = nano::frontiers_confirmation_mode::disabled; config.optimistic_scheduler.enabled = false; - config.active_transactions.size = aec_limit; - config.active_transactions.hinted_limit_percentage = 10; // Should give us a limit of 1 hinted election + config.active_elections.size = aec_limit; + config.active_elections.hinted_limit_percentage = 10; // Should give us a limit of 1 hinted election auto & node = *system.add_node (config); // Setup representatives @@ -1500,14 +1500,14 @@ TEST (active_transactions, limit_vote_hinted_elections) /* * Tests that when AEC is running at capacity from normal elections, it is still possible to schedule a limited number of hinted elections */ -TEST (active_transactions, allow_limited_overflow) +TEST (active_elections, allow_limited_overflow) { nano::test::system system; nano::node_config config = system.default_config (); const int aec_limit = 20; config.frontiers_confirmation = nano::frontiers_confirmation_mode::disabled; - config.active_transactions.size = aec_limit; - config.active_transactions.hinted_limit_percentage = 20; // Should give us a limit of 4 hinted elections + config.active_elections.size = aec_limit; + config.active_elections.hinted_limit_percentage = 20; // Should give us a limit of 4 hinted elections auto & node = *system.add_node (config); auto blocks = nano::test::setup_independent_blocks (system, node, aec_limit * 4); @@ -1549,14 +1549,14 @@ TEST (active_transactions, allow_limited_overflow) /* * Tests that when hinted elections are present in the AEC, normal scheduler adapts not to exceed the limit of all elections */ -TEST (active_transactions, allow_limited_overflow_adapt) +TEST (active_elections, allow_limited_overflow_adapt) { nano::test::system system; nano::node_config config = system.default_config (); const int aec_limit = 20; config.frontiers_confirmation = nano::frontiers_confirmation_mode::disabled; - config.active_transactions.size = aec_limit; - config.active_transactions.hinted_limit_percentage = 20; // Should give us a limit of 4 hinted elections + config.active_elections.size = aec_limit; + config.active_elections.hinted_limit_percentage = 20; // Should give us a limit of 4 hinted elections auto & node = *system.add_node (config); auto blocks = nano::test::setup_independent_blocks (system, node, aec_limit * 4); diff --git a/nano/core_test/backlog.cpp b/nano/core_test/backlog.cpp index f13c16f1c..543547b1a 100644 --- a/nano/core_test/backlog.cpp +++ b/nano/core_test/backlog.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/nano/core_test/blockprocessor.cpp b/nano/core_test/blockprocessor.cpp index 3050947d3..57c777062 100644 --- a/nano/core_test/blockprocessor.cpp +++ b/nano/core_test/blockprocessor.cpp @@ -16,9 +16,9 @@ TEST (block_processor, broadcast_block_on_arrival) nano::test::system system; nano::node_config config1 = system.default_config (); // Deactivates elections on both nodes. - config1.active_transactions.size = 0; + config1.active_elections.size = 0; nano::node_config config2 = system.default_config (); - config2.active_transactions.size = 0; + config2.active_elections.size = 0; nano::node_flags flags; // Disables bootstrap listener to make sure the block won't be shared by this channel. flags.disable_bootstrap_listener = true; diff --git a/nano/core_test/bootstrap.cpp b/nano/core_test/bootstrap.cpp index 84995fa54..bd1e5571c 100644 --- a/nano/core_test/bootstrap.cpp +++ b/nano/core_test/bootstrap.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/nano/core_test/confirmation_solicitor.cpp b/nano/core_test/confirmation_solicitor.cpp index 20e2ee5af..f3609a36a 100644 --- a/nano/core_test/confirmation_solicitor.cpp +++ b/nano/core_test/confirmation_solicitor.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/nano/core_test/confirming_set.cpp b/nano/core_test/confirming_set.cpp index efb0f91ab..0a699182d 100644 --- a/nano/core_test/confirming_set.cpp +++ b/nano/core_test/confirming_set.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/nano/core_test/conflicts.cpp b/nano/core_test/conflicts.cpp index cbf1a9e86..8a4ca3a48 100644 --- a/nano/core_test/conflicts.cpp +++ b/nano/core_test/conflicts.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/nano/core_test/election.cpp b/nano/core_test/election.cpp index ac80c5288..eb5aafe08 100644 --- a/nano/core_test/election.cpp +++ b/nano/core_test/election.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/nano/core_test/election_scheduler.cpp b/nano/core_test/election_scheduler.cpp index 7abd60aa1..02a37bec8 100644 --- a/nano/core_test/election_scheduler.cpp +++ b/nano/core_test/election_scheduler.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include @@ -56,7 +56,7 @@ TEST (election_scheduler, activate_one_flush) /** * Tests that the election scheduler and the active transactions container (AEC) - * work in sync with regards to the node configuration value "active_transactions.size". + * work in sync with regards to the node configuration value "active_elections.size". * * The test sets up two forcefully cemented blocks -- a send on the genesis account and a receive on a second account. * It then creates two other blocks, each a successor to one of the previous two, @@ -74,7 +74,7 @@ TEST (election_scheduler, no_vacancy) nano::test::system system{}; nano::node_config config = system.default_config (); - config.active_transactions.size = 1; + config.active_elections.size = 1; config.frontiers_confirmation = nano::frontiers_confirmation_mode::disabled; auto & node = *system.add_node (config); diff --git a/nano/core_test/frontiers_confirmation.cpp b/nano/core_test/frontiers_confirmation.cpp index b8c521b67..89c19752b 100644 --- a/nano/core_test/frontiers_confirmation.cpp +++ b/nano/core_test/frontiers_confirmation.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/nano/core_test/ledger.cpp b/nano/core_test/ledger.cpp index dbfabf86b..46b03eac7 100644 --- a/nano/core_test/ledger.cpp +++ b/nano/core_test/ledger.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/nano/core_test/ledger_confirm.cpp b/nano/core_test/ledger_confirm.cpp index dcda5ac0b..5729369a0 100644 --- a/nano/core_test/ledger_confirm.cpp +++ b/nano/core_test/ledger_confirm.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/nano/core_test/memory_pool.cpp b/nano/core_test/memory_pool.cpp index 1d9c1fc1b..6d5dd4ae9 100644 --- a/nano/core_test/memory_pool.cpp +++ b/nano/core_test/memory_pool.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include diff --git a/nano/core_test/node.cpp b/nano/core_test/node.cpp index da56b816d..d7d24d11a 100644 --- a/nano/core_test/node.cpp +++ b/nano/core_test/node.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/nano/core_test/optimistic_scheduler.cpp b/nano/core_test/optimistic_scheduler.cpp index 1fc1deac8..c7f7311c8 100644 --- a/nano/core_test/optimistic_scheduler.cpp +++ b/nano/core_test/optimistic_scheduler.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/nano/core_test/rep_crawler.cpp b/nano/core_test/rep_crawler.cpp index 13088d7d7..e775c2338 100644 --- a/nano/core_test/rep_crawler.cpp +++ b/nano/core_test/rep_crawler.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/nano/core_test/request_aggregator.cpp b/nano/core_test/request_aggregator.cpp index 942e26b4b..e78bc2a5a 100644 --- a/nano/core_test/request_aggregator.cpp +++ b/nano/core_test/request_aggregator.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/nano/core_test/toml.cpp b/nano/core_test/toml.cpp index dc1ed2fa4..fdf3370aa 100644 --- a/nano/core_test/toml.cpp +++ b/nano/core_test/toml.cpp @@ -152,7 +152,7 @@ TEST (toml, daemon_config_deserialize_defaults) ASSERT_EQ (conf.rpc.child_process.enable, defaults.rpc.child_process.enable); ASSERT_EQ (conf.rpc.child_process.rpc_path, defaults.rpc.child_process.rpc_path); - ASSERT_EQ (conf.node.active_transactions.size, defaults.node.active_transactions.size); + ASSERT_EQ (conf.node.active_elections.size, defaults.node.active_elections.size); ASSERT_EQ (conf.node.allow_local_peers, defaults.node.allow_local_peers); ASSERT_EQ (conf.node.backup_before_upgrade, defaults.node.backup_before_upgrade); ASSERT_EQ (conf.node.bandwidth_limit, defaults.node.bandwidth_limit); @@ -451,7 +451,7 @@ TEST (toml, daemon_config_deserialize_no_defaults) priority_bootstrap = 999 priority_local = 999 - [node.active_transactions] + [node.active_elections] size = 999 hinted_limit_percentage = 90 optimistic_limit_percentage = 90 @@ -607,7 +607,7 @@ TEST (toml, daemon_config_deserialize_no_defaults) ASSERT_NE (conf.rpc.child_process.enable, defaults.rpc.child_process.enable); ASSERT_NE (conf.rpc.child_process.rpc_path, defaults.rpc.child_process.rpc_path); - ASSERT_NE (conf.node.active_transactions.size, defaults.node.active_transactions.size); + ASSERT_NE (conf.node.active_elections.size, defaults.node.active_elections.size); ASSERT_NE (conf.node.allow_local_peers, defaults.node.allow_local_peers); ASSERT_NE (conf.node.backup_before_upgrade, defaults.node.backup_before_upgrade); ASSERT_NE (conf.node.bandwidth_limit, defaults.node.bandwidth_limit); @@ -1024,7 +1024,7 @@ TEST (toml, log_config_no_defaults) rotation_count = 999 [log.levels] - active_transactions = "trace" + active_elections = "trace" blockprocessor = "trace" )toml"; @@ -1081,7 +1081,7 @@ TEST (toml, merge_config_files) ss << R"toml( [node] - active_transactions.size = 999 + active_elections.size = 999 # backlog_scan_batch_size = 7777 [node.bootstrap_ascending] block_wait_count = 33333 @@ -1104,8 +1104,8 @@ TEST (toml, merge_config_files) merged_toml.read (ss2); merged_config.deserialize_toml (merged_toml); - ASSERT_NE (merged_config.node.active_transactions.size, default_config.node.active_transactions.size); - ASSERT_EQ (merged_config.node.active_transactions.size, 999); + ASSERT_NE (merged_config.node.active_elections.size, default_config.node.active_elections.size); + ASSERT_EQ (merged_config.node.active_elections.size, 999); ASSERT_NE (merged_config.node.backlog_scan_batch_size, 7777); ASSERT_EQ (merged_config.node.bootstrap_ascending.block_wait_count, 33333); ASSERT_TRUE (merged_config_string.find ("old_entry") == std::string::npos); diff --git a/nano/core_test/vote_processor.cpp b/nano/core_test/vote_processor.cpp index 9e0214c09..a7986d334 100644 --- a/nano/core_test/vote_processor.cpp +++ b/nano/core_test/vote_processor.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/nano/core_test/voting.cpp b/nano/core_test/voting.cpp index c0a7d807e..458eb54d3 100644 --- a/nano/core_test/voting.cpp +++ b/nano/core_test/voting.cpp @@ -146,7 +146,7 @@ TEST (vote_spacing, vote_generator) { nano::node_config config; config.frontiers_confirmation = nano::frontiers_confirmation_mode::disabled; - config.active_transactions.hinted_limit_percentage = 0; // Disable election hinting + config.active_elections.hinted_limit_percentage = 0; // Disable election hinting nano::test::system system; nano::node_flags node_flags; node_flags.disable_search_pending = true; @@ -190,7 +190,7 @@ TEST (vote_spacing, rapid) { nano::node_config config; config.frontiers_confirmation = nano::frontiers_confirmation_mode::disabled; - config.active_transactions.hinted_limit_percentage = 0; // Disable election hinting + config.active_elections.hinted_limit_percentage = 0; // Disable election hinting nano::test::system system; nano::node_flags node_flags; node_flags.disable_search_pending = true; diff --git a/nano/core_test/wallet.cpp b/nano/core_test/wallet.cpp index faa6adbe9..204b7b147 100644 --- a/nano/core_test/wallet.cpp +++ b/nano/core_test/wallet.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/nano/core_test/wallets.cpp b/nano/core_test/wallets.cpp index 965c49692..d87e38b78 100644 --- a/nano/core_test/wallets.cpp +++ b/nano/core_test/wallets.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/nano/core_test/websocket.cpp b/nano/core_test/websocket.cpp index beabcad4a..91ae598b9 100644 --- a/nano/core_test/websocket.cpp +++ b/nano/core_test/websocket.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/nano/lib/logging_enums.hpp b/nano/lib/logging_enums.hpp index 4e434b4cc..662981d0a 100644 --- a/nano/lib/logging_enums.hpp +++ b/nano/lib/logging_enums.hpp @@ -45,7 +45,7 @@ enum class type ipc_server, websocket, tls, - active_transactions, + active_elections, election, blockprocessor, network, @@ -104,7 +104,7 @@ enum class detail // node process_confirmed, - // active_transactions + // active_elections active_started, active_stopped, diff --git a/nano/lib/stats_enums.hpp b/nano/lib/stats_enums.hpp index be36061e3..81f121fc1 100644 --- a/nano/lib/stats_enums.hpp +++ b/nano/lib/stats_enums.hpp @@ -55,7 +55,7 @@ enum class type bootstrap_server_overfill, bootstrap_server_response, active, - active_transactions, + active_elections, active_started, active_confirmed, active_dropped, diff --git a/nano/nano_node/entry.cpp b/nano/nano_node/entry.cpp index fec6e2d48..dc603cfb8 100644 --- a/nano/nano_node/entry.cpp +++ b/nano/nano_node/entry.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include #include @@ -1238,7 +1238,7 @@ int main (int argc, char * const * argv) else { config2.frontiers_confirmation = daemon_config.node.frontiers_confirmation; - config2.active_transactions.size = daemon_config.node.active_transactions.size; + config2.active_elections.size = daemon_config.node.active_elections.size; } auto node2 (std::make_shared (io_ctx2, path2, config2, work, flags, 1)); diff --git a/nano/node/CMakeLists.txt b/nano/node/CMakeLists.txt index ec525aa95..d392f8228 100644 --- a/nano/node/CMakeLists.txt +++ b/nano/node/CMakeLists.txt @@ -14,8 +14,8 @@ endif() add_library( node ${platform_sources} - active_transactions.hpp - active_transactions.cpp + active_elections.hpp + active_elections.cpp backlog_population.hpp backlog_population.cpp bandwidth_limiter.hpp diff --git a/nano/node/active_transactions.cpp b/nano/node/active_elections.cpp similarity index 79% rename from nano/node/active_transactions.cpp rename to nano/node/active_elections.cpp index 9674e38ab..8be7dc3c1 100644 --- a/nano/node/active_transactions.cpp +++ b/nano/node/active_elections.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include @@ -17,8 +17,8 @@ using namespace std::chrono; -nano::active_transactions::active_transactions (nano::node & node_a, nano::confirming_set & confirming_set, nano::block_processor & block_processor_a) : - config{ node_a.config.active_transactions }, +nano::active_elections::active_elections (nano::node & node_a, nano::confirming_set & confirming_set, nano::block_processor & block_processor_a) : + config{ node_a.config.active_elections }, node{ node_a }, confirming_set{ confirming_set }, block_processor{ block_processor_a }, @@ -51,13 +51,13 @@ nano::active_transactions::active_transactions (nano::node & node_a, nano::confi }); } -nano::active_transactions::~active_transactions () +nano::active_elections::~active_elections () { // Thread must be stopped before destruction debug_assert (!thread.joinable ()); } -void nano::active_transactions::start () +void nano::active_elections::start () { if (node.flags.disable_request_loop) { @@ -72,7 +72,7 @@ void nano::active_transactions::start () }); } -void nano::active_transactions::stop () +void nano::active_elections::stop () { { nano::lock_guard guard{ mutex }; @@ -83,7 +83,7 @@ void nano::active_transactions::stop () clear (); } -void nano::active_transactions::block_cemented_callback (std::shared_ptr const & block) +void nano::active_elections::block_cemented_callback (std::shared_ptr const & block) { debug_assert (node.block_confirmed (block->hash ())); if (auto election_l = election (block->qualified_root ())) @@ -124,7 +124,7 @@ void nano::active_transactions::block_cemented_callback (std::shared_ptr const & votes) +void nano::active_elections::notify_observers (nano::secure::read_transaction const & transaction, nano::election_status const & status, std::vector const & votes) { auto block = status.winner; auto account = block->account (); @@ -143,7 +143,7 @@ void nano::active_transactions::notify_observers (nano::secure::read_transaction } } -void nano::active_transactions::activate_successors (nano::secure::read_transaction const & transaction, std::shared_ptr const & block) +void nano::active_elections::activate_successors (nano::secure::read_transaction const & transaction, std::shared_ptr const & block) { node.scheduler.priority.activate (transaction, block->account ()); @@ -154,13 +154,13 @@ void nano::active_transactions::activate_successors (nano::secure::read_transact } } -void nano::active_transactions::add_election_winner_details (nano::block_hash const & hash_a, std::shared_ptr const & election_a) +void nano::active_elections::add_election_winner_details (nano::block_hash const & hash_a, std::shared_ptr const & election_a) { nano::lock_guard guard{ election_winner_details_mutex }; election_winner_details.emplace (hash_a, election_a); } -std::shared_ptr nano::active_transactions::remove_election_winner_details (nano::block_hash const & hash_a) +std::shared_ptr nano::active_elections::remove_election_winner_details (nano::block_hash const & hash_a) { nano::lock_guard guard{ election_winner_details_mutex }; std::shared_ptr result; @@ -173,7 +173,7 @@ std::shared_ptr nano::active_transactions::remove_election_winne return result; } -void nano::active_transactions::block_already_cemented_callback (nano::block_hash const & hash_a) +void nano::active_elections::block_already_cemented_callback (nano::block_hash const & hash_a) { // Depending on timing there is a situation where the election_winner_details is not reset. // This can happen when a block wins an election, and the block is confirmed + observer @@ -182,7 +182,7 @@ void nano::active_transactions::block_already_cemented_callback (nano::block_has remove_election_winner_details (hash_a); } -int64_t nano::active_transactions::limit (nano::election_behavior behavior) const +int64_t nano::active_elections::limit (nano::election_behavior behavior) const { switch (behavior) { @@ -206,7 +206,7 @@ int64_t nano::active_transactions::limit (nano::election_behavior behavior) cons return 0; } -int64_t nano::active_transactions::vacancy (nano::election_behavior behavior) const +int64_t nano::active_elections::vacancy (nano::election_behavior behavior) const { nano::lock_guard guard{ mutex }; switch (behavior) @@ -221,7 +221,7 @@ int64_t nano::active_transactions::vacancy (nano::election_behavior behavior) co return 0; } -void nano::active_transactions::request_confirm (nano::unique_lock & lock_a) +void nano::active_elections::request_confirm (nano::unique_lock & lock_a) { debug_assert (lock_a.owns_lock ()); @@ -258,7 +258,7 @@ void nano::active_transactions::request_confirm (nano::unique_lock lock_a.lock (); } -void nano::active_transactions::cleanup_election (nano::unique_lock & lock_a, std::shared_ptr election) +void nano::active_elections::cleanup_election (nano::unique_lock & lock_a, std::shared_ptr election) { debug_assert (!mutex.try_lock ()); debug_assert (lock_a.owns_lock ()); @@ -279,9 +279,9 @@ void nano::active_transactions::cleanup_election (nano::unique_lock roots.get ().erase (roots.get ().find (election->qualified_root)); node.stats.inc (completion_type (*election), to_stat_detail (election->behavior ())); - node.logger.trace (nano::log::type::active_transactions, nano::log::detail::active_stopped, nano::log::arg{ "election", election }); + node.logger.trace (nano::log::type::active_elections, nano::log::detail::active_stopped, nano::log::arg{ "election", election }); - node.logger.debug (nano::log::type::active_transactions, "Erased election for blocks: {} (behavior: {}, state: {})", + node.logger.debug (nano::log::type::active_elections, "Erased election for blocks: {} (behavior: {}, state: {})", fmt::join (std::views::keys (blocks_l), ", "), to_string (election->behavior ()), to_string (election->state ())); @@ -308,7 +308,7 @@ void nano::active_transactions::cleanup_election (nano::unique_lock } } -nano::stat::type nano::active_transactions::completion_type (nano::election const & election) const +nano::stat::type nano::active_elections::completion_type (nano::election const & election) const { if (election.confirmed ()) { @@ -321,13 +321,13 @@ nano::stat::type nano::active_transactions::completion_type (nano::election cons return nano::stat::type::active_dropped; } -std::vector> nano::active_transactions::list_active (std::size_t max_a) +std::vector> nano::active_elections::list_active (std::size_t max_a) { nano::lock_guard guard{ mutex }; return list_active_impl (max_a); } -std::vector> nano::active_transactions::list_active_impl (std::size_t max_a) const +std::vector> nano::active_elections::list_active_impl (std::size_t max_a) const { std::vector> result_l; result_l.reserve (std::min (max_a, roots.size ())); @@ -342,7 +342,7 @@ std::vector> nano::active_transactions::list_act return result_l; } -void nano::active_transactions::request_loop () +void nano::active_elections::request_loop () { nano::unique_lock lock{ mutex }; while (!stopped) @@ -363,7 +363,7 @@ void nano::active_transactions::request_loop () } } -void nano::active_transactions::trim () +void nano::active_elections::trim () { /* * Both normal and hinted election schedulers are well-behaved, meaning they first check for AEC vacancy before inserting new elections. @@ -377,7 +377,7 @@ void nano::active_transactions::trim () } } -nano::election_insertion_result nano::active_transactions::insert (std::shared_ptr const & block_a, nano::election_behavior election_behavior_a) +nano::election_insertion_result nano::active_elections::insert (std::shared_ptr const & block_a, nano::election_behavior election_behavior_a) { debug_assert (block_a); debug_assert (block_a->has_sideband ()); @@ -404,7 +404,7 @@ nano::election_insertion_result nano::active_transactions::insert (std::shared_p node.online_reps.observe (rep_a); }; result.election = nano::make_shared (node, block_a, nullptr, observe_rep_cb, election_behavior_a); - roots.get ().emplace (nano::active_transactions::conflict_info{ root, result.election }); + roots.get ().emplace (nano::active_elections::conflict_info{ root, result.election }); blocks.emplace (hash, result.election); // Keep track of election count by election type @@ -412,11 +412,11 @@ nano::election_insertion_result nano::active_transactions::insert (std::shared_p count_by_behavior[result.election->behavior ()]++; node.stats.inc (nano::stat::type::active_started, to_stat_detail (election_behavior_a)); - node.logger.trace (nano::log::type::active_transactions, nano::log::detail::active_started, + node.logger.trace (nano::log::type::active_elections, nano::log::detail::active_started, nano::log::arg{ "behavior", election_behavior_a }, nano::log::arg{ "election", result.election }); - node.logger.debug (nano::log::type::active_transactions, "Started new election for block: {} (behavior: {})", + node.logger.debug (nano::log::type::active_elections, "Started new election for block: {} (behavior: {})", hash.to_string (), to_string (election_behavior_a)); } @@ -453,7 +453,7 @@ nano::election_insertion_result nano::active_transactions::insert (std::shared_p return result; } -bool nano::active_transactions::trigger_vote_cache (nano::block_hash hash) +bool nano::active_elections::trigger_vote_cache (nano::block_hash hash) { auto cached = node.vote_cache.find (hash); for (auto const & cached_vote : cached) @@ -464,7 +464,7 @@ bool nano::active_transactions::trigger_vote_cache (nano::block_hash hash) } // Validate a vote and apply it to the current election if one exists -std::unordered_map nano::active_transactions::vote (std::shared_ptr const & vote, nano::vote_source source) +std::unordered_map nano::active_elections::vote (std::shared_ptr const & vote, nano::vote_source source) { debug_assert (!vote->validate ()); // false => valid vote @@ -513,25 +513,25 @@ std::unordered_map nano::active_transactions: return results; } -bool nano::active_transactions::active (nano::qualified_root const & root_a) const +bool nano::active_elections::active (nano::qualified_root const & root_a) const { nano::lock_guard lock{ mutex }; return roots.get ().find (root_a) != roots.get ().end (); } -bool nano::active_transactions::active (nano::block const & block_a) const +bool nano::active_elections::active (nano::block const & block_a) const { nano::lock_guard guard{ mutex }; return roots.get ().find (block_a.qualified_root ()) != roots.get ().end () && blocks.find (block_a.hash ()) != blocks.end (); } -bool nano::active_transactions::active (const nano::block_hash & hash) const +bool nano::active_elections::active (const nano::block_hash & hash) const { nano::lock_guard guard{ mutex }; return blocks.find (hash) != blocks.end (); } -std::shared_ptr nano::active_transactions::election (nano::qualified_root const & root_a) const +std::shared_ptr nano::active_elections::election (nano::qualified_root const & root_a) const { std::shared_ptr result; nano::lock_guard lock{ mutex }; @@ -543,7 +543,7 @@ std::shared_ptr nano::active_transactions::election (nano::quali return result; } -std::shared_ptr nano::active_transactions::winner (nano::block_hash const & hash_a) const +std::shared_ptr nano::active_elections::winner (nano::block_hash const & hash_a) const { std::shared_ptr result; nano::unique_lock lock{ mutex }; @@ -557,12 +557,12 @@ std::shared_ptr nano::active_transactions::winner (nano::block_hash return result; } -bool nano::active_transactions::erase (nano::block const & block_a) +bool nano::active_elections::erase (nano::block const & block_a) { return erase (block_a.qualified_root ()); } -bool nano::active_transactions::erase (nano::qualified_root const & root_a) +bool nano::active_elections::erase (nano::qualified_root const & root_a) { nano::unique_lock lock{ mutex }; auto root_it (roots.get ().find (root_a)); @@ -574,7 +574,7 @@ bool nano::active_transactions::erase (nano::qualified_root const & root_a) return false; } -bool nano::active_transactions::erase_hash (nano::block_hash const & hash_a) +bool nano::active_elections::erase_hash (nano::block_hash const & hash_a) { nano::unique_lock lock{ mutex }; [[maybe_unused]] auto erased (blocks.erase (hash_a)); @@ -582,7 +582,7 @@ bool nano::active_transactions::erase_hash (nano::block_hash const & hash_a) return erased == 1; } -void nano::active_transactions::erase_oldest () +void nano::active_elections::erase_oldest () { nano::unique_lock lock{ mutex }; if (!roots.empty ()) @@ -592,19 +592,19 @@ void nano::active_transactions::erase_oldest () } } -bool nano::active_transactions::empty () const +bool nano::active_elections::empty () const { nano::lock_guard lock{ mutex }; return roots.empty (); } -std::size_t nano::active_transactions::size () const +std::size_t nano::active_elections::size () const { nano::lock_guard lock{ mutex }; return roots.size (); } -bool nano::active_transactions::publish (std::shared_ptr const & block_a) +bool nano::active_elections::publish (std::shared_ptr const & block_a) { nano::unique_lock lock{ mutex }; auto existing (roots.get ().find (block_a->qualified_root ())); @@ -628,13 +628,13 @@ bool nano::active_transactions::publish (std::shared_ptr const & bl return result; } -std::size_t nano::active_transactions::election_winner_details_size () +std::size_t nano::active_elections::election_winner_details_size () { nano::lock_guard guard{ election_winner_details_mutex }; return election_winner_details.size (); } -void nano::active_transactions::clear () +void nano::active_elections::clear () { { nano::lock_guard guard{ mutex }; @@ -644,20 +644,20 @@ void nano::active_transactions::clear () vacancy_update (); } -std::unique_ptr nano::collect_container_info (active_transactions & active_transactions, std::string const & name) +std::unique_ptr nano::collect_container_info (active_elections & active_elections, std::string const & name) { - nano::lock_guard guard{ active_transactions.mutex }; + nano::lock_guard guard{ active_elections.mutex }; auto composite = std::make_unique (name); - composite->add_component (std::make_unique (container_info{ "roots", active_transactions.roots.size (), sizeof (decltype (active_transactions.roots)::value_type) })); - composite->add_component (std::make_unique (container_info{ "blocks", active_transactions.blocks.size (), sizeof (decltype (active_transactions.blocks)::value_type) })); - composite->add_component (std::make_unique (container_info{ "election_winner_details", active_transactions.election_winner_details_size (), sizeof (decltype (active_transactions.election_winner_details)::value_type) })); - composite->add_component (std::make_unique (container_info{ "normal", static_cast (active_transactions.count_by_behavior[nano::election_behavior::normal]), 0 })); - composite->add_component (std::make_unique (container_info{ "hinted", static_cast (active_transactions.count_by_behavior[nano::election_behavior::hinted]), 0 })); - composite->add_component (std::make_unique (container_info{ "optimistic", static_cast (active_transactions.count_by_behavior[nano::election_behavior::optimistic]), 0 })); + composite->add_component (std::make_unique (container_info{ "roots", active_elections.roots.size (), sizeof (decltype (active_elections.roots)::value_type) })); + composite->add_component (std::make_unique (container_info{ "blocks", active_elections.blocks.size (), sizeof (decltype (active_elections.blocks)::value_type) })); + composite->add_component (std::make_unique (container_info{ "election_winner_details", active_elections.election_winner_details_size (), sizeof (decltype (active_elections.election_winner_details)::value_type) })); + composite->add_component (std::make_unique (container_info{ "normal", static_cast (active_elections.count_by_behavior[nano::election_behavior::normal]), 0 })); + composite->add_component (std::make_unique (container_info{ "hinted", static_cast (active_elections.count_by_behavior[nano::election_behavior::hinted]), 0 })); + composite->add_component (std::make_unique (container_info{ "optimistic", static_cast (active_elections.count_by_behavior[nano::election_behavior::optimistic]), 0 })); - composite->add_component (active_transactions.recently_confirmed.collect_container_info ("recently_confirmed")); - composite->add_component (active_transactions.recently_cemented.collect_container_info ("recently_cemented")); + composite->add_component (active_elections.recently_confirmed.collect_container_info ("recently_confirmed")); + composite->add_component (active_elections.recently_cemented.collect_container_info ("recently_cemented")); return composite; } @@ -767,14 +767,14 @@ std::unique_ptr nano::recently_cemented_cache::c } /* - * active_transactions_config + * active_elections_config */ -nano::active_transactions_config::active_transactions_config (const nano::network_constants & network_constants) +nano::active_elections_config::active_elections_config (const nano::network_constants & network_constants) { } -nano::error nano::active_transactions_config::serialize (nano::tomlconfig & toml) const +nano::error nano::active_elections_config::serialize (nano::tomlconfig & toml) const { toml.put ("size", size, "Number of active elections. Elections beyond this limit have limited survival time.\nWarning: modifying this value may result in a lower confirmation rate. \ntype:uint64,[250..]"); toml.put ("hinted_limit_percentage", hinted_limit_percentage, "Limit of hinted elections as percentage of `active_elections_size` \ntype:uint64"); @@ -785,7 +785,7 @@ nano::error nano::active_transactions_config::serialize (nano::tomlconfig & toml return toml.get_error (); } -nano::error nano::active_transactions_config::deserialize (nano::tomlconfig & toml) +nano::error nano::active_elections_config::deserialize (nano::tomlconfig & toml) { toml.get ("size", size); toml.get ("hinted_limit_percentage", hinted_limit_percentage); diff --git a/nano/node/active_transactions.hpp b/nano/node/active_elections.hpp similarity index 93% rename from nano/node/active_transactions.hpp rename to nano/node/active_elections.hpp index 6b8f1f326..9ebff5365 100644 --- a/nano/node/active_transactions.hpp +++ b/nano/node/active_elections.hpp @@ -25,7 +25,7 @@ namespace mi = boost::multi_index; namespace nano { class node; -class active_transactions; +class active_elections; class block; class block_sideband; class block_processor; @@ -41,10 +41,10 @@ class read_transaction; namespace nano { -class active_transactions_config final +class active_elections_config final { public: - explicit active_transactions_config (nano::network_constants const &); + explicit active_elections_config (nano::network_constants const &); nano::error deserialize (nano::tomlconfig & toml); nano::error serialize (nano::tomlconfig & toml) const; @@ -132,7 +132,7 @@ public: // Container info * Core class for determining consensus * Holds all active blocks i.e. recently added blocks that need confirmation */ -class active_transactions final +class active_elections final { private: // Elections class conflict_info final @@ -163,8 +163,8 @@ private: // Elections std::unordered_map> blocks; public: - active_transactions (nano::node &, nano::confirming_set &, nano::block_processor &); - ~active_transactions (); + active_elections (nano::node &, nano::confirming_set &, nano::block_processor &); + ~active_elections (); void start (); void stop (); @@ -230,7 +230,7 @@ private: bool trigger_vote_cache (nano::block_hash); private: // Dependencies - active_transactions_config const & config; + active_elections_config const & config; nano::node & node; nano::confirming_set & confirming_set; nano::block_processor & block_processor; @@ -258,7 +258,7 @@ private: std::thread thread; friend class election; - friend std::unique_ptr collect_container_info (active_transactions &, std::string const &); + friend std::unique_ptr collect_container_info (active_elections &, std::string const &); public: // Tests void clear (); @@ -266,15 +266,15 @@ public: // Tests friend class node_fork_storm_Test; friend class system_block_sequence_Test; friend class node_mass_block_new_Test; - friend class active_transactions_vote_replays_Test; + friend class active_elections_vote_replays_Test; friend class frontiers_confirmation_prioritize_frontiers_Test; friend class frontiers_confirmation_prioritize_frontiers_max_optimistic_elections_Test; friend class confirmation_height_prioritize_frontiers_overwrite_Test; - friend class active_transactions_confirmation_consistency_Test; + friend class active_elections_confirmation_consistency_Test; friend class node_deferred_dependent_elections_Test; - friend class active_transactions_pessimistic_elections_Test; + friend class active_elections_pessimistic_elections_Test; friend class frontiers_confirmation_expired_optimistic_elections_removal_Test; }; -std::unique_ptr collect_container_info (active_transactions & active_transactions, std::string const & name); +std::unique_ptr collect_container_info (active_elections & active_elections, std::string const & name); } diff --git a/nano/node/blockprocessor.cpp b/nano/node/blockprocessor.cpp index c5ec31dca..80ecefeb6 100644 --- a/nano/node/blockprocessor.cpp +++ b/nano/node/blockprocessor.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/nano/node/cli.cpp b/nano/node/cli.cpp index 55e4da5d3..87d26b86c 100644 --- a/nano/node/cli.cpp +++ b/nano/node/cli.cpp @@ -93,7 +93,7 @@ void nano::add_node_flag_options (boost::program_options::options_description & // clang-format off description_a.add_options() ("disable_add_initial_peers", "Disable contacting the peer in the peers table at startup") - ("disable_activate_successors", "Disables activate_successors in active_transactions") + ("disable_activate_successors", "Disables activate_successors in active_elections") ("disable_backup", "Disable wallet automatic backups") ("disable_lazy_bootstrap", "Disables lazy bootstrap") ("disable_legacy_bootstrap", "Disables legacy bootstrap") diff --git a/nano/node/common.cpp b/nano/node/common.cpp index 9a4de7172..5edab1f7f 100644 --- a/nano/node/common.cpp +++ b/nano/node/common.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/nano/node/election.cpp b/nano/node/election.cpp index e588352a2..14984826b 100644 --- a/nano/node/election.cpp +++ b/nano/node/election.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/nano/node/election.hpp b/nano/node/election.hpp index d36e0a38b..4033eb7ac 100644 --- a/nano/node/election.hpp +++ b/nano/node/election.hpp @@ -181,7 +181,7 @@ public: // Logging private: // Constants static std::size_t constexpr max_blocks{ 10 }; - friend class active_transactions; + friend class active_elections; friend class confirmation_solicitor; public: // Only used in tests diff --git a/nano/node/inactive_node.cpp b/nano/node/inactive_node.cpp index 6ceb33ac1..69696609d 100644 --- a/nano/node/inactive_node.cpp +++ b/nano/node/inactive_node.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/nano/node/json_handler.cpp b/nano/node/json_handler.cpp index b2ca6e527..d1978048e 100644 --- a/nano/node/json_handler.cpp +++ b/nano/node/json_handler.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include #include @@ -2039,7 +2039,7 @@ void nano::json_handler::election_statistics () } } - auto utilization_percentage = (static_cast (total_count * 100) / node.config.active_transactions.size); + auto utilization_percentage = (static_cast (total_count * 100) / node.config.active_elections.size); auto max_election_age = std::chrono::duration_cast (now - oldest_election_start).count (); auto average_election_age = total_count ? std::chrono::duration_cast (total_age).count () / total_count : 0; diff --git a/nano/node/node.cpp b/nano/node/node.cpp index 0e06033b0..e0e173681 100644 --- a/nano/node/node.cpp +++ b/nano/node/node.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include #include @@ -178,7 +178,7 @@ nano::node::node (std::shared_ptr io_ctx_a, std::filesy block_processor (*this), confirming_set_impl{ std::make_unique (ledger, config.confirming_set_batch_time) }, confirming_set{ *confirming_set_impl }, - active_impl{ std::make_unique (*this, confirming_set, block_processor) }, + active_impl{ std::make_unique (*this, confirming_set, block_processor) }, active{ *active_impl }, rep_crawler (config.rep_crawler, *this), rep_tiers{ ledger, network_params, online_reps, stats, logger }, diff --git a/nano/node/node.hpp b/nano/node/node.hpp index df456c0c9..ec559e42b 100644 --- a/nano/node/node.hpp +++ b/nano/node/node.hpp @@ -43,7 +43,7 @@ namespace nano { -class active_transactions; +class active_elections; class confirming_set; class node; class vote_processor; @@ -172,8 +172,8 @@ public: nano::block_processor block_processor; std::unique_ptr confirming_set_impl; nano::confirming_set & confirming_set; - std::unique_ptr active_impl; - nano::active_transactions & active; + std::unique_ptr active_impl; + nano::active_elections & active; nano::online_reps online_reps; nano::rep_crawler rep_crawler; nano::rep_tiers rep_tiers; diff --git a/nano/node/nodeconfig.cpp b/nano/node/nodeconfig.cpp index 577db2a49..050855a81 100644 --- a/nano/node/nodeconfig.cpp +++ b/nano/node/nodeconfig.cpp @@ -34,7 +34,7 @@ nano::node_config::node_config (const std::optional & peering_port_a, ipc_config{ network_params.network }, external_address{ boost::asio::ip::address_v6{}.to_string () }, rep_crawler{ network_params.network }, - active_transactions{ network_params.network }, + active_elections{ network_params.network }, block_processor{ network_params.network }, peer_history{ network_params.network }, tcp{ network_params.network } @@ -217,9 +217,9 @@ nano::error nano::node_config::serialize_toml (nano::tomlconfig & toml) const rep_crawler.serialize (rep_crawler_l); toml.put_child ("rep_crawler", rep_crawler_l); - nano::tomlconfig active_transactions_l; - active_transactions.serialize (active_transactions_l); - toml.put_child ("active_transactions", active_transactions_l); + nano::tomlconfig active_elections_l; + active_elections.serialize (active_elections_l); + toml.put_child ("active_elections", active_elections_l); nano::tomlconfig block_processor_l; block_processor.serialize (block_processor_l); @@ -314,10 +314,10 @@ nano::error nano::node_config::deserialize_toml (nano::tomlconfig & toml) rep_crawler.deserialize (config_l); } - if (toml.has_key ("active_transactions")) + if (toml.has_key ("active_elections")) { - auto config_l = toml.get_required_child ("active_transactions"); - active_transactions.deserialize (config_l); + auto config_l = toml.get_required_child ("active_elections"); + active_elections.deserialize (config_l); } if (toml.has_key ("block_processor")) @@ -531,9 +531,9 @@ nano::error nano::node_config::deserialize_toml (nano::tomlconfig & toml) { toml.get_error ().set ("io_threads must be non-zero"); } - if (active_transactions.size <= 250 && !network_params.network.is_dev_network ()) + if (active_elections.size <= 250 && !network_params.network.is_dev_network ()) { - toml.get_error ().set ("active_transactions.size must be greater than 250"); + toml.get_error ().set ("active_elections.size must be greater than 250"); } if (bandwidth_limit > std::numeric_limits::max ()) { diff --git a/nano/node/nodeconfig.hpp b/nano/node/nodeconfig.hpp index a8ec08b4b..554fc1149 100644 --- a/nano/node/nodeconfig.hpp +++ b/nano/node/nodeconfig.hpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include @@ -137,7 +137,7 @@ public: nano::vote_cache_config vote_cache; nano::rep_crawler_config rep_crawler; nano::block_processor_config block_processor; - nano::active_transactions_config active_transactions; + nano::active_elections_config active_elections; nano::vote_processor_config vote_processor; nano::peer_history_config peer_history; nano::transport::tcp_config tcp; diff --git a/nano/node/repcrawler.cpp b/nano/node/repcrawler.cpp index 3097cfade..f8f04a4ce 100644 --- a/nano/node/repcrawler.cpp +++ b/nano/node/repcrawler.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/nano/node/repcrawler.hpp b/nano/node/repcrawler.hpp index 0855a7bde..5f9bbf7f7 100644 --- a/nano/node/repcrawler.hpp +++ b/nano/node/repcrawler.hpp @@ -23,7 +23,7 @@ namespace mi = boost::multi_index; namespace nano { class node; -class active_transactions; +class active_elections; struct representative { @@ -93,7 +93,7 @@ private: // Dependencies nano::stats & stats; nano::logger & logger; nano::network_constants & network_constants; - nano::active_transactions & active; + nano::active_elections & active; private: void run (); diff --git a/nano/node/request_aggregator.cpp b/nano/node/request_aggregator.cpp index 87097c38f..1c7b4f1ec 100644 --- a/nano/node/request_aggregator.cpp +++ b/nano/node/request_aggregator.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include @@ -12,7 +12,7 @@ #include #include -nano::request_aggregator::request_aggregator (nano::node_config const & config_a, nano::stats & stats_a, nano::vote_generator & generator_a, nano::vote_generator & final_generator_a, nano::local_vote_history & history_a, nano::ledger & ledger_a, nano::wallets & wallets_a, nano::active_transactions & active_a) : +nano::request_aggregator::request_aggregator (nano::node_config const & config_a, nano::stats & stats_a, nano::vote_generator & generator_a, nano::vote_generator & final_generator_a, nano::local_vote_history & history_a, nano::ledger & ledger_a, nano::wallets & wallets_a, nano::active_elections & active_a) : config{ config_a }, max_delay (config_a.network_params.network.is_dev_network () ? 50 : 300), small_delay (config_a.network_params.network.is_dev_network () ? 10 : 50), diff --git a/nano/node/request_aggregator.hpp b/nano/node/request_aggregator.hpp index f88a6b4fa..d48d5ec0b 100644 --- a/nano/node/request_aggregator.hpp +++ b/nano/node/request_aggregator.hpp @@ -19,7 +19,7 @@ namespace mi = boost::multi_index; namespace nano { -class active_transactions; +class active_elections; class ledger; class local_vote_history; class node_config; @@ -62,7 +62,7 @@ class request_aggregator final // clang-format on public: - request_aggregator (nano::node_config const & config, nano::stats & stats_a, nano::vote_generator &, nano::vote_generator &, nano::local_vote_history &, nano::ledger &, nano::wallets &, nano::active_transactions &); + request_aggregator (nano::node_config const & config, nano::stats & stats_a, nano::vote_generator &, nano::vote_generator &, nano::local_vote_history &, nano::ledger &, nano::wallets &, nano::active_elections &); /** Add a new request by \p channel_a for hashes \p hashes_roots_a */ void add (std::shared_ptr const & channel_a, std::vector> const & hashes_roots_a); @@ -89,7 +89,7 @@ private: nano::local_vote_history & local_votes; nano::ledger & ledger; nano::wallets & wallets; - nano::active_transactions & active; + nano::active_elections & active; nano::vote_generator & generator; nano::vote_generator & final_generator; diff --git a/nano/node/scheduler/hinted.cpp b/nano/node/scheduler/hinted.cpp index 8729882f1..6f654c65e 100644 --- a/nano/node/scheduler/hinted.cpp +++ b/nano/node/scheduler/hinted.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include @@ -11,7 +11,7 @@ * hinted */ -nano::scheduler::hinted::hinted (hinted_config const & config_a, nano::node & node_a, nano::vote_cache & vote_cache_a, nano::active_transactions & active_a, nano::online_reps & online_reps_a, nano::stats & stats_a) : +nano::scheduler::hinted::hinted (hinted_config const & config_a, nano::node & node_a, nano::vote_cache & vote_cache_a, nano::active_elections & active_a, nano::online_reps & online_reps_a, nano::stats & stats_a) : config{ config_a }, node{ node_a }, vote_cache{ vote_cache_a }, diff --git a/nano/node/scheduler/hinted.hpp b/nano/node/scheduler/hinted.hpp index a31be5576..e26772bda 100644 --- a/nano/node/scheduler/hinted.hpp +++ b/nano/node/scheduler/hinted.hpp @@ -20,7 +20,7 @@ namespace nano { class node; class node_config; -class active_transactions; +class active_elections; class vote_cache; class online_reps; } @@ -54,7 +54,7 @@ public: class hinted final { public: - hinted (hinted_config const &, nano::node &, nano::vote_cache &, nano::active_transactions &, nano::online_reps &, nano::stats &); + hinted (hinted_config const &, nano::node &, nano::vote_cache &, nano::active_elections &, nano::online_reps &, nano::stats &); ~hinted (); void start (); @@ -79,7 +79,7 @@ private: private: // Dependencies nano::node & node; nano::vote_cache & vote_cache; - nano::active_transactions & active; + nano::active_elections & active; nano::online_reps & online_reps; nano::stats & stats; diff --git a/nano/node/scheduler/manual.cpp b/nano/node/scheduler/manual.cpp index 3bcc83c16..787a0fbd9 100644 --- a/nano/node/scheduler/manual.cpp +++ b/nano/node/scheduler/manual.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/nano/node/scheduler/optimistic.cpp b/nano/node/scheduler/optimistic.cpp index e72dec0ac..40f3385fc 100644 --- a/nano/node/scheduler/optimistic.cpp +++ b/nano/node/scheduler/optimistic.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include @@ -9,7 +9,7 @@ #include #include -nano::scheduler::optimistic::optimistic (optimistic_config const & config_a, nano::node & node_a, nano::ledger & ledger_a, nano::active_transactions & active_a, nano::network_constants const & network_constants_a, nano::stats & stats_a) : +nano::scheduler::optimistic::optimistic (optimistic_config const & config_a, nano::node & node_a, nano::ledger & ledger_a, nano::active_elections & active_a, nano::network_constants const & network_constants_a, nano::stats & stats_a) : config{ config_a }, node{ node_a }, ledger{ ledger_a }, diff --git a/nano/node/scheduler/optimistic.hpp b/nano/node/scheduler/optimistic.hpp index 58531ddb4..14318773a 100644 --- a/nano/node/scheduler/optimistic.hpp +++ b/nano/node/scheduler/optimistic.hpp @@ -23,7 +23,7 @@ namespace mi = boost::multi_index; namespace nano { class account_info; -class active_transactions; +class active_elections; class ledger; class node; } @@ -51,7 +51,7 @@ class optimistic final struct entry; public: - optimistic (optimistic_config const &, nano::node &, nano::ledger &, nano::active_transactions &, nano::network_constants const & network_constants, nano::stats &); + optimistic (optimistic_config const &, nano::node &, nano::ledger &, nano::active_elections &, nano::network_constants const & network_constants, nano::stats &); ~optimistic (); void start (); @@ -80,7 +80,7 @@ private: // Dependencies optimistic_config const & config; nano::node & node; nano::ledger & ledger; - nano::active_transactions & active; + nano::active_elections & active; nano::network_constants const & network_constants; nano::stats & stats; diff --git a/nano/node/scheduler/priority.cpp b/nano/node/scheduler/priority.cpp index 8724a4491..0a91f8e56 100644 --- a/nano/node/scheduler/priority.cpp +++ b/nano/node/scheduler/priority.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/nano/node/vote_cache.hpp b/nano/node/vote_cache.hpp index 55d1256cf..5658d0832 100644 --- a/nano/node/vote_cache.hpp +++ b/nano/node/vote_cache.hpp @@ -24,7 +24,7 @@ namespace mi = boost::multi_index; namespace nano { class node; -class active_transactions; +class active_elections; class election; class vote; } diff --git a/nano/node/vote_processor.cpp b/nano/node/vote_processor.cpp index 40dc22370..8c718da74 100644 --- a/nano/node/vote_processor.cpp +++ b/nano/node/vote_processor.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include @@ -15,7 +15,7 @@ using namespace std::chrono_literals; -nano::vote_processor::vote_processor (vote_processor_config const & config_a, nano::active_transactions & active_a, nano::node_observers & observers_a, nano::stats & stats_a, nano::node_flags & flags_a, nano::logger & logger_a, nano::online_reps & online_reps_a, nano::rep_crawler & rep_crawler_a, nano::ledger & ledger_a, nano::network_params & network_params_a, nano::rep_tiers & rep_tiers_a) : +nano::vote_processor::vote_processor (vote_processor_config const & config_a, nano::active_elections & active_a, nano::node_observers & observers_a, nano::stats & stats_a, nano::node_flags & flags_a, nano::logger & logger_a, nano::online_reps & online_reps_a, nano::rep_crawler & rep_crawler_a, nano::ledger & ledger_a, nano::network_params & network_params_a, nano::rep_tiers & rep_tiers_a) : config{ config_a }, active{ active_a }, observers{ observers_a }, diff --git a/nano/node/vote_processor.hpp b/nano/node/vote_processor.hpp index 43659cff0..d6c462807 100644 --- a/nano/node/vote_processor.hpp +++ b/nano/node/vote_processor.hpp @@ -14,7 +14,7 @@ namespace nano { -class active_transactions; +class active_elections; namespace store { class component; @@ -56,7 +56,7 @@ public: class vote_processor final { public: - vote_processor (vote_processor_config const &, nano::active_transactions &, nano::node_observers &, nano::stats &, nano::node_flags &, nano::logger &, nano::online_reps &, nano::rep_crawler &, nano::ledger &, nano::network_params &, nano::rep_tiers &); + vote_processor (vote_processor_config const &, nano::active_elections &, nano::node_observers &, nano::stats &, nano::node_flags &, nano::logger &, nano::online_reps &, nano::rep_crawler &, nano::ledger &, nano::network_params &, nano::rep_tiers &); ~vote_processor (); void start (); @@ -75,7 +75,7 @@ public: private: // Dependencies vote_processor_config const & config; - nano::active_transactions & active; + nano::active_elections & active; nano::node_observers & observers; nano::stats & stats; nano::logger & logger; diff --git a/nano/rpc_test/rpc.cpp b/nano/rpc_test/rpc.cpp index 3032daf5d..e26b8b116 100644 --- a/nano/rpc_test/rpc.cpp +++ b/nano/rpc_test/rpc.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/nano/slow_test/node.cpp b/nano/slow_test/node.cpp index c6b4c872d..2a7455ffb 100644 --- a/nano/slow_test/node.cpp +++ b/nano/slow_test/node.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include #include @@ -995,7 +995,7 @@ TEST (confirmation_height, many_accounts_send_receive_self) nano::node_config node_config = system.default_config (); node_config.online_weight_minimum = 100; node_config.frontiers_confirmation = nano::frontiers_confirmation_mode::disabled; - node_config.active_transactions.size = 400000; + node_config.active_elections.size = 400000; nano::node_flags node_flags; auto node = system.add_node (node_config); system.wallet (0)->insert_adhoc (nano::dev::genesis_key.prv); diff --git a/nano/slow_test/vote_cache.cpp b/nano/slow_test/vote_cache.cpp index 73ecba40e..32a105cdc 100644 --- a/nano/slow_test/vote_cache.cpp +++ b/nano/slow_test/vote_cache.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/nano/test_common/system.cpp b/nano/test_common/system.cpp index d3ede54f2..ce6950e89 100644 --- a/nano/test_common/system.cpp +++ b/nano/test_common/system.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/nano/test_common/testutil.cpp b/nano/test_common/testutil.cpp index d8500fdf4..493672c0b 100644 --- a/nano/test_common/testutil.cpp +++ b/nano/test_common/testutil.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include