Skip to content

Commit

Permalink
change finalizer_keys_on_the_node to node_finalizer_keys
Browse files Browse the repository at this point in the history
  • Loading branch information
linh2931 committed Jan 16, 2024
1 parent 8d9e230 commit bb457b7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ struct controller_impl {
named_thread_pool<chain> 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)
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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};
}
}

Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/include/eosio/chain/controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions plugins/producer_plugin/producer_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ class producer_plugin_impl : public std::enable_shared_from_this<producer_plugin

using signature_provider_type = signature_provider_plugin::signature_provider_type;
std::map<chain::public_key_type, signature_provider_type> _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<chain::account_name> _producers;
boost::asio::deadline_timer _timer;
block_timing_util::producer_watermarks _producer_watermarks;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit bb457b7

Please sign in to comment.