diff --git a/nano/node/active_transactions.cpp b/nano/node/active_transactions.cpp index 4afc45e2a4..f2b9b61eb0 100644 --- a/nano/node/active_transactions.cpp +++ b/nano/node/active_transactions.cpp @@ -190,16 +190,6 @@ void nano::active_transactions::notify_observers (nano::election_status const & void nano::active_transactions::handle_final_votes_confirmation (std::shared_ptr const & block, nano::store::read_transaction const & transaction, nano::election_status_type status) { auto account = block->account (); - - bool is_canary_not_set = !node.ledger.cache.final_votes_confirmation_canary.load (); - bool is_canary_account = account == node.network_params.ledger.final_votes_canary_account; - bool is_height_above_threshold = block->sideband ().height >= node.network_params.ledger.final_votes_canary_height; - - if (is_canary_not_set && is_canary_account && is_height_above_threshold) - { - node.ledger.cache.final_votes_confirmation_canary.store (true); - } - bool cemented_bootstrap_count_reached = node.ledger.cache.cemented_count >= node.ledger.bootstrap_weight_max_blocks; bool was_active = status == nano::election_status_type::active_confirmed_quorum || status == nano::election_status_type::active_confirmation_height; diff --git a/nano/node/election.cpp b/nano/node/election.cpp index e0eebd181f..d179dabdb7 100644 --- a/nano/node/election.cpp +++ b/nano/node/election.cpp @@ -397,11 +397,11 @@ void nano::election::confirm_if_quorum (nano::unique_lock & lock_a) } if (have_quorum (tally_l)) { - if (node.ledger.cache.final_votes_confirmation_canary.load () && !is_quorum.exchange (true) && node.config.enable_voting && node.wallets.reps ().voting > 0) + if (!is_quorum.exchange (true) && node.config.enable_voting && node.wallets.reps ().voting > 0) { node.final_generator.add (root, status.winner->hash ()); } - if (!node.ledger.cache.final_votes_confirmation_canary.load () || final_weight >= node.online_reps.delta ()) + if (final_weight >= node.online_reps.delta ()) { confirm_once (lock_a, nano::election_status_type::active_confirmed_quorum); } diff --git a/nano/secure/common.cpp b/nano/secure/common.cpp index d1943ba2cb..385205332f 100644 --- a/nano/secure/common.cpp +++ b/nano/secure/common.cpp @@ -70,10 +70,6 @@ std::shared_ptr parse_block_from_genesis_data (std::string const & boost::property_tree::read_json (istream, tree); return nano::deserialize_block_json (tree); } - -char const * beta_canary_public_key_data = "259a438a8f9f9226130c84d902c237af3e57c0981c7d709c288046b110d8c8ac"; // nano_33nefchqmo4ifr3bpfw4ecwjcg87semfhit8prwi7zzd8shjr8c9qdxeqmnx -char const * live_canary_public_key_data = "7CBAF192A3763DAEC9F9BAC1B2CDF665D8369F8400B4BC5AB4BA31C00BAA4404"; // nano_1z7ty8bc8xjxou6zmgp3pd8zesgr8thra17nqjfdbgjjr17tnj16fjntfqfn -std::string const test_canary_public_key_data = nano::get_env_or_default ("NANO_TEST_CANARY_PUB", "3BAD2C554ACE05F5E528FBBCE79D51E552C55FA765CCFD89B289C4835DE5F04A"); // nano_1gxf7jcnomi7yqkkjyxwwygo5sckrohtgsgezp6u74g6ifgydw4cajwbk8bf } nano::keypair nano::dev::genesis_key{ dev_private_key_data }; @@ -111,21 +107,7 @@ nano::ledger_constants::ledger_constants (nano::work_thresholds & work, nano::ne : network_a == nano::networks::nano_test_network ? nano_test_genesis : nano_live_genesis), genesis_amount{ std::numeric_limits::max () }, - burn_account{}, - nano_dev_final_votes_canary_account (dev_public_key_data), - nano_beta_final_votes_canary_account (beta_canary_public_key_data), - nano_live_final_votes_canary_account (live_canary_public_key_data), - nano_test_final_votes_canary_account (test_canary_public_key_data), - final_votes_canary_account (network_a == nano::networks::nano_dev_network ? nano_dev_final_votes_canary_account : network_a == nano::networks::nano_beta_network ? nano_beta_final_votes_canary_account - : network_a == nano::networks::nano_test_network ? nano_test_final_votes_canary_account - : nano_live_final_votes_canary_account), - nano_dev_final_votes_canary_height (1), - nano_beta_final_votes_canary_height (1), - nano_live_final_votes_canary_height (1), - nano_test_final_votes_canary_height (1), - final_votes_canary_height (network_a == nano::networks::nano_dev_network ? nano_dev_final_votes_canary_height : network_a == nano::networks::nano_beta_network ? nano_beta_final_votes_canary_height - : network_a == nano::networks::nano_test_network ? nano_test_final_votes_canary_height - : nano_live_final_votes_canary_height) + burn_account{} { nano_beta_genesis->sideband_set (nano::block_sideband (nano_beta_genesis->account_field ().value (), 0, std::numeric_limits::max (), 1, nano::seconds_since_epoch (), nano::epoch::epoch_0, false, false, false, nano::epoch::epoch_0)); nano_dev_genesis->sideband_set (nano::block_sideband (nano_dev_genesis->account_field ().value (), 0, std::numeric_limits::max (), 1, nano::seconds_since_epoch (), nano::epoch::epoch_0, false, false, false, nano::epoch::epoch_0)); diff --git a/nano/secure/common.hpp b/nano/secure/common.hpp index e1d43fec89..0928289fd0 100644 --- a/nano/secure/common.hpp +++ b/nano/secure/common.hpp @@ -249,16 +249,6 @@ class ledger_constants std::shared_ptr genesis; nano::uint128_t genesis_amount; nano::account burn_account; - nano::account nano_dev_final_votes_canary_account; - nano::account nano_beta_final_votes_canary_account; - nano::account nano_live_final_votes_canary_account; - nano::account nano_test_final_votes_canary_account; - nano::account final_votes_canary_account; - uint64_t nano_dev_final_votes_canary_height; - uint64_t nano_beta_final_votes_canary_height; - uint64_t nano_live_final_votes_canary_height; - uint64_t nano_test_final_votes_canary_height; - uint64_t final_votes_canary_height; nano::epochs epochs; }; diff --git a/nano/secure/ledger.cpp b/nano/secure/ledger.cpp index 55570fcf81..15fb1b81b3 100644 --- a/nano/secure/ledger.cpp +++ b/nano/secure/ledger.cpp @@ -796,13 +796,6 @@ void nano::ledger::initialize (nano::generate_cache_flags const & generate_cache auto transaction (store.tx_begin_read ()); cache.pruned_count = store.pruned.count (transaction); - - // Final votes requirement for confirmation canary block - nano::confirmation_height_info confirmation_height_info; - if (!store.confirmation_height.get (transaction, constants.final_votes_canary_account, confirmation_height_info)) - { - cache.final_votes_confirmation_canary = (confirmation_height_info.height >= constants.final_votes_canary_height); - } } // Balance for account containing hash diff --git a/nano/secure/ledger_cache.hpp b/nano/secure/ledger_cache.hpp index 726a1e1119..4cc0670baf 100644 --- a/nano/secure/ledger_cache.hpp +++ b/nano/secure/ledger_cache.hpp @@ -15,6 +15,5 @@ class ledger_cache std::atomic block_count{ 0 }; std::atomic pruned_count{ 0 }; std::atomic account_count{ 0 }; - std::atomic final_votes_confirmation_canary{ false }; }; } diff --git a/nano/store/component.cpp b/nano/store/component.cpp index 9e4b7e9dbc..911b0ac855 100644 --- a/nano/store/component.cpp +++ b/nano/store/component.cpp @@ -36,7 +36,6 @@ void nano::store::component::initialize (store::write_transaction const & transa ++ledger_cache_a.block_count; confirmation_height.put (transaction_a, constants.genesis->account (), nano::confirmation_height_info{ 1, constants.genesis->hash () }); ++ledger_cache_a.cemented_count; - ledger_cache_a.final_votes_confirmation_canary = (constants.final_votes_canary_account == constants.genesis->account () && 1 >= constants.final_votes_canary_height); account.put (transaction_a, constants.genesis->account (), { hash_l, constants.genesis->account (), constants.genesis->hash (), std::numeric_limits::max (), nano::seconds_since_epoch (), 1, nano::epoch::epoch_0 }); ++ledger_cache_a.account_count; ledger_cache_a.rep_weights.representation_put (constants.genesis->account (), std::numeric_limits::max ());