From 01f462d0348d38ed8f1634404983dfc4b435f292 Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Wed, 6 Sep 2023 15:20:58 -0500 Subject: [PATCH] GH-1523 Use alias for bls_key_map_t --- libraries/chain/include/eosio/chain/hotstuff.hpp | 1 + libraries/hotstuff/chain_pacemaker.cpp | 2 +- libraries/hotstuff/include/eosio/hotstuff/chain_pacemaker.hpp | 2 +- libraries/hotstuff/include/eosio/hotstuff/qc_chain.hpp | 4 ++-- libraries/hotstuff/qc_chain.cpp | 2 +- plugins/chain_plugin/chain_plugin.cpp | 2 +- .../chain_plugin/include/eosio/chain_plugin/chain_plugin.hpp | 2 +- plugins/producer_plugin/producer_plugin.cpp | 2 +- .../signature_provider_plugin/signature_provider_plugin.cpp | 2 +- 9 files changed, 10 insertions(+), 9 deletions(-) diff --git a/libraries/chain/include/eosio/chain/hotstuff.hpp b/libraries/chain/include/eosio/chain/hotstuff.hpp index 2db473827d..b580387d51 100644 --- a/libraries/chain/include/eosio/chain/hotstuff.hpp +++ b/libraries/chain/include/eosio/chain/hotstuff.hpp @@ -11,6 +11,7 @@ namespace eosio::chain { using hs_bitset = boost::dynamic_bitset; + using bls_key_map_t = std::map; inline uint64_t compute_height(uint32_t block_height, uint32_t phase_counter) { return (uint64_t{block_height} << 32) | phase_counter; diff --git a/libraries/hotstuff/chain_pacemaker.cpp b/libraries/hotstuff/chain_pacemaker.cpp index b0fa8f6eba..2940f08cc8 100644 --- a/libraries/hotstuff/chain_pacemaker.cpp +++ b/libraries/hotstuff/chain_pacemaker.cpp @@ -103,7 +103,7 @@ namespace eosio { namespace hotstuff { chain_pacemaker::chain_pacemaker(controller* chain, std::set my_producers, - std::map finalizer_keys, + bls_key_map_t finalizer_keys, fc::logger& logger) : _chain(chain), _qc_chain("default"_n, this, std::move(my_producers), std::move(finalizer_keys), logger), diff --git a/libraries/hotstuff/include/eosio/hotstuff/chain_pacemaker.hpp b/libraries/hotstuff/include/eosio/hotstuff/chain_pacemaker.hpp index fcc8ea51c1..c2c2331278 100644 --- a/libraries/hotstuff/include/eosio/hotstuff/chain_pacemaker.hpp +++ b/libraries/hotstuff/include/eosio/hotstuff/chain_pacemaker.hpp @@ -22,7 +22,7 @@ namespace eosio::hotstuff { chain_pacemaker(controller* chain, std::set my_producers, - std::map finalizer_keys, + chain::bls_key_map_t finalizer_keys, fc::logger& logger); void register_bcast_function(std::function broadcast_hs_message); diff --git a/libraries/hotstuff/include/eosio/hotstuff/qc_chain.hpp b/libraries/hotstuff/include/eosio/hotstuff/qc_chain.hpp index 32a8a9be82..e696280009 100644 --- a/libraries/hotstuff/include/eosio/hotstuff/qc_chain.hpp +++ b/libraries/hotstuff/include/eosio/hotstuff/qc_chain.hpp @@ -97,7 +97,7 @@ namespace eosio::hotstuff { qc_chain(name id, base_pacemaker* pacemaker, std::set my_producers, - std::map finalizer_keys, + chain::bls_key_map_t finalizer_keys, fc::logger& logger); uint64_t get_state_version() const { return _state_version; } // calling this w/ thread sync is optional @@ -198,7 +198,7 @@ namespace eosio::hotstuff { eosio::chain::extended_schedule _schedule; base_pacemaker* _pacemaker = nullptr; std::set _my_producers; - std::map _my_finalizer_keys; + chain::bls_key_map_t _my_finalizer_keys; name _id; mutable std::atomic _state_version = 1; diff --git a/libraries/hotstuff/qc_chain.cpp b/libraries/hotstuff/qc_chain.cpp index 3e5a45dfc5..e62381fb0e 100644 --- a/libraries/hotstuff/qc_chain.cpp +++ b/libraries/hotstuff/qc_chain.cpp @@ -237,7 +237,7 @@ namespace eosio::hotstuff { qc_chain::qc_chain(name id, base_pacemaker* pacemaker, std::set my_producers, - std::map finalizer_keys, + bls_key_map_t finalizer_keys, fc::logger& logger) : _pacemaker(pacemaker), _my_producers(std::move(my_producers)), diff --git a/plugins/chain_plugin/chain_plugin.cpp b/plugins/chain_plugin/chain_plugin.cpp index 4b4ee5ac10..c64962b468 100644 --- a/plugins/chain_plugin/chain_plugin.cpp +++ b/plugins/chain_plugin/chain_plugin.cpp @@ -1117,7 +1117,7 @@ void chain_plugin_impl::plugin_initialize(const variables_map& options) { } FC_LOG_AND_RETHROW() } -void chain_plugin::create_pacemaker(std::set my_producers, std::map finalizer_keys) { +void chain_plugin::create_pacemaker(std::set my_producers, chain::bls_key_map_t finalizer_keys) { EOS_ASSERT( !my->_chain_pacemaker, plugin_config_exception, "duplicate chain_pacemaker initialization" ); my->_chain_pacemaker.emplace(&chain(), std::move(my_producers), std::move(finalizer_keys), hotstuff_logger); } diff --git a/plugins/chain_plugin/include/eosio/chain_plugin/chain_plugin.hpp b/plugins/chain_plugin/include/eosio/chain_plugin/chain_plugin.hpp index 031255ce3d..e4d96b2a4a 100644 --- a/plugins/chain_plugin/include/eosio/chain_plugin/chain_plugin.hpp +++ b/plugins/chain_plugin/include/eosio/chain_plugin/chain_plugin.hpp @@ -1031,7 +1031,7 @@ class chain_plugin : public plugin { // Only call this after plugin_initialize()! const controller& chain() const; - void create_pacemaker(std::set my_producers, std::map finalizer_keys); + void create_pacemaker(std::set my_producers, chain::bls_key_map_t finalizer_keys); void register_pacemaker_bcast_function(std::function bcast_hs_message); void notify_hs_message( const chain::hs_message& msg ); void notify_hs_block_produced(); diff --git a/plugins/producer_plugin/producer_plugin.cpp b/plugins/producer_plugin/producer_plugin.cpp index 45cd3a0666..e1c13ea350 100644 --- a/plugins/producer_plugin/producer_plugin.cpp +++ b/plugins/producer_plugin/producer_plugin.cpp @@ -519,7 +519,7 @@ class producer_plugin_impl : public std::enable_shared_from_this _signature_providers; - std::map _finalizer_keys; + bls_key_map_t _finalizer_keys; std::set _producers; boost::asio::deadline_timer _timer; block_timing_util::producer_watermarks _producer_watermarks; diff --git a/plugins/signature_provider_plugin/signature_provider_plugin.cpp b/plugins/signature_provider_plugin/signature_provider_plugin.cpp index a9bf9277be..7cd9eec57d 100644 --- a/plugins/signature_provider_plugin/signature_provider_plugin.cpp +++ b/plugins/signature_provider_plugin/signature_provider_plugin.cpp @@ -84,7 +84,7 @@ void signature_provider_plugin::set_program_options(options_description&, option const char* const signature_provider_plugin::signature_provider_help_text() const { return "Key=Value pairs in the form =\n" "Where:\n" - " \tis a string form of a vaild Antelope public key, including BLS finalizer key\n" + " \tis a string form of a valid Antelope public key, including BLS finalizer key\n" " \tis a string in the form :\n" " \tis KEY, KEOSD, or SE\n" " KEY: \tis a string form of a valid Antelope private key which maps to the provided public key\n"