From d09940f645541ad14173affb3c6773e10b250548 Mon Sep 17 00:00:00 2001 From: Colin LeMahieu Date: Mon, 28 Oct 2024 21:38:03 +0000 Subject: [PATCH] Remove inclusion of vote in common.hpp header. --- nano/core_test/active_elections.cpp | 1 + nano/core_test/block.cpp | 1 + nano/core_test/conflicts.cpp | 1 + nano/core_test/ledger.cpp | 1 + nano/core_test/memory_pool.cpp | 1 + nano/core_test/message.cpp | 1 + nano/core_test/message_deserializer.cpp | 1 + nano/core_test/node.cpp | 1 + nano/core_test/rep_crawler.cpp | 3 ++- nano/core_test/vote_processor.cpp | 1 + nano/core_test/voting.cpp | 1 + nano/lib/blocks.cpp | 1 + nano/nano_node/entry.cpp | 1 + nano/node/bandwidth_limiter.hpp | 7 ++++++- nano/node/bootstrap/bootstrap.hpp | 1 + nano/node/bootstrap/bootstrap_attempt.hpp | 2 ++ nano/node/bootstrap_ascending/account_sets.hpp | 6 +++++- nano/node/confirming_set.hpp | 8 ++++++++ nano/node/election.cpp | 1 + nano/node/endpoint.cpp | 1 + nano/node/ipc/ipc_config.cpp | 6 ++++++ nano/node/ipc/ipc_config.hpp | 11 ++++++----- nano/node/local_block_broadcaster.hpp | 1 + nano/node/message_processor.cpp | 3 ++- nano/node/messages.cpp | 1 + nano/node/messages.hpp | 2 ++ nano/node/node.cpp | 1 + nano/node/repcrawler.cpp | 1 + nano/node/scheduler/bucket.hpp | 2 ++ nano/node/vote_cache.cpp | 1 + nano/node/vote_generator.cpp | 3 ++- nano/node/vote_processor.cpp | 3 ++- nano/node/vote_router.cpp | 3 ++- nano/node/websocket.cpp | 1 + nano/rpc_test/rpc.cpp | 1 + nano/secure/common.hpp | 2 +- nano/slow_test/node.cpp | 1 + nano/slow_test/vote_processor.cpp | 1 + nano/store/component.hpp | 12 +++++++++--- nano/store/db_val.hpp | 1 + nano/test_common/testutil.cpp | 1 + 41 files changed, 83 insertions(+), 16 deletions(-) diff --git a/nano/core_test/active_elections.cpp b/nano/core_test/active_elections.cpp index f592ea133..8840c9dc9 100644 --- a/nano/core_test/active_elections.cpp +++ b/nano/core_test/active_elections.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/nano/core_test/block.cpp b/nano/core_test/block.cpp index 79037a9cd..4da6e787f 100644 --- a/nano/core_test/block.cpp +++ b/nano/core_test/block.cpp @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/nano/core_test/conflicts.cpp b/nano/core_test/conflicts.cpp index 43c193815..f9469f3bf 100644 --- a/nano/core_test/conflicts.cpp +++ b/nano/core_test/conflicts.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include diff --git a/nano/core_test/ledger.cpp b/nano/core_test/ledger.cpp index 0dd6e786d..d43d41269 100644 --- a/nano/core_test/ledger.cpp +++ b/nano/core_test/ledger.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include diff --git a/nano/core_test/memory_pool.cpp b/nano/core_test/memory_pool.cpp index 6d5dd4ae9..087f84894 100644 --- a/nano/core_test/memory_pool.cpp +++ b/nano/core_test/memory_pool.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include diff --git a/nano/core_test/message.cpp b/nano/core_test/message.cpp index e18c09c6c..12ff989af 100644 --- a/nano/core_test/message.cpp +++ b/nano/core_test/message.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include diff --git a/nano/core_test/message_deserializer.cpp b/nano/core_test/message_deserializer.cpp index 44e9fa06d..7d65d6528 100644 --- a/nano/core_test/message_deserializer.cpp +++ b/nano/core_test/message_deserializer.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include diff --git a/nano/core_test/node.cpp b/nano/core_test/node.cpp index e8b836847..87f91c04b 100644 --- a/nano/core_test/node.cpp +++ b/nano/core_test/node.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/nano/core_test/rep_crawler.cpp b/nano/core_test/rep_crawler.cpp index 1d52769df..e9d0ba8d4 100644 --- a/nano/core_test/rep_crawler.cpp +++ b/nano/core_test/rep_crawler.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -327,4 +328,4 @@ TEST (rep_crawler, ignore_rebroadcasted) }; ASSERT_NEVER (1s, tick () || node1.rep_crawler.representative_count () > 0); -} \ No newline at end of file +} diff --git a/nano/core_test/vote_processor.cpp b/nano/core_test/vote_processor.cpp index 3f656794e..8855b17f1 100644 --- a/nano/core_test/vote_processor.cpp +++ b/nano/core_test/vote_processor.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include diff --git a/nano/core_test/voting.cpp b/nano/core_test/voting.cpp index 241cd347b..55d63259f 100644 --- a/nano/core_test/voting.cpp +++ b/nano/core_test/voting.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include diff --git a/nano/lib/blocks.cpp b/nano/lib/blocks.cpp index ab667ee8f..d61233e4a 100644 --- a/nano/lib/blocks.cpp +++ b/nano/lib/blocks.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include diff --git a/nano/nano_node/entry.cpp b/nano/nano_node/entry.cpp index 96d9349f0..5477769e7 100644 --- a/nano/nano_node/entry.cpp +++ b/nano/nano_node/entry.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include diff --git a/nano/node/bandwidth_limiter.hpp b/nano/node/bandwidth_limiter.hpp index 1bd9e5833..4bd19ee7c 100644 --- a/nano/node/bandwidth_limiter.hpp +++ b/nano/node/bandwidth_limiter.hpp @@ -4,6 +4,11 @@ #include #include +namespace nano +{ +class node_config; +} + namespace nano { class bandwidth_limiter_config final @@ -50,4 +55,4 @@ private: nano::rate_limiter limiter_generic; nano::rate_limiter limiter_bootstrap; }; -} \ No newline at end of file +} diff --git a/nano/node/bootstrap/bootstrap.hpp b/nano/node/bootstrap/bootstrap.hpp index b02cd56fd..3d6ec25f1 100644 --- a/nano/node/bootstrap/bootstrap.hpp +++ b/nano/node/bootstrap/bootstrap.hpp @@ -1,5 +1,6 @@ #pragma once +#include #include #include diff --git a/nano/node/bootstrap/bootstrap_attempt.hpp b/nano/node/bootstrap/bootstrap_attempt.hpp index ea64fe9fd..ce6c686ef 100644 --- a/nano/node/bootstrap/bootstrap_attempt.hpp +++ b/nano/node/bootstrap/bootstrap_attempt.hpp @@ -2,6 +2,8 @@ #include +#include + #include #include diff --git a/nano/node/bootstrap_ascending/account_sets.hpp b/nano/node/bootstrap_ascending/account_sets.hpp index d83d3a889..5a77e2eca 100644 --- a/nano/node/bootstrap_ascending/account_sets.hpp +++ b/nano/node/bootstrap_ascending/account_sets.hpp @@ -18,8 +18,12 @@ namespace mi = boost::multi_index; namespace nano { +class account_sets_config; class stats; +} +namespace nano +{ namespace bootstrap_ascending { /** This class tracks accounts various account sets which are shared among the multiple bootstrap threads */ @@ -161,4 +165,4 @@ namespace bootstrap_ascending info_t info () const; }; } -} \ No newline at end of file +} diff --git a/nano/node/confirming_set.hpp b/nano/node/confirming_set.hpp index 644b241c9..39fdec50e 100644 --- a/nano/node/confirming_set.hpp +++ b/nano/node/confirming_set.hpp @@ -20,6 +20,14 @@ namespace mi = boost::multi_index; +namespace nano +{ +class election; +class ledger; +class logger; +class stats; +} + namespace nano { class confirming_set_config final diff --git a/nano/node/election.cpp b/nano/node/election.cpp index 06ea41350..7cd964aae 100644 --- a/nano/node/election.cpp +++ b/nano/node/election.cpp @@ -9,6 +9,7 @@ #include #include #include +#include using namespace std::chrono; diff --git a/nano/node/endpoint.cpp b/nano/node/endpoint.cpp index ccfd7361f..891f88728 100644 --- a/nano/node/endpoint.cpp +++ b/nano/node/endpoint.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include diff --git a/nano/node/ipc/ipc_config.cpp b/nano/node/ipc/ipc_config.cpp index 04d4901b3..323063976 100644 --- a/nano/node/ipc/ipc_config.cpp +++ b/nano/node/ipc/ipc_config.cpp @@ -2,6 +2,12 @@ #include #include +nano::ipc::ipc_config_tcp_socket::ipc_config_tcp_socket (nano::network_constants & network_constants) : + network_constants{ network_constants }, + port{ network_constants.default_ipc_port } +{ +} + nano::error nano::ipc::ipc_config::serialize_toml (nano::tomlconfig & toml) const { nano::tomlconfig tcp_l; diff --git a/nano/node/ipc/ipc_config.hpp b/nano/node/ipc/ipc_config.hpp index 4722177da..4be3fb0df 100644 --- a/nano/node/ipc/ipc_config.hpp +++ b/nano/node/ipc/ipc_config.hpp @@ -7,7 +7,12 @@ namespace nano { +class network_constants; class tomlconfig; +} + +namespace nano +{ namespace ipc { /** Base class for transport configurations */ @@ -46,11 +51,7 @@ namespace ipc class ipc_config_tcp_socket : public ipc_config_transport { public: - ipc_config_tcp_socket (nano::network_constants & network_constants) : - network_constants{ network_constants }, - port{ network_constants.default_ipc_port } - { - } + ipc_config_tcp_socket (nano::network_constants & network_constants); nano::network_constants & network_constants; /** Listening port */ uint16_t port; diff --git a/nano/node/local_block_broadcaster.hpp b/nano/node/local_block_broadcaster.hpp index d2bed33ce..a88ed25f9 100644 --- a/nano/node/local_block_broadcaster.hpp +++ b/nano/node/local_block_broadcaster.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include #include diff --git a/nano/node/message_processor.cpp b/nano/node/message_processor.cpp index 469c55bd1..a172f48df 100644 --- a/nano/node/message_processor.cpp +++ b/nano/node/message_processor.cpp @@ -3,6 +3,7 @@ #include #include #include +#include nano::message_processor::message_processor (message_processor_config const & config_a, nano::node & node_a) : config{ config_a }, @@ -317,4 +318,4 @@ nano::error nano::message_processor_config::deserialize (nano::tomlconfig & toml toml.get ("max_queue", max_queue); return toml.get_error (); -} \ No newline at end of file +} diff --git a/nano/node/messages.cpp b/nano/node/messages.cpp index c10f64199..d665ee3f8 100644 --- a/nano/node/messages.cpp +++ b/nano/node/messages.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include diff --git a/nano/node/messages.hpp b/nano/node/messages.hpp index d21a22868..85fa9d663 100644 --- a/nano/node/messages.hpp +++ b/nano/node/messages.hpp @@ -27,8 +27,10 @@ class block; class jsonconfig; template class uniquer; +class vote; using block_uniquer = uniquer; +using vote_uniquer = uniquer; } namespace nano diff --git a/nano/node/node.cpp b/nano/node/node.cpp index c115ebaa3..0c55b6e11 100644 --- a/nano/node/node.cpp +++ b/nano/node/node.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include diff --git a/nano/node/repcrawler.cpp b/nano/node/repcrawler.cpp index b3dc58c40..b54eae4a5 100644 --- a/nano/node/repcrawler.cpp +++ b/nano/node/repcrawler.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include diff --git a/nano/node/scheduler/bucket.hpp b/nano/node/scheduler/bucket.hpp index 668bbec6d..4994fa8b7 100644 --- a/nano/node/scheduler/bucket.hpp +++ b/nano/node/scheduler/bucket.hpp @@ -1,5 +1,7 @@ #pragma once +#include +#include #include #include diff --git a/nano/node/vote_cache.cpp b/nano/node/vote_cache.cpp index 36f9c4adf..dd190bc45 100644 --- a/nano/node/vote_cache.cpp +++ b/nano/node/vote_cache.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include diff --git a/nano/node/vote_generator.cpp b/nano/node/vote_generator.cpp index e29c88cc9..faf3c273b 100644 --- a/nano/node/vote_generator.cpp +++ b/nano/node/vote_generator.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -326,4 +327,4 @@ nano::container_info nano::vote_generator::container_info () const info.put ("requests", requests.size ()); info.add ("queue", vote_generation_queue.container_info ()); return info; -} \ No newline at end of file +} diff --git a/nano/node/vote_processor.cpp b/nano/node/vote_processor.cpp index 4d0c8ef54..283e78ac9 100644 --- a/nano/node/vote_processor.cpp +++ b/nano/node/vote_processor.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include @@ -376,4 +377,4 @@ nano::error nano::vote_processor_config::deserialize (nano::tomlconfig & toml) toml.get ("batch_size", batch_size); return toml.get_error (); -} \ No newline at end of file +} diff --git a/nano/node/vote_router.cpp b/nano/node/vote_router.cpp index acf3d069c..0f80e4995 100644 --- a/nano/node/vote_router.cpp +++ b/nano/node/vote_router.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include @@ -192,4 +193,4 @@ nano::container_info nano::vote_router::container_info () const nano::container_info info; info.put ("elections", elections); return info; -} \ No newline at end of file +} diff --git a/nano/node/websocket.cpp b/nano/node/websocket.cpp index 653c60f76..32a68d2bb 100644 --- a/nano/node/websocket.cpp +++ b/nano/node/websocket.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include diff --git a/nano/rpc_test/rpc.cpp b/nano/rpc_test/rpc.cpp index fe698dce8..de71a49c8 100644 --- a/nano/rpc_test/rpc.cpp +++ b/nano/rpc_test/rpc.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/nano/secure/common.hpp b/nano/secure/common.hpp index b3711d88e..6606ce5e5 100644 --- a/nano/secure/common.hpp +++ b/nano/secure/common.hpp @@ -8,10 +8,10 @@ #include #include #include +#include #include #include #include -#include #include #include diff --git a/nano/slow_test/node.cpp b/nano/slow_test/node.cpp index d6e181a8b..982c5b873 100644 --- a/nano/slow_test/node.cpp +++ b/nano/slow_test/node.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/nano/slow_test/vote_processor.cpp b/nano/slow_test/vote_processor.cpp index 938aa2566..b3fcffa9f 100644 --- a/nano/slow_test/vote_processor.cpp +++ b/nano/slow_test/vote_processor.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include diff --git a/nano/store/component.hpp b/nano/store/component.hpp index 328ad88e6..a08985039 100644 --- a/nano/store/component.hpp +++ b/nano/store/component.hpp @@ -10,6 +10,7 @@ #include #include +#include #include @@ -25,10 +26,15 @@ namespace store class peer; class pending; class pruned; - class version; + class read_transaction; class rep_weight; + class transaction; + class version; + class write_transaction; } class ledger_cache; +class ledger_constants; +enum class tables; namespace store { @@ -89,8 +95,8 @@ namespace store virtual void rebuild_db (write_transaction const & transaction_a) = 0; /** Not applicable to all sub-classes */ - virtual void serialize_mdb_tracker (boost::property_tree::ptree &, std::chrono::milliseconds, std::chrono::milliseconds){}; - virtual void serialize_memory_stats (boost::property_tree::ptree &) = 0; + virtual void serialize_mdb_tracker (::boost::property_tree::ptree &, std::chrono::milliseconds, std::chrono::milliseconds){}; + virtual void serialize_memory_stats (::boost::property_tree::ptree &) = 0; virtual bool init_error () const = 0; diff --git a/nano/store/db_val.hpp b/nano/store/db_val.hpp index 7cc415a5f..12b81a143 100644 --- a/nano/store/db_val.hpp +++ b/nano/store/db_val.hpp @@ -16,6 +16,7 @@ class account_info_v22; class block; class pending_info; class pending_key; +class vote; } namespace nano::store diff --git a/nano/test_common/testutil.cpp b/nano/test_common/testutil.cpp index f2c3c7712..8218fd22c 100644 --- a/nano/test_common/testutil.cpp +++ b/nano/test_common/testutil.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include