From cd6d5a2b4ac7ef8d211acb45889d57c0b1dd745b Mon Sep 17 00:00:00 2001 From: victor-tucci Date: Tue, 12 Dec 2023 14:09:12 +0530 Subject: [PATCH 1/3] Verify presence of value for pubkey_ed25519 in handle_pin() --- src/rpc/core_rpc_server.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index fb8aaef23a..d51182308a 100755 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -3259,8 +3259,8 @@ namespace cryptonote { namespace rpc { if (cur_version < required) { res.status = fmt::format("Outdated {}. Current: {}.{}.{}, Required: {}.{}.{}",name, cur_version[0], cur_version[1], cur_version[2], required[0], required[1], required[2]); MERROR(res.status); - } else if (!pubkey_ed25519.empty() // TODO: once belnet & ss are always sending this we can remove this empty bypass - && pubkey_ed25519 != our_pubkey_ed25519) { + } else if (!pubkey_ed25519.empty() && !(pubkey_ed25519.find_first_not_of('0') == std::string_view::npos) // TODO: once belnet & ss are always sending this we can remove this empty bypass + && (pubkey_ed25519 != our_pubkey_ed25519)) { res.status = fmt::format("Invalid {} pubkey: expected {}, received {}", name, our_pubkey_ed25519, pubkey_ed25519); MERROR(res.status); } else { From d84e3d8a3aad1c11ac6b947c81387f4d668930d4 Mon Sep 17 00:00:00 2001 From: victor-tucci Date: Wed, 13 Dec 2023 11:21:17 +0530 Subject: [PATCH 2/3] Set minimum SS version and Belnet version for ping --- src/cryptonote_core/master_node_rules.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cryptonote_core/master_node_rules.h b/src/cryptonote_core/master_node_rules.h index 81a47d910e..bd5a09f9a1 100755 --- a/src/cryptonote_core/master_node_rules.h +++ b/src/cryptonote_core/master_node_rules.h @@ -221,8 +221,8 @@ namespace master_nodes { // blocks out of sync and sending something that it thinks is legit. constexpr uint64_t VOTE_OR_TX_VERIFY_HEIGHT_BUFFER = 5; - constexpr std::array MIN_STORAGE_SERVER_VERSION{{2, 0, 7}}; - constexpr std::array MIN_BELNET_VERSION{{0, 8, 0}}; + constexpr std::array MIN_STORAGE_SERVER_VERSION{{2, 3, 0}}; + constexpr std::array MIN_BELNET_VERSION{{0, 9, 7}}; // The minimum accepted version number, broadcasted by Master Nodes via uptime proofs for each hardfork struct proof_version From a7e89a92a2baf12c3d3e4d823c64332b55490844 Mon Sep 17 00:00:00 2001 From: victor-tucci Date: Wed, 13 Dec 2023 13:18:57 +0530 Subject: [PATCH 3/3] Update MIN_TIMESTAMP_VERSION for uptime-proof --- src/cryptonote_core/cryptonote_core.cpp | 2 +- src/cryptonote_core/master_node_quorum_cop.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index c6dc8a071a..03769b6923 100755 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -1658,7 +1658,7 @@ namespace cryptonote crypto::public_key pubkey = m_master_node_list.get_random_pubkey(); crypto::x25519_public_key x_pkey{0}; - constexpr std::array MIN_TIMESTAMP_VERSION{9,1,0}; + constexpr std::array MIN_TIMESTAMP_VERSION{5,0,0}; std::array proofversion; m_master_node_list.access_proof(pubkey, [&](auto &proof) { x_pkey = proof.pubkey_x25519; diff --git a/src/cryptonote_core/master_node_quorum_cop.cpp b/src/cryptonote_core/master_node_quorum_cop.cpp index dd1755991e..9930ae5a04 100755 --- a/src/cryptonote_core/master_node_quorum_cop.cpp +++ b/src/cryptonote_core/master_node_quorum_cop.cpp @@ -90,7 +90,7 @@ namespace master_nodes master_nodes::participation_history timestamp_participation{}; master_nodes::participation_history timesync_status{}; - constexpr std::array MIN_TIMESTAMP_VERSION{9,1,0}; + constexpr std::array MIN_TIMESTAMP_VERSION{5,0,0}; const auto unreachable_threshold = netconf.UPTIME_PROOF_VALIDITY - netconf.UPTIME_PROOF_FREQUENCY;