From bb457b7d61cf290dd20b4b5d3a1e2333508f425d Mon Sep 17 00:00:00 2001 From: Lin Huang Date: Tue, 16 Jan 2024 15:13:25 -0500 Subject: [PATCH] change finalizer_keys_on_the_node to node_finalizer_keys --- libraries/chain/controller.cpp | 14 +++++++------- libraries/chain/include/eosio/chain/controller.hpp | 2 +- plugins/producer_plugin/producer_plugin.cpp | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libraries/chain/controller.cpp b/libraries/chain/controller.cpp index 5eb8ec899d..7f604e8726 100644 --- a/libraries/chain/controller.cpp +++ b/libraries/chain/controller.cpp @@ -884,7 +884,7 @@ struct controller_impl { named_thread_pool thread_pool; deep_mind_handler* deep_mind_logger = nullptr; bool okay_to_print_integrity_hash_on_stop = false; - bls_key_map_t finalizer_keys_on_the_node; + bls_key_map_t node_finalizer_keys; thread_local static platform_timer timer; // a copy for main thread and each read-only thread #if defined(EOSIO_EOS_VM_RUNTIME_ENABLED) || defined(EOSIO_EOS_VM_JIT_RUNTIME_ENABLED) @@ -2833,8 +2833,8 @@ struct controller_impl { // A vote is created and signed by each finalizer configured on the node that // in active finalizer policy for (const auto& f: bhs.finalizer_policy->finalizers) { - auto it = finalizer_keys_on_the_node.find( f.public_key ); - if( it != finalizer_keys_on_the_node.end() ) { + auto it = node_finalizer_keys.find( f.public_key ); + if( it != node_finalizer_keys.end() ) { const auto& private_key = it->second; const auto& digest = bhs.compute_finalizer_digest(); @@ -3431,9 +3431,9 @@ struct controller_impl { wasmif.code_block_num_last_used(code_hash, vm_type, vm_version, block_num); } - void set_finalizer_keys_on_the_node(const bls_pub_priv_key_map_t& finalizer_keys) { + void set_node_finalizer_keys(const bls_pub_priv_key_map_t& finalizer_keys) { for (const auto& k : finalizer_keys) { - finalizer_keys_on_the_node[bls_public_key{k.first}] = bls_private_key{k.second}; + node_finalizer_keys[bls_public_key{k.first}] = bls_private_key{k.second}; } } @@ -4491,8 +4491,8 @@ void controller::code_block_num_last_used(const digest_type& code_hash, uint8_t return my->code_block_num_last_used(code_hash, vm_type, vm_version, block_num); } -void controller::set_finalizer_keys_on_the_node(const bls_pub_priv_key_map_t& finalizer_keys) { - my->set_finalizer_keys_on_the_node(finalizer_keys); +void controller::set_node_finalizer_keys(const bls_pub_priv_key_map_t& finalizer_keys) { + my->set_node_finalizer_keys(finalizer_keys); } /// Protocol feature activation handlers: diff --git a/libraries/chain/include/eosio/chain/controller.hpp b/libraries/chain/include/eosio/chain/controller.hpp index 1d04570be0..3793c72158 100644 --- a/libraries/chain/include/eosio/chain/controller.hpp +++ b/libraries/chain/include/eosio/chain/controller.hpp @@ -384,7 +384,7 @@ namespace eosio::chain { void set_to_read_window(); bool is_write_window() const; void code_block_num_last_used(const digest_type& code_hash, uint8_t vm_type, uint8_t vm_version, uint32_t block_num); - void set_finalizer_keys_on_the_node(const bls_pub_priv_key_map_t& finalizer_keys); + void set_node_finalizer_keys(const bls_pub_priv_key_map_t& finalizer_keys); private: friend class apply_context; diff --git a/plugins/producer_plugin/producer_plugin.cpp b/plugins/producer_plugin/producer_plugin.cpp index a6b36bfafa..6049dda887 100644 --- a/plugins/producer_plugin/producer_plugin.cpp +++ b/plugins/producer_plugin/producer_plugin.cpp @@ -492,7 +492,7 @@ class producer_plugin_impl : public std::enable_shared_from_this _signature_providers; - chain::bls_pub_priv_key_map_t _finalizer_keys; // public, private + chain::bls_pub_priv_key_map_t _finalizer_keys; // public, private std::set _producers; boost::asio::deadline_timer _timer; block_timing_util::producer_watermarks _producer_watermarks; @@ -1340,7 +1340,7 @@ void producer_plugin_impl::plugin_startup() { EOS_ASSERT(_producers.empty() || chain_plug->accept_transactions(), plugin_config_exception, "node cannot have any producer-name configured because no block production is possible with no [api|p2p]-accepted-transactions"); - chain.set_finalizer_keys_on_the_node(_finalizer_keys); + chain.set_node_finalizer_keys(_finalizer_keys); #warning TODO remove create_pacemaker chain.create_pacemaker(_producers, std::move(_finalizer_keys), hotstuff_logger);