From d75a672a47578d2740a05b77fa721e71275e4f23 Mon Sep 17 00:00:00 2001 From: victor-tucci Date: Mon, 15 Nov 2021 16:10:18 +0530 Subject: [PATCH 1/3] rebranding belnet --- .drone.jsonnet | 10 +- .vscode/settings.json | 3 +- contrib/lns-lookup-example.py | 8 +- src/beldex_economy.h | 22 +- src/blockchain_db/lmdb/db_lmdb.cpp | 8 +- src/blockchain_utilities/mn_key_tool.cpp | 6 +- src/cryptonote_basic/tx_extra.cpp | 6 +- src/cryptonote_basic/tx_extra.h | 6 +- src/cryptonote_config.h | 2 +- src/cryptonote_core/beldex_name_system.cpp | 70 +++--- src/cryptonote_core/beldex_name_system.h | 32 +-- src/cryptonote_core/cryptonote_core.cpp | 22 +- src/cryptonote_core/cryptonote_core.h | 8 +- src/cryptonote_core/master_node_list.cpp | 14 +- src/cryptonote_core/master_node_list.h | 16 +- .../master_node_quorum_cop.cpp | 16 +- src/cryptonote_core/master_node_quorum_cop.h | 4 +- src/cryptonote_core/master_node_rules.h | 4 +- src/cryptonote_core/uptime_proof.cpp | 18 +- src/cryptonote_core/uptime_proof.h | 4 +- src/daemon/rpc_command_executor.cpp | 24 +-- src/debug_utilities/cn_deserialize.cpp | 8 +- src/p2p/net_node.inl | 4 +- src/rpc/core_rpc_server.cpp | 40 ++-- src/rpc/core_rpc_server.h | 2 +- src/rpc/core_rpc_server_commands_defs.cpp | 24 +-- src/rpc/core_rpc_server_commands_defs.h | 52 ++--- src/simplewallet/simplewallet.cpp | 38 ++-- src/wallet/wallet2.h | 2 +- src/wallet/wallet_rpc_server.cpp | 4 +- src/wallet/wallet_rpc_server_commands_defs.h | 32 +-- tests/core_tests/beldex_tests.cpp | 202 +++++++++--------- tests/network_tests/daemons.py | 8 +- tests/network_tests/master_node_network.py | 2 +- tests/unit_tests/beldex_name_system.cpp | 10 +- tests/unit_tests/dns_resolver.cpp | 2 +- utils/beldex-launcher-to-debs.sh | 76 +++---- utils/local-devnet/daemons.py | 8 +- utils/local-devnet/master_node_network.py | 2 +- 39 files changed, 410 insertions(+), 409 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 54ead3943e..28e085059f 100755 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -53,7 +53,7 @@ local debian_pipeline(name, image, 'mkdir build', 'cd build', 'cmake .. -G Ninja -DCMAKE_CXX_FLAGS=-fdiagnostics-color=always -DCMAKE_BUILD_TYPE='+build_type+' ' + - '-DLOCAL_MIRROR=https://builds.beldexnet.dev/deps -DUSE_LTO=' + (if lto then 'ON ' else 'OFF ') + + '-DLOCAL_MIRROR=https://builds.belnet.dev/deps -DUSE_LTO=' + (if lto then 'ON ' else 'OFF ') + (if werror then '-DWARNINGS_AS_ERRORS=ON ' else '') + (if build_tests || run_tests then '-DBUILD_TESTS=ON ' else '') + cmake_extra @@ -105,7 +105,7 @@ local mac_builder(name, 'mkdir build', 'cd build', 'cmake .. -G Ninja -DCMAKE_CXX_FLAGS=-fcolor-diagnostics -DCMAKE_BUILD_TYPE='+build_type+' ' + - '-DLOCAL_MIRROR=https://builds.beldexnet.dev/deps -DUSE_LTO=' + (if lto then 'ON ' else 'OFF ') + + '-DLOCAL_MIRROR=https://builds.belnet.dev/deps -DUSE_LTO=' + (if lto then 'ON ' else 'OFF ') + (if werror then '-DWARNINGS_AS_ERRORS=ON ' else '') + (if build_tests || run_tests then '-DBUILD_TESTS=ON ' else '') + cmake_extra, @@ -138,7 +138,7 @@ local android_build_steps(android_abi, android_platform=21, jobs=6, cmake_extra= '-DCMAKE_TOOLCHAIN_FILE=/usr/lib/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake ' + '-DANDROID_PLATFORM=' + android_platform + ' -DANDROID_ABI=' + android_abi + ' ' + '-DMONERO_SLOW_HASH=ON ' + - '-DLOCAL_MIRROR=https://builds.beldexnet.dev/deps ' + + '-DLOCAL_MIRROR=https://builds.belnet.dev/deps ' + '-DBUILD_STATIC_DEPS=ON -DSTATIC=ON -G Ninja ' + cmake_extra, 'ninja -j' + jobs + ' -v wallet_merged', 'cd ..', @@ -204,13 +204,13 @@ local gui_wallet_step_darwin = { debian_pipeline("Debian (ARM64)", "debian:sid", arch="arm64", build_tests=false), debian_pipeline("Debian buster (armhf)", "arm32v7/debian:buster", arch="arm64", build_tests=false, cmake_extra='-DDOWNLOAD_SODIUM=ON -DARCH_ID=armhf'), - // Static build (on bionic) which gets uploaded to builds.beldexnet.dev: + // Static build (on bionic) which gets uploaded to builds.belnet.dev: debian_pipeline("Static (bionic amd64)", "ubuntu:bionic", deps='g++-8 '+static_build_deps, cmake_extra='-DBUILD_STATIC_DEPS=ON -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8 -DARCH=x86-64', build_tests=false, lto=true, extra_cmds=static_check_and_upload, extra_steps=[gui_wallet_step('ubuntu:bionic')]), - // Static mingw build (on focal) which gets uploaded to builds.beldexnet.dev: + // Static mingw build (on focal) which gets uploaded to builds.belnet.dev: debian_pipeline("Static (win64)", "ubuntu:focal", deps='g++ g++-mingw-w64-x86-64 '+static_build_deps, cmake_extra='-DCMAKE_TOOLCHAIN_FILE=../cmake/64-bit-toolchain.cmake -DBUILD_STATIC_DEPS=ON -DARCH=x86-64', build_tests=false, lto=false, test_beldexd=false, extra_cmds=[ diff --git a/.vscode/settings.json b/.vscode/settings.json index 344b9ab9d3..e706357dec 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -71,6 +71,7 @@ "streambuf": "cpp", "thread": "cpp", "typeindex": "cpp", - "typeinfo": "cpp" + "typeinfo": "cpp", + "valarray": "cpp" } } \ No newline at end of file diff --git a/contrib/lns-lookup-example.py b/contrib/lns-lookup-example.py index 8b7d57fa8e..7b145d0170 100755 --- a/contrib/lns-lookup-example.py +++ b/contrib/lns-lookup-example.py @@ -9,7 +9,7 @@ import sys name = "Jason.beldex" -type = 2 # 2 == beldexnet, 0 == session +type = 2 # 2 == belnet, 0 == session # Calculate the blake2b hash of the lower-case full name (including the .beldex): name_hash = nacl.hash.blake2b(name.lower().encode(), encoder=nacl.encoding.RawEncoder) @@ -31,7 +31,7 @@ else: raise RuntimeError("BNS request failed: didn't get any result") -# For beldexnet addresses and HF16+ session addresses we'll always have an encrypted value and an +# For belnet addresses and HF16+ session addresses we'll always have an encrypted value and an # encryption nonce. (For HF15 Session addresses the nonce can be missing, in which case the # encryption involves a much more expensive argon2-based calculation; most external code isn't # expected to support them and existing registration owners should submit an update after HF16 to @@ -51,8 +51,8 @@ decrypt_key ) -# val will currently be the raw beldexnet ed25519 pubkey (32 bytes). We can convert it to the more -# common beldexnet address (which is the same value but encoded in z-base-32) and convert the bytes to +# val will currently be the raw belnet ed25519 pubkey (32 bytes). We can convert it to the more +# common belnet address (which is the same value but encoded in z-base-32) and convert the bytes to # a string: val = b32encode(val).decode() diff --git a/src/beldex_economy.h b/src/beldex_economy.h index b7a0afca1e..75edc22070 100755 --- a/src/beldex_economy.h +++ b/src/beldex_economy.h @@ -56,17 +56,17 @@ enum struct mapping_type : uint16_t { session = 0, wallet = 1, - beldexnet = 2, // the type value stored in the database; counts as 1-year when used in a buy tx. - beldexnet_2years, - beldexnet_5years, - beldexnet_10years, + belnet = 2, // the type value stored in the database; counts as 1-year when used in a buy tx. + belnet_2years, + belnet_5years, + belnet_10years, _count, update_record_internal, }; -constexpr bool is_beldexnet_type(mapping_type t) { return t >= mapping_type::beldexnet && t <= mapping_type::beldexnet_10years; } +constexpr bool is_belnet_type(mapping_type t) { return t >= mapping_type::belnet && t <= mapping_type::belnet_10years; } -// How many days we add per "year" of BNS beldexnet registration. We slightly extend this to the 368 +// How many days we add per "year" of BNS belnet registration. We slightly extend this to the 368 // days per registration "year" to allow for some blockchain time drift + leap years. constexpr uint64_t REGISTRATION_YEAR_DAYS = 368; @@ -74,7 +74,7 @@ constexpr uint64_t burn_needed(uint8_t hf_version, mapping_type type) { uint64_t result = 0; - // The base amount for session/wallet/beldexnet-1year: + // The base amount for session/wallet/belnet-1year: const uint64_t basic_fee = ( hf_version >= 16 ? 15*COIN : // cryptonote::network_version_16_POS -- but don't want to add cryptonote_config.h include 20*COIN // cryptonote::network_version_15_bns @@ -85,16 +85,16 @@ constexpr uint64_t burn_needed(uint8_t hf_version, mapping_type type) result = 0; break; - case mapping_type::beldexnet: /* FALLTHRU */ + case mapping_type::belnet: /* FALLTHRU */ case mapping_type::session: /* FALLTHRU */ case mapping_type::wallet: /* FALLTHRU */ default: result = basic_fee; break; - case mapping_type::beldexnet_2years: result = 2 * basic_fee; break; - case mapping_type::beldexnet_5years: result = 4 * basic_fee; break; - case mapping_type::beldexnet_10years: result = 6 * basic_fee; break; + case mapping_type::belnet_2years: result = 2 * basic_fee; break; + case mapping_type::belnet_5years: result = 4 * basic_fee; break; + case mapping_type::belnet_10years: result = 6 * basic_fee; break; } return result; } diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index 45d453a5aa..583a3bb736 100755 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -6245,7 +6245,7 @@ struct master_node_proof_serialized_old info.proof->qnet_port = little_to_native(quorumnet_port); info.proof->version = little_to_native_container(version); info.proof->storage_server_version = {0, 0, 0}; - info.proof->beldexnet_version = {0, 0, 0}; + info.proof->belnet_version = {0, 0, 0}; info.update_pubkey(pubkey_ed25519); } @@ -6271,17 +6271,17 @@ struct master_node_proof_serialized : master_node_proof_serialized_old { master_node_proof_serialized(const master_nodes::proof_info &info) : master_node_proof_serialized_old{info}, storage_server_version{native_to_little_container(info.proof->storage_server_version)}, - beldexnet_version{native_to_little_container(info.proof->beldexnet_version)} + belnet_version{native_to_little_container(info.proof->belnet_version)} {} std::array storage_server_version; - std::array beldexnet_version; + std::array belnet_version; char _padding[4]; void update(master_nodes::proof_info& info) const { if (!info.proof) info.proof = std::unique_ptr(new uptime_proof::Proof()); master_node_proof_serialized_old::update(info); info.proof->storage_server_version = little_to_native_container(storage_server_version); - info.proof->beldexnet_version = little_to_native_container(beldexnet_version); + info.proof->belnet_version = little_to_native_container(belnet_version); } operator master_nodes::proof_info() const diff --git a/src/blockchain_utilities/mn_key_tool.cpp b/src/blockchain_utilities/mn_key_tool.cpp index 7fcb9592ca..cbd9860a72 100755 --- a/src/blockchain_utilities/mn_key_tool.cpp +++ b/src/blockchain_utilities/mn_key_tool.cpp @@ -158,7 +158,7 @@ int generate(bool ed25519, std::list args) { std::cout << "Public key: " << oxenmq::to_hex(pubkey.begin(), pubkey.end()) << "\nX25519 pubkey: " << oxenmq::to_hex(x_pubkey.begin(), x_pubkey.end()) << - "\nBeldexnet address: " << oxenmq::to_base32z(pubkey.begin(), pubkey.end()) << ".mnode\n"; + "\nBelnet address: " << oxenmq::to_base32z(pubkey.begin(), pubkey.end()) << ".mnode\n"; } else { std::cout << "Public key: " << oxenmq::to_hex(pubkey.begin(), pubkey.end()) << "\n"; } @@ -243,7 +243,7 @@ int show(std::list args) { "\nSecret key: " << oxenmq::to_hex(seckey.begin(), seckey.begin() + 32) << "\nPublic key: " << oxenmq::to_hex(pubkey.begin(), pubkey.end()) << "\nX25519 pubkey: " << oxenmq::to_hex(x_pubkey.begin(), x_pubkey.end()) << - "\nBeldexnet address: " << oxenmq::to_base32z(pubkey.begin(), pubkey.end()) << ".mnode\n\n"; + "\nBelnet address: " << oxenmq::to_base32z(pubkey.begin(), pubkey.end()) << ".mnode\n\n"; return 0; } @@ -300,7 +300,7 @@ int restore(bool ed25519, std::list args) { if (0 != crypto_sign_ed25519_pk_to_curve25519(x_pubkey.data(), pubkey.data())) return error(14, "Unable to convert Ed25519 pubkey to X25519 pubkey; is this a really valid secret key?"); std::cout << "X25519 pubkey: " << oxenmq::to_hex(x_pubkey.begin(), x_pubkey.end()) << - "\nBeldexnet address: " << oxenmq::to_base32z(pubkey.begin(), pubkey.end()) << ".mnode"; + "\nBelnet address: " << oxenmq::to_base32z(pubkey.begin(), pubkey.end()) << ".mnode"; } if (pubkey_expected) { diff --git a/src/cryptonote_basic/tx_extra.cpp b/src/cryptonote_basic/tx_extra.cpp index c314a001c6..aa9d4d52d5 100644 --- a/src/cryptonote_basic/tx_extra.cpp +++ b/src/cryptonote_basic/tx_extra.cpp @@ -29,7 +29,7 @@ tx_extra_beldex_name_system tx_extra_beldex_name_system::make_buy( tx_extra_beldex_name_system tx_extra_beldex_name_system::make_renew( bns::mapping_type type, crypto::hash const &name_hash, crypto::hash const &prev_txid) { - assert(is_beldexnet_type(type) && prev_txid); + assert(is_belnet_type(type) && prev_txid); tx_extra_beldex_name_system result{}; result.fields = bns::extra_field::none; @@ -84,7 +84,7 @@ std::vector readable_reasons(uint16_t decomm_reason) { if (decomm_reason & storage_server_unreachable) results.push_back("Storage Server Unreachable"); if (decomm_reason & timestamp_response_unreachable) results.push_back("Unreachable for Timestamp Check"); if (decomm_reason & timesync_status_out_of_sync) results.push_back("Time out of sync"); - if (decomm_reason & beldexnet_unreachable) results.push_back("Beldexnet Unreachable"); + if (decomm_reason & belnet_unreachable) results.push_back("Belnet Unreachable"); return results; } @@ -96,7 +96,7 @@ std::vector coded_reasons(uint16_t decomm_reason) { if (decomm_reason & storage_server_unreachable) results.push_back("storage"); if (decomm_reason & timestamp_response_unreachable) results.push_back("timecheck"); if (decomm_reason & timesync_status_out_of_sync) results.push_back("timesync"); - if (decomm_reason & beldexnet_unreachable) results.push_back("beldexnet"); + if (decomm_reason & belnet_unreachable) results.push_back("belnet"); return results; } diff --git a/src/cryptonote_basic/tx_extra.h b/src/cryptonote_basic/tx_extra.h index 9fa0e36512..20423a2a23 100755 --- a/src/cryptonote_basic/tx_extra.h +++ b/src/cryptonote_basic/tx_extra.h @@ -431,7 +431,7 @@ namespace cryptonote storage_server_unreachable = 1 << 3, timestamp_response_unreachable = 1 << 4, timesync_status_out_of_sync = 1 << 5, - beldexnet_unreachable = 1 << 6, + belnet_unreachable = 1 << 6, }; // Returns human-readable reason strings (e.g. "Missed Uptime Proofs") for the given reason bits @@ -559,9 +559,9 @@ namespace cryptonote bool is_updating() const { return field_is_set(bns::extra_field::signature) && field_any_set(bns::extra_field::updatable_fields); } // True if this is buying a new BNS record bool is_buying() const { return (fields == bns::extra_field::buy || fields == bns::extra_field::buy_no_backup); } - // True if this is renewing an existing BNS: has no fields at all, is a renewal registration (i.e. beldexnet), + // True if this is renewing an existing BNS: has no fields at all, is a renewal registration (i.e. belnet), // and has a non-null txid set (which should point to the most recent registration or update). - bool is_renewing() const { return fields == bns::extra_field::none && prev_txid && is_beldexnet_type(type); } + bool is_renewing() const { return fields == bns::extra_field::none && prev_txid && is_belnet_type(type); } static tx_extra_beldex_name_system make_buy( bns::generic_owner const& owner, diff --git a/src/cryptonote_config.h b/src/cryptonote_config.h index 80abe012a5..9a9b59367b 100644 --- a/src/cryptonote_config.h +++ b/src/cryptonote_config.h @@ -251,7 +251,7 @@ namespace config inline constexpr auto UPTIME_PROOF_CHECK_INTERVAL = 30s; // How frequently to check whether we need to broadcast a proof inline constexpr auto UPTIME_PROOF_FREQUENCY = 1h; // How often to send proofs out to the network since the last proof we successfully sent. (Approximately; this can be up to CHECK_INTERFACE/2 off in either direction). The minimum accepted time between proofs is half of this. inline constexpr auto UPTIME_PROOF_VALIDITY = 2h + 5min; // The maximum time that we consider an uptime proof to be valid (i.e. after this time since the last proof we consider the SN to be down) - inline constexpr auto REACHABLE_MAX_FAILURE_VALIDITY = 5min; // If we don't hear any SS ping/beldexnet session test failures for more than this long then we start considering the SN as passing for the purpose of obligation testing until we get another test result. This should be somewhat larger than SS/beldexnet's max re-test backoff (2min). + inline constexpr auto REACHABLE_MAX_FAILURE_VALIDITY = 5min; // If we don't hear any SS ping/belnet session test failures for more than this long then we start considering the SN as passing for the purpose of obligation testing until we get another test result. This should be somewhat larger than SS/belnet's max re-test backoff (2min). // Hash domain separators inline constexpr std::string_view HASH_KEY_BULLETPROOF_EXPONENT = "bulletproof"sv; inline constexpr std::string_view HASH_KEY_RINGDB = "ringdsb\0"sv; diff --git a/src/cryptonote_core/beldex_name_system.cpp b/src/cryptonote_core/beldex_name_system.cpp index 3941a52f0f..c38b0a6a30 100755 --- a/src/cryptonote_core/beldex_name_system.cpp +++ b/src/cryptonote_core/beldex_name_system.cpp @@ -107,7 +107,7 @@ std::pair, std::basic_string_view all_mapping_types(uint8_t hf_version) { if (hf_version >= cryptonote::network_version_16_bns) result.push_back(mapping_type::session); if (hf_version >= cryptonote::network_version_17_POS) - result.push_back(mapping_type::beldexnet); + result.push_back(mapping_type::belnet); if (hf_version >= cryptonote::network_version_18) result.push_back(mapping_type::wallet); return result; @@ -624,16 +624,16 @@ std::vector all_mapping_types(uint8_t hf_version) { std::optional expiry_blocks(cryptonote::network_type nettype, mapping_type type,uint8_t hf_version) { std::optional result; - if (is_beldexnet_type(type)) + if (is_belnet_type(type)) { // For testnet we shorten 1-, 2-, and 5-year renewals to 1/2/5 days with 1-day renewal, but // leave 10 years alone to allow long-term registrations on testnet. - const bool testnet_short = nettype == cryptonote::TESTNET && type != mapping_type::beldexnet_10years; + const bool testnet_short = nettype == cryptonote::TESTNET && type != mapping_type::belnet_10years; - if (type == mapping_type::beldexnet) result = BLOCKS_EXPECTED_IN_DAYS(1 * REGISTRATION_YEAR_DAYS,hf_version); - else if (type == mapping_type::beldexnet_2years) result = BLOCKS_EXPECTED_IN_DAYS(2 * REGISTRATION_YEAR_DAYS,hf_version); - else if (type == mapping_type::beldexnet_5years) result = BLOCKS_EXPECTED_IN_DAYS(5 * REGISTRATION_YEAR_DAYS,hf_version); - else if (type == mapping_type::beldexnet_10years) result = BLOCKS_EXPECTED_IN_DAYS(10 * REGISTRATION_YEAR_DAYS,hf_version); + if (type == mapping_type::belnet) result = BLOCKS_EXPECTED_IN_DAYS(1 * REGISTRATION_YEAR_DAYS,hf_version); + else if (type == mapping_type::belnet_2years) result = BLOCKS_EXPECTED_IN_DAYS(2 * REGISTRATION_YEAR_DAYS,hf_version); + else if (type == mapping_type::belnet_5years) result = BLOCKS_EXPECTED_IN_DAYS(5 * REGISTRATION_YEAR_DAYS,hf_version); + else if (type == mapping_type::belnet_10years) result = BLOCKS_EXPECTED_IN_DAYS(10 * REGISTRATION_YEAR_DAYS,hf_version); assert(result); if (testnet_short) @@ -750,13 +750,13 @@ static bool check_condition(bool condition, std::string* reason, T&&... args) { bool validate_bns_name(mapping_type type, std::string name, std::string *reason) { - bool const is_beldexnet = is_beldexnet_type(type); + bool const is_belnet = is_belnet_type(type); size_t max_name_len = 0; - if (is_beldexnet) + if (is_belnet) max_name_len = name.find('-') != std::string::npos - ? BELDEXNET_DOMAIN_NAME_MAX - : BELDEXNET_DOMAIN_NAME_MAX_NOHYPHEN; + ? BELNET_DOMAIN_NAME_MAX + : BELNET_DOMAIN_NAME_MAX_NOHYPHEN; else if (type == mapping_type::session) max_name_len = bns::SESSION_DISPLAY_NAME_MAX; else if (type == mapping_type::wallet) max_name_len = bns::WALLET_NAME_MAX; else @@ -778,15 +778,15 @@ bool validate_bns_name(mapping_type type, std::string name, std::string *reason) std::string_view name_view{name}; // Will chop this down as we validate each part // NOTE: Validate domain specific requirements - if (is_beldexnet) + if (is_belnet) { - // BELDEXNET + // BELNET // Domain has to start with an alphanumeric, and can have (alphanumeric or hyphens) in between, the character before the suffix '.beldex' must be alphanumeric followed by the suffix '.beldex' // It's *approximately* this regex, but there are some extra restrictions below // ^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.beldex$ // Reserved names: - // - localhost.beldex has special meaning within beldexnet (it is always a CNAME to the local + // - localhost.beldex has special meaning within belnet (it is always a CNAME to the local // address) // - beldex.beldex and mnode.beldex are prohibited in case someone added .beldex or .mnode as search // domains (in which case the user looking up "foo.beldex" would try end up trying to resolve @@ -945,13 +945,13 @@ bool mapping_value::validate(cryptonote::network_type nettype, mapping_type type blob->len = counter; } } - else if (is_beldexnet_type(type)) + else if (is_belnet_type(type)) { // We need a 52 char base32z string that decodes to a 32-byte value, which really means we need // 51 base32z chars (=255 bits) followed by a 1-bit value ('y'=0, or 'o'=0b10000); anything else - // in the last spot isn't a valid beldexnet address. + // in the last spot isn't a valid belnet address. if (check_condition(value.size() != 57 || !tools::ends_with(value, ".beldex") || !oxenmq::is_base32z(value.substr(0, 52)) || !(value[51] == 'y' || value[51] == 'o'), - reason, "'", value, "' is not a valid beldexnet address")) + reason, "'", value, "' is not a valid belnet address")) return false; if (blob) @@ -995,8 +995,8 @@ bool mapping_value::validate_encrypted(mapping_type type, std::string_view value int value_len = crypto_aead_xchacha20poly1305_ietf_ABYTES + crypto_aead_xchacha20poly1305_ietf_NPUBBYTES; - if (is_beldexnet_type(type)) - value_len += BELDEXNET_ADDRESS_BINARY_LENGTH; + if (is_belnet_type(type)) + value_len += BELNET_ADDRESS_BINARY_LENGTH; else if (type == mapping_type::wallet) { value_len = crypto_aead_xchacha20poly1305_ietf_ABYTES + crypto_aead_xchacha20poly1305_ietf_NPUBBYTES; //Add the length in check_length @@ -1290,18 +1290,18 @@ bool validate_mapping_type(std::string_view mapping_type_str, uint8_t hf_version mapping_type_ = bns::mapping_type::session; else if (hf_version >= cryptonote::network_version_17_POS) { - if (tools::string_iequal(mapping, "beldexnet")) - mapping_type_ = bns::mapping_type::beldexnet; + if (tools::string_iequal(mapping, "belnet")) + mapping_type_ = bns::mapping_type::belnet; else if (txtype == bns_tx_type::buy || txtype == bns_tx_type::renew) { - if (tools::string_iequal_any(mapping, "beldexnet_1y", "beldexnet_1years")) // Can also specify "beldexnet" - mapping_type_ = bns::mapping_type::beldexnet; - else if (tools::string_iequal_any(mapping, "beldexnet_2y", "beldexnet_2years")) - mapping_type_ = bns::mapping_type::beldexnet_2years; - else if (tools::string_iequal_any(mapping, "beldexnet_5y", "beldexnet_5years")) - mapping_type_ = bns::mapping_type::beldexnet_5years; - else if (tools::string_iequal_any(mapping, "beldexnet_10y", "beldexnet_10years")) - mapping_type_ = bns::mapping_type::beldexnet_10years; + if (tools::string_iequal_any(mapping, "belnet_1y", "belnet_1years")) // Can also specify "belnet" + mapping_type_ = bns::mapping_type::belnet; + else if (tools::string_iequal_any(mapping, "belnet_2y", "belnet_2years")) + mapping_type_ = bns::mapping_type::belnet_2years; + else if (tools::string_iequal_any(mapping, "belnet_5y", "belnet_5years")) + mapping_type_ = bns::mapping_type::belnet_5years; + else if (tools::string_iequal_any(mapping, "belnet_10y", "belnet_10years")) + mapping_type_ = bns::mapping_type::belnet_10years; } } if (hf_version >= cryptonote::network_version_18) @@ -1313,10 +1313,10 @@ bool validate_mapping_type(std::string_view mapping_type_str, uint8_t hf_version if (!mapping_type_) { if (reason) *reason = "Unsupported BNS type \"" + std::string{mapping_type_str} + "\"; supported " + ( - txtype == bns_tx_type::update ? "update types are: session, beldexnet, wallet" : - txtype == bns_tx_type::renew ? "renew types are: beldexnet_1y, beldexnet_2y, beldexnet_5y, beldexnet_10y" : - txtype == bns_tx_type::buy ? "buy types are session, beldexnet_1y, beldexnet_2y, beldexnet_5y, beldexnet_10y" - : "lookup types are session, beldexnet, wallet"); + txtype == bns_tx_type::update ? "update types are: session, belnet, wallet" : + txtype == bns_tx_type::renew ? "renew types are: belnet_1y, belnet_2y, belnet_5y, belnet_10y" : + txtype == bns_tx_type::buy ? "buy types are session, belnet_1y, belnet_2y, belnet_5y, belnet_10y" + : "lookup types are session, belnet, wallet"); return false; } @@ -1472,7 +1472,7 @@ bool mapping_value::decrypt(std::string_view name, mapping_type type, const cryp { switch(type) { case mapping_type::session: dec_length = SESSION_PUBLIC_KEY_BINARY_LENGTH; break; - case mapping_type::beldexnet: dec_length = BELDEXNET_ADDRESS_BINARY_LENGTH; break; + case mapping_type::belnet: dec_length = BELNET_ADDRESS_BINARY_LENGTH; break; case mapping_type::wallet: //Wallet type has variable type, check performed in check_length if (auto plain_len = len - crypto_aead_xchacha20poly1305_ietf_ABYTES - crypto_aead_xchacha20poly1305_ietf_NPUBBYTES; plain_len == WALLET_ACCOUNT_BINARY_LENGTH_INC_PAYMENT_ID || plain_len == WALLET_ACCOUNT_BINARY_LENGTH_NO_PAYMENT_ID) { diff --git a/src/cryptonote_core/beldex_name_system.h b/src/cryptonote_core/beldex_name_system.h index 6fc12802d3..b2028d6252 100755 --- a/src/cryptonote_core/beldex_name_system.h +++ b/src/cryptonote_core/beldex_name_system.h @@ -30,9 +30,9 @@ namespace bns constexpr size_t WALLET_NAME_MAX = 64; constexpr size_t WALLET_ACCOUNT_BINARY_LENGTH_INC_PAYMENT_ID = 73; // Wallet will encrypt an identifier (1 byte) a public spend and view key (2x 32 bytes) = 65 bytes plus an additional item for payment id (8 bytes) if necessary. The identifier 0 -> No Subaddress or Payment ID, 1 -> Has Subaddress, 2-> Has Payment ID constexpr size_t WALLET_ACCOUNT_BINARY_LENGTH_NO_PAYMENT_ID = 65; -constexpr size_t BELDEXNET_DOMAIN_NAME_MAX = 63 + 5; // DNS components name must be at most 63 (+ 5 for .beldex); this limit applies if there is at least one hyphen (and thus includes punycode) -constexpr size_t BELDEXNET_DOMAIN_NAME_MAX_NOHYPHEN = 32 + 5; // If the name does not contain a - then we restrict it to 32 characters so that it cannot be (and is obviously not) an encoded .beldex address (52 characters) -constexpr size_t BELDEXNET_ADDRESS_BINARY_LENGTH = sizeof(crypto::ed25519_public_key); +constexpr size_t BELNET_DOMAIN_NAME_MAX = 63 + 5; // DNS components name must be at most 63 (+ 5 for .beldex); this limit applies if there is at least one hyphen (and thus includes punycode) +constexpr size_t BELNET_DOMAIN_NAME_MAX_NOHYPHEN = 32 + 5; // If the name does not contain a - then we restrict it to 32 characters so that it cannot be (and is obviously not) an encoded .beldex address (52 characters) +constexpr size_t BELNET_ADDRESS_BINARY_LENGTH = sizeof(crypto::ed25519_public_key); constexpr size_t SESSION_DISPLAY_NAME_MAX = 64; constexpr size_t SESSION_PUBLIC_KEY_BINARY_LENGTH = 1 + sizeof(crypto::ed25519_public_key); // Session keys at prefixed with 0x05 + ed25519 key @@ -48,7 +48,7 @@ constexpr char BNS_WALLET_TYPE_INTEGRATED = 0x02; struct mapping_value { - static size_t constexpr BUFFER_SIZE = std::max({WALLET_ACCOUNT_BINARY_LENGTH_INC_PAYMENT_ID, BELDEXNET_ADDRESS_BINARY_LENGTH, SESSION_PUBLIC_KEY_BINARY_LENGTH}) + SODIUM_ENCRYPTION_EXTRA_BYTES; + static size_t constexpr BUFFER_SIZE = std::max({WALLET_ACCOUNT_BINARY_LENGTH_INC_PAYMENT_ID, BELNET_ADDRESS_BINARY_LENGTH, SESSION_PUBLIC_KEY_BINARY_LENGTH}) + SODIUM_ENCRYPTION_EXTRA_BYTES; std::array buffer; bool encrypted; size_t len; @@ -104,7 +104,7 @@ struct mapping_value // Validate a human readable mapping value representation in 'value' and write the binary form into 'blob'. // value: if type is session, 66 character hex string of an ed25519 public key (with 05 prefix) - // BELDEXnet, 52 character base32z string of an ed25519 public key + // BELnet, 52 character base32z string of an ed25519 public key // wallet, the wallet public address string // blob: (optional) if function returns true, validate will load the binary data into blob (ready for encryption via encrypt()) static bool validate(cryptonote::network_type nettype, mapping_type type, std::string_view value, mapping_value *blob = nullptr, std::string *reason = nullptr); @@ -121,10 +121,10 @@ inline std::string_view mapping_type_str(mapping_type type) { switch(type) { - case mapping_type::beldexnet: return "beldexnet"sv; // general type stored in the database; 1 year when in a purchase tx - case mapping_type::beldexnet_2years: return "beldexnet_2years"sv; // Only used in a buy tx, not in the DB - case mapping_type::beldexnet_5years: return "beldexnet_5years"sv; // " - case mapping_type::beldexnet_10years: return "beldexnet_10years"sv; // " + case mapping_type::belnet: return "belnet"sv; // general type stored in the database; 1 year when in a purchase tx + case mapping_type::belnet_2years: return "belnet_2years"sv; // Only used in a buy tx, not in the DB + case mapping_type::belnet_5years: return "belnet_5years"sv; // " + case mapping_type::belnet_10years: return "belnet_10years"sv; // " case mapping_type::session: return "session"sv; case mapping_type::wallet: return "wallet"sv; default: assert(false); return "xx_unhandled_type"sv; @@ -134,22 +134,22 @@ inline std::ostream &operator<<(std::ostream &os, mapping_type type) { return os constexpr bool mapping_type_allowed(uint8_t hf_version, mapping_type type) { return (type == mapping_type::session && hf_version >= cryptonote::network_version_16_bns) - || (is_beldexnet_type(type) && hf_version >= cryptonote::network_version_17_POS); + || (is_belnet_type(type) && hf_version >= cryptonote::network_version_17_POS); } // Returns all mapping types supported for lookup as of the given hardfork. (Note that this does -// not return the dedicated length types such as mapping_type::beldexnet_5years as those are only +// not return the dedicated length types such as mapping_type::belnet_5years as those are only // relevant within a BNS buy tx). std::vector all_mapping_types(uint8_t hf_version); sqlite3 *init_beldex_name_system(const fs::path& file_path, bool read_only); /// Returns the integer value used in the database and in RPC lookup calls for the given mapping -/// type. In particularly this maps all mapping_type::beldexnet_Xyears values to the underlying value -/// of mapping_type::beldexnet. +/// type. In particularly this maps all mapping_type::belnet_Xyears values to the underlying value +/// of mapping_type::belnet. constexpr uint16_t db_mapping_type(bns::mapping_type type) { - if (is_beldexnet_type(type)) - return static_cast(mapping_type::beldexnet); + if (is_belnet_type(type)) + return static_cast(mapping_type::belnet); return static_cast(type); } @@ -183,7 +183,7 @@ std::string tx_extra_signature(std::string_view value, generic_owner cons enum struct bns_tx_type { lookup, buy, update, renew }; // Converts a human readable case-insensitive string denoting the mapping type into a value suitable for storing into the BNS DB. -// Currently accepts "session" or "beldexnet" for lookups, buys, updates, and renewals; for buys and renewals also accepts "beldexnet_Ny[ear]" for N=2,5,10 +// Currently accepts "session" or "belnet" for lookups, buys, updates, and renewals; for buys and renewals also accepts "belnet_Ny[ear]" for N=2,5,10 // Lookups are implied by none of buy/update/renew. // mapping_type: (optional) if function returns true, the uint16_t value of the 'type' will be set bool validate_mapping_type(std::string_view type, uint8_t hf_version, bns_tx_type txtype, mapping_type *mapping_type, std::string *reason); diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index 36f8b33b1f..f7be25c4bd 100755 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -286,10 +286,10 @@ namespace cryptonote , m_last_json_checkpoints_update(0) , m_nettype(UNDEFINED) , m_last_storage_server_ping(0) - , m_last_beldexnet_ping(0) + , m_last_belnet_ping(0) , m_pad_transactions(false) , ss_version{0} - , beldexnet_version{0} + , belnet_version{0} { m_checkpoints_updating.clear(); } @@ -417,7 +417,7 @@ namespace cryptonote if (!epee::net_utils::is_ip_public(m_mn_public_ip)) { if (m_master_node_list.debug_allow_local_ips) { - MWARNING("Address given for public-ip is not public; allowing it because dev-allow-local-ips was specified. This master node WILL NOT WORK ON THE PUBLIC OXEN NETWORK!"); + MWARNING("Address given for public-ip is not public; allowing it because dev-allow-local-ips was specified. This master node WILL NOT WORK ON THE PUBLIC BELDEX NETWORK!"); } else { MERROR("Address given for public-ip is not public: " << epee::string_tools::get_ip_string_from_int32(m_mn_public_ip)); args_okay = false; @@ -523,7 +523,7 @@ namespace cryptonote } // Returns a string for systemd status notifications such as: - // Height: 1234567, MN: active, proof: 55m12s, storage: 4m48s, beldexnet: 47s + // Height: 1234567, MN: active, proof: 55m12s, storage: 4m48s, belnet: 47s std::string core::get_status_string() const { std::string s; @@ -558,8 +558,8 @@ namespace cryptonote s += time_ago_str(now, last_proof); s += ", storage: "; s += time_ago_str(now, m_last_storage_server_ping); - s += ", beldexnet: "; - s += time_ago_str(now, m_last_beldexnet_ping); + s += ", belnet: "; + s += time_ago_str(now, m_last_belnet_ping); } } return s; @@ -980,7 +980,7 @@ namespace cryptonote MGINFO_YELLOW("- primary: " << tools::type_to_hex(keys.pub)); MGINFO_YELLOW("- ed25519: " << tools::type_to_hex(keys.pub_ed25519)); // .mnode address is the ed25519 pubkey, encoded with base32z and with .mnode appended: - MGINFO_YELLOW("- beldexnet: " << oxenmq::to_base32z(tools::view_guts(keys.pub_ed25519)) << ".mnode"); + MGINFO_YELLOW("- belnet: " << oxenmq::to_base32z(tools::view_guts(keys.pub_ed25519)) << ".mnode"); MGINFO_YELLOW("- x25519: " << tools::type_to_hex(keys.pub_x25519)); } else { // Only print the x25519 version because it's the only thing useful for a non-MN (for @@ -1940,7 +1940,7 @@ namespace cryptonote auto proof = m_master_node_list.generate_uptime_proof(m_mn_public_ip, storage_https_port(), storage_omq_port(), - ss_version, m_quorumnet_port, beldexnet_version); + ss_version, m_quorumnet_port, belnet_version); NOTIFY_BTENCODED_UPTIME_PROOF::request req = proof.generate_request(); relayed = get_protocol()->relay_btencoded_uptime_proof(req, fake_context); @@ -2264,7 +2264,7 @@ bool core::handle_uptime_proof_v12(const NOTIFY_UPTIME_PROOF_V12::request &proof void core::update_omq_mns() { - // TODO: let callers (e.g. beldexnet, ss) subscribe to callbacks when this fires + // TODO: let callers (e.g. belnet, ss) subscribe to callbacks when this fires oxenmq::pubkey_set active_sns; m_master_node_list.copy_active_x25519_pubkeys(std::inserter(active_sns, active_sns.end())); m_omq->set_active_sns(std::move(active_sns)); @@ -2374,10 +2374,10 @@ bool core::handle_uptime_proof_v12(const NOTIFY_UPTIME_PROOF_V12::request &proof "is running! It is required to run alongside the Beldex daemon"); return; } - if (!check_external_ping(m_last_beldexnet_ping, get_net_config().UPTIME_PROOF_FREQUENCY, "Beldexnet")) + if (!check_external_ping(m_last_belnet_ping, get_net_config().UPTIME_PROOF_FREQUENCY, "Belnet")) { MGINFO_RED( - "Failed to submit uptime proof: have not heard from beldexnet recently. Make sure that it " + "Failed to submit uptime proof: have not heard from belnet recently. Make sure that it " "is running! It is required to run alongside the Beldex daemon"); return; } diff --git a/src/cryptonote_core/cryptonote_core.h b/src/cryptonote_core/cryptonote_core.h index c0f12ee394..d4973ace17 100755 --- a/src/cryptonote_core/cryptonote_core.h +++ b/src/cryptonote_core/cryptonote_core.h @@ -999,8 +999,8 @@ namespace cryptonote */ void flush_invalid_blocks(); - /// Time point at which the storage server and beldexnet last pinged us - std::atomic m_last_storage_server_ping, m_last_beldexnet_ping; + /// Time point at which the storage server and belnet last pinged us + std::atomic m_last_storage_server_ping, m_last_belnet_ping; std::atomic m_storage_https_port, m_storage_omq_port; uint32_t mn_public_ip() const { return m_mn_public_ip; } @@ -1143,9 +1143,9 @@ namespace cryptonote std::unordered_map& _omq_auth_level_map() { return m_omq_auth; } oxenmq::TaggedThreadID const &POS_thread_id() const { return *m_POS_thread_id; } - /// Master Node's storage server and beldexnet version + /// Master Node's storage server and belnet version std::array ss_version; - std::array beldexnet_version; + std::array belnet_version; private: diff --git a/src/cryptonote_core/master_node_list.cpp b/src/cryptonote_core/master_node_list.cpp index be2aaac0ff..c64cbba7c3 100755 --- a/src/cryptonote_core/master_node_list.cpp +++ b/src/cryptonote_core/master_node_list.cpp @@ -2809,10 +2809,10 @@ namespace master_nodes } - uptime_proof::Proof master_node_list::generate_uptime_proof(uint32_t public_ip, uint16_t storage_https_port, uint16_t storage_omq_port, std::array ss_version, uint16_t quorumnet_port, std::array beldexnet_version) const + uptime_proof::Proof master_node_list::generate_uptime_proof(uint32_t public_ip, uint16_t storage_https_port, uint16_t storage_omq_port, std::array ss_version, uint16_t quorumnet_port, std::array belnet_version) const { const auto& keys = *m_master_node_keys; - return uptime_proof::Proof(public_ip, storage_https_port, storage_omq_port, ss_version, quorumnet_port, beldexnet_version, keys); + return uptime_proof::Proof(public_ip, storage_https_port, storage_omq_port, ss_version, quorumnet_port, belnet_version, keys); } #ifdef __cpp_lib_erase_if // # (C++20) @@ -3109,8 +3109,8 @@ namespace master_nodes if (vers >= min.hardfork_revision) { if (proof->version < min.beldexd) REJECT_PROOF("v" << tools::join(".", min.beldexd) << "+ beldexd version is required for v" << +vers.first << "." << +vers.second << "+ network proofs"); - if (proof->beldexnet_version < min.beldexnet) - REJECT_PROOF("v" << tools::join(".", min.beldexnet) << "+ beldexnet version is required for v" << +vers.first << "." << +vers.second << "+ network proofs"); + if (proof->belnet_version < min.belnet) + REJECT_PROOF("v" << tools::join(".", min.belnet) << "+ belnet version is required for v" << +vers.first << "." << +vers.second << "+ network proofs"); if (proof->storage_server_version < min.storage_server) REJECT_PROOF("v" << tools::join(".", min.storage_server) << "+ storage server version is required for v" << +vers.first << "." << +vers.second << "+ network proofs"); } @@ -3360,7 +3360,7 @@ namespace master_nodes std::lock_guard lock(m_mn_mutex); - const auto type = storage_server ? "storage server"sv : "beldexnet"sv; + const auto type = storage_server ? "storage server"sv : "belnet"sv; if (!m_state.master_nodes_infos.count(pubkey)) { MDEBUG("Dropping " << type << " reachable report: " << pubkey << " is not a registered MN pubkey"); @@ -3371,7 +3371,7 @@ namespace master_nodes const auto now = std::chrono::steady_clock::now(); - auto& reach = storage_server ? proofs[pubkey].ss_reachable : proofs[pubkey].beldexnet_reachable; + auto& reach = storage_server ? proofs[pubkey].ss_reachable : proofs[pubkey].belnet_reachable; if (reachable) { reach.last_reachable = now; reach.first_unreachable = NEVER; @@ -3389,7 +3389,7 @@ namespace master_nodes return set_peer_reachable(true, pubkey, reachable); } - bool master_node_list::set_beldexnet_peer_reachable(crypto::public_key const &pubkey, bool reachable) + bool master_node_list::set_belnet_peer_reachable(crypto::public_key const &pubkey, bool reachable) { return set_peer_reachable(false, pubkey, reachable); } diff --git a/src/cryptonote_core/master_node_list.h b/src/cryptonote_core/master_node_list.h index 8735f50e9a..d894df999c 100755 --- a/src/cryptonote_core/master_node_list.h +++ b/src/cryptonote_core/master_node_list.h @@ -155,7 +155,7 @@ namespace master_nodes uint64_t effective_timestamp = 0; // Typically the same, but on recommissions it is set to the recommission block time to fend off instant obligation checks std::array, 2> public_ips = {}; // (not serialized) - // See set_storage_server_peer_reachable(...) and set_beldexnet_peer_reachable(...) + // See set_storage_server_peer_reachable(...) and set_belnet_peer_reachable(...) struct reachable_stats { std::chrono::steady_clock::time_point last_reachable = NEVER, @@ -177,7 +177,7 @@ namespace master_nodes }; reachable_stats ss_reachable; - reachable_stats beldexnet_reachable; + reachable_stats belnet_reachable; // Unlike all of the above (except for timestamp), these values *do* get serialized std::unique_ptr proof; @@ -562,7 +562,7 @@ namespace master_nodes uint16_t storage_omq_port, uint16_t quorumnet_port) const; - uptime_proof::Proof generate_uptime_proof(uint32_t public_ip, uint16_t storage_port, uint16_t storage_omq_port, std::array ss_version, uint16_t quorumnet_port, std::array beldexnet_version) const; + uptime_proof::Proof generate_uptime_proof(uint32_t public_ip, uint16_t storage_port, uint16_t storage_omq_port, std::array ss_version, uint16_t quorumnet_port, std::array belnet_version) const; bool handle_uptime_proof_v12(const cryptonote::NOTIFY_UPTIME_PROOF_V12::request &proof, bool &my_uptime_proof_confirmation, crypto::public_key &pubkey); //TODO: remove after HF18 @@ -576,8 +576,8 @@ namespace master_nodes // Called every hour to remove proofs for expired MNs from memory and the database. void cleanup_proofs(); - // Called via RPC from storage server/beldexnet to report a ping test result for a remote storage - // server/beldexnet. + // Called via RPC from storage server/belnet to report a ping test result for a remote storage + // server/belnet. // // How this works: // - SS randomly picks probably-good nodes to test every 10s (with fuzz), and pings @@ -593,8 +593,8 @@ namespace master_nodes // - otherwise we consider it good. (Which means either it passed a reachability test at least // once in the last 1h5min *or* SS stopped pinging it, perhaps because it restarted). // - // Beldexnet works essentially the same, except that its concept of a "ping" is being able to - // successfully establish a session with the given remote beldexnet mnode. + // Belnet works essentially the same, except that its concept of a "ping" is being able to + // successfully establish a session with the given remote belnet mnode. // // We do all this by tracking three values: // - last_reachable @@ -617,7 +617,7 @@ namespace master_nodes // UPTIME_PROOF_VALIDITY-UPTIME_PROOF_FREQUENCY (which is actually 11min on testnet rather than // 1h5min)). bool set_storage_server_peer_reachable(crypto::public_key const &pubkey, bool value); - bool set_beldexnet_peer_reachable(crypto::public_key const &pubkey, bool value); + bool set_belnet_peer_reachable(crypto::public_key const &pubkey, bool value); private: bool set_peer_reachable(bool storage_server, crypto::public_key const &pubkey, bool value); public: diff --git a/src/cryptonote_core/master_node_quorum_cop.cpp b/src/cryptonote_core/master_node_quorum_cop.cpp index b7ac760f84..da6d485bec 100755 --- a/src/cryptonote_core/master_node_quorum_cop.cpp +++ b/src/cryptonote_core/master_node_quorum_cop.cpp @@ -59,7 +59,7 @@ namespace master_nodes if (!timestamp_participation) results.push_back("Too many out-of-sync timesync replies."sv); if (!timesync_status) results.push_back("Too many missed timesync replies."sv); if (!storage_server_reachable) results.push_back("Storage server is not reachable."sv); - if (!beldexnet_reachable) results.push_back("Beldexnet router is not reachable."sv); + if (!belnet_reachable) results.push_back("Belnet router is not reachable."sv); return results; } @@ -81,7 +81,7 @@ namespace master_nodes const auto& netconf = m_core.get_net_config(); master_node_test_results result; // Defaults to true for individual tests - bool ss_reachable = true, beldexnet_reachable = true; + bool ss_reachable = true, belnet_reachable = true; uint64_t timestamp = 0; decltype(std::declval().public_ips) ips{}; @@ -96,7 +96,7 @@ namespace master_nodes m_core.get_master_node_list().access_proof(pubkey, [&](const proof_info &proof) { ss_reachable = !proof.ss_reachable.unreachable_for(unreachable_threshold); - beldexnet_reachable = !proof.beldexnet_reachable.unreachable_for(unreachable_threshold); + belnet_reachable = !proof.belnet_reachable.unreachable_for(unreachable_threshold); timestamp = std::max(proof.timestamp, proof.effective_timestamp); ips = proof.public_ips; checkpoint_participation = proof.checkpoint_participation; @@ -135,9 +135,9 @@ namespace master_nodes result.storage_server_reachable = false; } // TODO: perhaps come back and make this activate on some "soft fork" height before HF19? - if (!beldexnet_reachable && hf_version >= cryptonote::network_version_18) { - LOG_PRINT_L1("Master Node beldexnet is not reachable for node: " << pubkey); - result.beldexnet_reachable = false; + if (!belnet_reachable && hf_version >= cryptonote::network_version_18) { + LOG_PRINT_L1("Master Node belnet is not reachable for node: " << pubkey); + result.belnet_reachable = false; } @@ -384,7 +384,7 @@ namespace master_nodes if (!test_results.checkpoint_participation) reason |= cryptonote::Decommission_Reason::missed_checkpoints; if (!test_results.POS_participation) reason |= cryptonote::Decommission_Reason::missed_POS_participations; if (!test_results.storage_server_reachable) reason |= cryptonote::Decommission_Reason::storage_server_unreachable; - if (!test_results.beldexnet_reachable) reason |= cryptonote::Decommission_Reason::beldexnet_unreachable; + if (!test_results.belnet_reachable) reason |= cryptonote::Decommission_Reason::belnet_unreachable; if (!test_results.timestamp_participation) reason |= cryptonote::Decommission_Reason::timestamp_response_unreachable; if (!test_results.timesync_status) reason |= cryptonote::Decommission_Reason::timesync_status_out_of_sync; int64_t credit = calculate_decommission_credit(info, latest_height,hf_version); @@ -457,7 +457,7 @@ namespace master_nodes LOG_PRINT_L0(tools::join("\n", *why)); else LOG_PRINT_L0("Master Node is passing all local tests"); - LOG_PRINT_L0("(Note that some tests, such as storage server and beldexnet reachability, can only assessed by remote master nodes)"); + LOG_PRINT_L0("(Note that some tests, such as storage server and belnet reachability, can only assessed by remote master nodes)"); } } } diff --git a/src/cryptonote_core/master_node_quorum_cop.h b/src/cryptonote_core/master_node_quorum_cop.h index eda9050db1..48793a02b5 100755 --- a/src/cryptonote_core/master_node_quorum_cop.h +++ b/src/cryptonote_core/master_node_quorum_cop.h @@ -93,7 +93,7 @@ namespace master_nodes bool timestamp_participation = true; bool timesync_status = true; bool storage_server_reachable = true; - bool beldexnet_reachable = true; + bool belnet_reachable = true; // Returns a vector of reasons why this node is failing (nullopt if not failing). std::optional> why(bool v12) const; @@ -107,7 +107,7 @@ namespace master_nodes timestamp_participation && timesync_status && storage_server_reachable && - beldexnet_reachable; + belnet_reachable; } }; diff --git a/src/cryptonote_core/master_node_rules.h b/src/cryptonote_core/master_node_rules.h index 4393c92a38..096a743118 100755 --- a/src/cryptonote_core/master_node_rules.h +++ b/src/cryptonote_core/master_node_rules.h @@ -187,14 +187,14 @@ namespace master_nodes { constexpr uint64_t VOTE_OR_TX_VERIFY_HEIGHT_BUFFER = 5; constexpr std::array MIN_STORAGE_SERVER_VERSION{{2, 0, 7}}; - constexpr std::array MIN_BELDEXNET_VERSION{{0, 8, 0}}; + constexpr std::array MIN_BELNET_VERSION{{0, 8, 0}}; // The minimum accepted version number, broadcasted by Master Nodes via uptime proofs for each hardfork struct proof_version { std::pair hardfork_revision; std::array beldexd; - std::array beldexnet; + std::array belnet; std::array storage_server; }; diff --git a/src/cryptonote_core/uptime_proof.cpp b/src/cryptonote_core/uptime_proof.cpp index 14d37aae16..87019312cd 100644 --- a/src/cryptonote_core/uptime_proof.cpp +++ b/src/cryptonote_core/uptime_proof.cpp @@ -20,7 +20,7 @@ Proof::Proof( uint16_t mn_storage_omq_port, const std::array ss_version, uint16_t quorumnet_port, - const std::array beldexnet_version, + const std::array belnet_version, const master_nodes::master_node_keys& keys) : version{BELDEX_VERSION}, pubkey{keys.pub}, @@ -31,7 +31,7 @@ Proof::Proof( storage_https_port{mn_storage_https_port}, storage_omq_port{mn_storage_omq_port}, storage_server_version{ss_version}, - beldexnet_version{beldexnet_version} + belnet_version{belnet_version} { crypto::hash hash = hash_uptime_proof(); @@ -75,11 +75,11 @@ Proof::Proof(const std::string& serialized_proof) for (bt_value const &i: bt_storage_version){ storage_server_version[k++] = static_cast(get_int(i)); } - //beldexnet_version - const bt_list& bt_beldexnet_version = var::get(bt_proof.at("lv")); + //belnet_version + const bt_list& bt_belnet_version = var::get(bt_proof.at("lv")); k = 0; - for (bt_value const &i: bt_beldexnet_version){ - beldexnet_version[k++] = static_cast(get_int(i)); + for (bt_value const &i: bt_belnet_version){ + belnet_version[k++] = static_cast(get_int(i)); } } catch (const std::exception& e) { MWARNING("deserialization failed: " << e.what()); @@ -117,8 +117,8 @@ oxenmq::bt_dict Proof::bt_encode_uptime_proof() const {"sop", storage_omq_port}, //storage_version {"sv", oxenmq::bt_list{{storage_server_version[0], storage_server_version[1], storage_server_version[2]}}}, - //beldexnet_version - {"lv", oxenmq::bt_list{{beldexnet_version[0], beldexnet_version[1], beldexnet_version[2]}}}, + //belnet_version + {"lv", oxenmq::bt_list{{belnet_version[0], belnet_version[1], belnet_version[2]}}}, }; if (tools::view_guts(pubkey) != tools::view_guts(pubkey_ed25519)) { @@ -155,7 +155,7 @@ bool operator==(const uptime_proof::Proof& lhs, const uptime_proof::Proof& rhs) (lhs.qnet_port != rhs.qnet_port) || (lhs.version != rhs.version) || (lhs.storage_server_version != rhs.storage_server_version) || - (lhs.beldexnet_version != rhs.beldexnet_version)) + (lhs.belnet_version != rhs.belnet_version)) result = false; return result; diff --git a/src/cryptonote_core/uptime_proof.h b/src/cryptonote_core/uptime_proof.h index 5f3cf6c9b4..7300742ae4 100644 --- a/src/cryptonote_core/uptime_proof.h +++ b/src/cryptonote_core/uptime_proof.h @@ -13,7 +13,7 @@ class Proof public: std::array version; std::array storage_server_version; - std::array beldexnet_version; + std::array belnet_version; uint64_t timestamp; crypto::public_key pubkey; @@ -26,7 +26,7 @@ class Proof uint16_t qnet_port; Proof() = default; - Proof(uint32_t mn_public_ip, uint16_t mn_storage_https_port, uint16_t mn_storage_omq_port, std::array ss_version, uint16_t quorumnet_port, std::array beldexnet_version, const master_nodes::master_node_keys& keys); + Proof(uint32_t mn_public_ip, uint16_t mn_storage_https_port, uint16_t mn_storage_omq_port, std::array ss_version, uint16_t quorumnet_port, std::array belnet_version, const master_nodes::master_node_keys& keys); Proof(const std::string& serialized_proof); oxenmq::bt_dict bt_encode_uptime_proof() const; diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp index 9dd5a8bb2e..8bc67da1dc 100755 --- a/src/daemon/rpc_command_executor.cpp +++ b/src/daemon/rpc_command_executor.cpp @@ -566,11 +566,11 @@ bool rpc_command_executor::show_status() { str << "NOT RECEIVED"; str << " (storage), "; - if (*ires.last_beldexnet_ping > 0) - str << get_human_time_ago(*ires.last_beldexnet_ping, now, true /*abbreviate*/); + if (*ires.last_belnet_ping > 0) + str << get_human_time_ago(*ires.last_belnet_ping, now, true /*abbreviate*/); else str << "NOT RECEIVED"; - str << " (beldexnet)"; + str << " (belnet)"; tools::success_msg_writer() << str.str(); @@ -1663,7 +1663,7 @@ static void append_printable_master_node_list_entry(cryptonote::network_type net if (detailed_view) stream << indent2 << "Auxiliary Public Keys:\n" << indent3 << (entry.pubkey_ed25519.empty() ? "(not yet received)" : entry.pubkey_ed25519) << " (Ed25519)\n" - << indent3 << (entry.pubkey_ed25519.empty() ? "(not yet received)" : oxenmq::to_base32z(oxenmq::from_hex(entry.pubkey_ed25519)) + ".mnode") << " (Beldexnet)\n" + << indent3 << (entry.pubkey_ed25519.empty() ? "(not yet received)" : oxenmq::to_base32z(oxenmq::from_hex(entry.pubkey_ed25519)) + ".mnode") << " (Belnet)\n" << indent3 << (entry.pubkey_x25519.empty() ? "(not yet received)" : entry.pubkey_x25519) << " (X25519)\n"; // @@ -1693,14 +1693,14 @@ static void append_printable_master_node_list_entry(cryptonote::network_type net }; stream << indent2 << "Storage Server Reachable: "; print_reachable(entry.storage_server_reachable, entry.storage_server_first_unreachable, entry.storage_server_last_unreachable, entry.storage_server_last_reachable); - stream << indent2 << "Beldexnet Reachable: "; - print_reachable(entry.beldexnet_reachable, entry.beldexnet_first_unreachable, entry.beldexnet_last_unreachable, entry.beldexnet_last_reachable); + stream << indent2 << "Belnet Reachable: "; + print_reachable(entry.belnet_reachable, entry.belnet_first_unreachable, entry.belnet_last_unreachable, entry.belnet_last_reachable); // // NOTE: Component Versions // - stream << indent2 << "Storage Server / Beldexnet Router versions: " - << ((entry.storage_server_version[0] == 0 && entry.storage_server_version[1] == 0 && entry.storage_server_version[2] == 0) ? "(Storage server ping not yet received) " : tools::join(".", entry.storage_server_version)) << " / " << ((entry.beldexnet_version[0] == 0 && entry.beldexnet_version[1] == 0 && entry.beldexnet_version[2] == 0) ? "(Beldexnet ping not yet received)" : tools::join(".", entry.beldexnet_version)) << "\n"; + stream << indent2 << "Storage Server / Belnet Router versions: " + << ((entry.storage_server_version[0] == 0 && entry.storage_server_version[1] == 0 && entry.storage_server_version[2] == 0) ? "(Storage server ping not yet received) " : tools::join(".", entry.storage_server_version)) << " / " << ((entry.belnet_version[0] == 0 && entry.belnet_version[1] == 0 && entry.belnet_version[2] == 0) ? "(Belnet ping not yet received)" : tools::join(".", entry.belnet_version)) << "\n"; @@ -1981,11 +1981,11 @@ bool rpc_command_executor::prepare_registration(bool force_registration) tools::fail_msg_writer() << "Unable to prepare registration: this daemon is not running in --master-node mode"; return false; } - else if (auto last_beldexnet_ping = static_cast(res.last_beldexnet_ping.value_or(0)); - last_beldexnet_ping < (time(nullptr) - 60) && !force_registration) + else if (auto last_belnet_ping = static_cast(res.last_belnet_ping.value_or(0)); + last_belnet_ping < (time(nullptr) - 60) && !force_registration) { - tools::fail_msg_writer() << "Unable to prepare registration: this daemon has not received a ping from beldexnet " - << (res.last_beldexnet_ping == 0 ? "yet" : "since " + get_human_time_ago(last_beldexnet_ping, std::time(nullptr))); + tools::fail_msg_writer() << "Unable to prepare registration: this daemon has not received a ping from belnet " + << (res.last_belnet_ping == 0 ? "yet" : "since " + get_human_time_ago(last_belnet_ping, std::time(nullptr))); return false; } else if (auto last_storage_server_ping = static_cast(res.last_storage_server_ping.value_or(0)); diff --git a/src/debug_utilities/cn_deserialize.cpp b/src/debug_utilities/cn_deserialize.cpp index ff586a2846..78299a5508 100755 --- a/src/debug_utilities/cn_deserialize.cpp +++ b/src/debug_utilities/cn_deserialize.cpp @@ -80,10 +80,10 @@ struct extra_printer { std::cout << "BNS " << (x.is_buying() ? "registration" : x.is_updating() ? "update" : "(unknown)"); switch (x.type) { - case bns::mapping_type::beldexnet: std::cout << " - beldexnet (1y)"; break; - case bns::mapping_type::beldexnet_2years: std::cout << " - beldexnet (2y)"; break; - case bns::mapping_type::beldexnet_5years: std::cout << " - beldexnet (5y)"; break; - case bns::mapping_type::beldexnet_10years: std::cout << " - Beldexnet (10y)"; break; + case bns::mapping_type::belnet: std::cout << " - belnet (1y)"; break; + case bns::mapping_type::belnet_2years: std::cout << " - belnet (2y)"; break; + case bns::mapping_type::belnet_5years: std::cout << " - belnet (5y)"; break; + case bns::mapping_type::belnet_10years: std::cout << " - Belnet (10y)"; break; case bns::mapping_type::session: std::cout << " - Session address"; break; case bns::mapping_type::wallet: std::cout << " - Wallet address"; break; case bns::mapping_type::update_record_internal: diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index af3f36d1c5..8d791c9726 100755 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -610,8 +610,8 @@ namespace nodetool std::set full_addrs; if (nettype == cryptonote::TESTNET) { - full_addrs.insert("35.178.92.132:29090"); - full_addrs.insert("18.144.13.220:29090"); + full_addrs.insert("test1.rpcnode.stream:29090"); + full_addrs.insert("test2.rpcnode.stream:29090"); } else if (nettype == cryptonote::DEVNET) { diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index a22438a1b7..6c83e98066 100755 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -430,14 +430,14 @@ namespace cryptonote { namespace rpc { res.bns_counts = { bns_counts[bns::mapping_type::session], bns_counts[bns::mapping_type::wallet], - bns_counts[bns::mapping_type::beldexnet]}; + bns_counts[bns::mapping_type::belnet]}; if (context.admin) { res.master_node = m_core.master_node(); res.start_time = (uint64_t)m_core.get_start_time(); res.last_storage_server_ping = (uint64_t)m_core.m_last_storage_server_ping; - res.last_beldexnet_ping = (uint64_t)m_core.m_last_beldexnet_ping; + res.last_belnet_ping = (uint64_t)m_core.m_last_belnet_ping; res.free_space = m_core.get_free_space(); res.height_without_bootstrap = res.height; std::shared_lock lock{m_bootstrap_daemon_mutex}; @@ -803,10 +803,10 @@ namespace cryptonote { namespace rpc { bns.blocks = bns::expiry_blocks(nettype, x.type,hf_version) ; switch (x.type) { - case bns::mapping_type::beldexnet: [[fallthrough]]; - case bns::mapping_type::beldexnet_2years: [[fallthrough]]; - case bns::mapping_type::beldexnet_5years: [[fallthrough]]; - case bns::mapping_type::beldexnet_10years: bns.type = "beldexnet"; break; + case bns::mapping_type::belnet: [[fallthrough]]; + case bns::mapping_type::belnet_2years: [[fallthrough]]; + case bns::mapping_type::belnet_5years: [[fallthrough]]; + case bns::mapping_type::belnet_10years: bns.type = "belnet"; break; case bns::mapping_type::session: bns.type = "session"; break; case bns::mapping_type::wallet: bns.type = "wallet"; break; @@ -3086,7 +3086,7 @@ namespace cryptonote { namespace rpc { auto& netconf = m_core.get_net_config(); m_core.get_master_node_list().access_proof(mn_info.pubkey, [&entry, &netconf](const auto &proof) { entry.master_node_version = proof.proof->version; - entry.beldexnet_version = proof.proof->beldexnet_version; + entry.belnet_version = proof.proof->belnet_version; entry.storage_server_version = proof.proof->storage_server_version; entry.public_ip = epee::string_tools::get_ip_string_from_int32(proof.proof->public_ip); entry.storage_port = proof.proof->storage_https_port; @@ -3103,10 +3103,10 @@ namespace cryptonote { namespace rpc { entry.storage_server_first_unreachable = reachable_to_time_t(proof.ss_reachable.first_unreachable, system_now, steady_now); entry.storage_server_last_unreachable = reachable_to_time_t(proof.ss_reachable.last_unreachable, system_now, steady_now); entry.storage_server_last_reachable = reachable_to_time_t(proof.ss_reachable.last_reachable, system_now, steady_now); - entry.beldexnet_reachable = !proof.beldexnet_reachable.unreachable_for(netconf.UPTIME_PROOF_VALIDITY - netconf.UPTIME_PROOF_FREQUENCY, steady_now); - entry.beldexnet_first_unreachable = reachable_to_time_t(proof.beldexnet_reachable.first_unreachable, system_now, steady_now); - entry.beldexnet_last_unreachable = reachable_to_time_t(proof.beldexnet_reachable.last_unreachable, system_now, steady_now); - entry.beldexnet_last_reachable = reachable_to_time_t(proof.beldexnet_reachable.last_reachable, system_now, steady_now); + entry.belnet_reachable = !proof.belnet_reachable.unreachable_for(netconf.UPTIME_PROOF_VALIDITY - netconf.UPTIME_PROOF_FREQUENCY, steady_now); + entry.belnet_first_unreachable = reachable_to_time_t(proof.belnet_reachable.first_unreachable, system_now, steady_now); + entry.belnet_last_unreachable = reachable_to_time_t(proof.belnet_reachable.last_unreachable, system_now, steady_now); + entry.belnet_last_reachable = reachable_to_time_t(proof.belnet_reachable.last_reachable, system_now, steady_now); master_nodes::participation_history const &checkpoint_participation = proof.checkpoint_participation; master_nodes::participation_history const &POS_participation = proof.POS_participation; @@ -3288,12 +3288,12 @@ namespace cryptonote { namespace rpc { }); } //------------------------------------------------------------------------------------------------------------------------------ - BELDEXNET_PING::response core_rpc_server::invoke(BELDEXNET_PING::request&& req, rpc_context context) + BELNET_PING::response core_rpc_server::invoke(BELNET_PING::request&& req, rpc_context context) { - m_core.beldexnet_version = req.version; - return handle_ping( - req.version, master_nodes::MIN_BELDEXNET_VERSION, - "Beldexnet", m_core.m_last_beldexnet_ping, m_core.get_net_config().UPTIME_PROOF_FREQUENCY, + m_core.belnet_version = req.version; + return handle_ping( + req.version, master_nodes::MIN_BELNET_VERSION, + "Belnet", m_core.m_last_belnet_ping, m_core.get_net_config().UPTIME_PROOF_FREQUENCY, [this](bool significant) { if (significant) m_core.reset_proof_interval(); }); } //------------------------------------------------------------------------------------------------------------------------------ @@ -3463,8 +3463,8 @@ namespace cryptonote { namespace rpc { } bool success = false; - if (req.type == "beldexnet") - success = m_core.get_master_node_list().set_beldexnet_peer_reachable(pubkey, req.passed); + if (req.type == "belnet") + success = m_core.get_master_node_list().set_belnet_peer_reachable(pubkey, req.passed); else if (req.type == "storage" || req.type == "reachability" /* TODO: old name, can be removed once SS no longer uses it */) success = m_core.get_master_node_list().set_storage_server_peer_reachable(pubkey, req.passed); else @@ -3522,7 +3522,7 @@ namespace cryptonote { namespace rpc { { types.push_back(static_cast(type)); if (!bns::mapping_type_allowed(hf_version, types.back())) - throw rpc_error{ERROR_WRONG_PARAM, "Invalid beldexnet type '" + std::to_string(type) + "'"}; + throw rpc_error{ERROR_WRONG_PARAM, "Invalid belnet type '" + std::to_string(type) + "'"}; } // This also takes 32 raw bytes, but that is undocumented (because it is painful to pass @@ -3628,7 +3628,7 @@ namespace cryptonote { namespace rpc { uint8_t hf_version = m_core.get_blockchain_storage().get_network_version(); auto type = static_cast(req.type); if (!bns::mapping_type_allowed(hf_version, type)) - throw rpc_error{ERROR_WRONG_PARAM, "Invalid beldexnet type '" + std::to_string(req.type) + "'"}; + throw rpc_error{ERROR_WRONG_PARAM, "Invalid belnet type '" + std::to_string(req.type) + "'"}; if (auto mapping = m_core.get_blockchain_storage().name_system_db().resolve( type, *name_hash, m_core.get_current_blockchain_height())) diff --git a/src/rpc/core_rpc_server.h b/src/rpc/core_rpc_server.h index 2b7e45cb1e..80736f1ed4 100755 --- a/src/rpc/core_rpc_server.h +++ b/src/rpc/core_rpc_server.h @@ -261,7 +261,7 @@ namespace cryptonote::rpc { GET_MASTER_NODES::response invoke(GET_MASTER_NODES::request&& req, rpc_context context); GET_STAKING_REQUIREMENT::response invoke(GET_STAKING_REQUIREMENT::request&& req, rpc_context context); STORAGE_SERVER_PING::response invoke(STORAGE_SERVER_PING::request&& req, rpc_context context); - BELDEXNET_PING::response invoke(BELDEXNET_PING::request&& req, rpc_context context); + BELNET_PING::response invoke(BELNET_PING::request&& req, rpc_context context); GET_CHECKPOINTS::response invoke(GET_CHECKPOINTS::request&& req, rpc_context context); GET_MN_STATE_CHANGES::response invoke(GET_MN_STATE_CHANGES::request&& req, rpc_context context); REPORT_PEER_STATUS::response invoke(REPORT_PEER_STATUS::request&& req, rpc_context context); diff --git a/src/rpc/core_rpc_server_commands_defs.cpp b/src/rpc/core_rpc_server_commands_defs.cpp index 055fa0cae8..41c4c10481 100755 --- a/src/rpc/core_rpc_server_commands_defs.cpp +++ b/src/rpc/core_rpc_server_commands_defs.cpp @@ -321,7 +321,7 @@ KV_SERIALIZE_MAP_CODE_BEGIN(GET_INFO::response) KV_SERIALIZE(start_time) KV_SERIALIZE(master_node) KV_SERIALIZE(last_storage_server_ping) - KV_SERIALIZE(last_beldexnet_ping) + KV_SERIALIZE(last_belnet_ping) KV_SERIALIZE(free_space) KV_SERIALIZE(offline) KV_SERIALIZE(untrusted) @@ -1094,7 +1094,7 @@ KV_SERIALIZE_MAP_CODE_BEGIN(GET_MASTER_NODES::requested_fields_t) KV_SERIALIZE(decommission_count) KV_SERIALIZE(earned_downtime_blocks) KV_SERIALIZE(master_node_version) - KV_SERIALIZE(beldexnet_version) + KV_SERIALIZE(belnet_version) KV_SERIALIZE(storage_server_version) KV_SERIALIZE(contributors) KV_SERIALIZE(total_contributed) @@ -1120,10 +1120,10 @@ KV_SERIALIZE_MAP_CODE_BEGIN(GET_MASTER_NODES::requested_fields_t) KV_SERIALIZE(storage_server_first_unreachable) KV_SERIALIZE(storage_server_last_unreachable) KV_SERIALIZE(storage_server_last_reachable) - KV_SERIALIZE(beldexnet_reachable) - KV_SERIALIZE(beldexnet_first_unreachable) - KV_SERIALIZE(beldexnet_last_unreachable) - KV_SERIALIZE(beldexnet_last_reachable) + KV_SERIALIZE(belnet_reachable) + KV_SERIALIZE(belnet_first_unreachable) + KV_SERIALIZE(belnet_last_unreachable) + KV_SERIALIZE(belnet_last_reachable) KV_SERIALIZE(checkpoint_participation) KV_SERIALIZE(POS_participation) KV_SERIALIZE(timestamp_participation) @@ -1160,7 +1160,7 @@ KV_SERIALIZE_MAP_CODE_BEGIN(GET_MASTER_NODES::response::entry) KV_SERIALIZE_ENTRY_FIELD_IF_REQUESTED(decommission_count); KV_SERIALIZE_ENTRY_FIELD_IF_REQUESTED(earned_downtime_blocks); KV_SERIALIZE_ENTRY_FIELD_IF_REQUESTED(master_node_version); - KV_SERIALIZE_ENTRY_FIELD_IF_REQUESTED(beldexnet_version) + KV_SERIALIZE_ENTRY_FIELD_IF_REQUESTED(belnet_version) KV_SERIALIZE_ENTRY_FIELD_IF_REQUESTED(storage_server_version) KV_SERIALIZE_ENTRY_FIELD_IF_REQUESTED(contributors); KV_SERIALIZE_ENTRY_FIELD_IF_REQUESTED(total_contributed); @@ -1180,10 +1180,10 @@ KV_SERIALIZE_MAP_CODE_BEGIN(GET_MASTER_NODES::response::entry) KV_SERIALIZE_ENTRY_FIELD_IF_REQUESTED(storage_server_first_unreachable) KV_SERIALIZE_ENTRY_FIELD_IF_REQUESTED(storage_server_last_unreachable) KV_SERIALIZE_ENTRY_FIELD_IF_REQUESTED(storage_server_last_reachable) - KV_SERIALIZE_ENTRY_FIELD_IF_REQUESTED(beldexnet_reachable); - KV_SERIALIZE_ENTRY_FIELD_IF_REQUESTED(beldexnet_first_unreachable) - KV_SERIALIZE_ENTRY_FIELD_IF_REQUESTED(beldexnet_last_unreachable) - KV_SERIALIZE_ENTRY_FIELD_IF_REQUESTED(beldexnet_last_reachable) + KV_SERIALIZE_ENTRY_FIELD_IF_REQUESTED(belnet_reachable); + KV_SERIALIZE_ENTRY_FIELD_IF_REQUESTED(belnet_first_unreachable) + KV_SERIALIZE_ENTRY_FIELD_IF_REQUESTED(belnet_last_unreachable) + KV_SERIALIZE_ENTRY_FIELD_IF_REQUESTED(belnet_last_reachable) KV_SERIALIZE_ENTRY_FIELD_IF_REQUESTED(checkpoint_participation); KV_SERIALIZE_ENTRY_FIELD_IF_REQUESTED(POS_participation); KV_SERIALIZE_ENTRY_FIELD_IF_REQUESTED(timestamp_participation); @@ -1225,7 +1225,7 @@ KV_SERIALIZE_MAP_CODE_BEGIN(STORAGE_SERVER_PING::request) KV_SERIALIZE_MAP_CODE_END() -KV_SERIALIZE_MAP_CODE_BEGIN(BELDEXNET_PING::request) +KV_SERIALIZE_MAP_CODE_BEGIN(BELNET_PING::request) KV_SERIALIZE(version); KV_SERIALIZE_MAP_CODE_END() diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h index a6e0ca9bc3..4c054ab92a 100755 --- a/src/rpc/core_rpc_server_commands_defs.h +++ b/src/rpc/core_rpc_server_commands_defs.h @@ -296,7 +296,7 @@ namespace rpc { uint64_t height; // The voting block height for the changing service node and validators uint32_t index; // The index of all tested nodes at the given height for which this state change applies std::vector voters; // The position of validators in the testing quorum who validated and voted for this state change. This typically contains just 7 required voter slots (of 10 eligible voters). - std::optional> reasons; // Reasons for the decommissioning/deregistration as reported by the voting quorum. This contains any reasons that all voters agreed on, one or more of: "uptime" (missing uptime proofs), "checkpoints" (missed checkpoint votes), "POS" (missing POS votes), "storage" (storage server pings failed), "beldexnet" (beldexnet router unreachable), "timecheck" (time sync pings failed), "timesync" (time was out of sync) + std::optional> reasons; // Reasons for the decommissioning/deregistration as reported by the voting quorum. This contains any reasons that all voters agreed on, one or more of: "uptime" (missing uptime proofs), "checkpoints" (missed checkpoint votes), "POS" (missing POS votes), "storage" (storage server pings failed), "belnet" (belnet router unreachable), "timecheck" (time sync pings failed), "timesync" (time was out of sync) std::optional> reasons_maybe; // If present, this contains any decomm/dereg reasons that were given by some but not all quorum voters KV_MAP_SERIALIZABLE }; @@ -305,8 +305,8 @@ namespace rpc { std::optional buy; // Provided and true iff this is an BNS buy record std::optional update; // Provided and true iff this is an BNS record update std::optional renew; // Provided and true iff this is an BNS record renewal - std::string type; // The BNS request type. For registrations: "beldexnet", "session", "wallet"; for a record update: "update" - std::optional blocks; // The registration length in blocks (only applies to beldexnet registrations; session/wallet registrations do not expire) + std::string type; // The BNS request type. For registrations: "belnet", "session", "wallet"; for a record update: "update" + std::optional blocks; // The registration length in blocks (only applies to belnet registrations; session/wallet registrations do not expire) std::string name_hash; // The hashed name of the record being purchased/updated, in hex (the actual name is not provided on the blockchain). std::optional prev_txid; // For an update, this points at the txid of the previous bns update transaction. std::optional value; // The encrypted value of the record, in hex. Note that this is encrypted using the actual name itself (*not* the hashed name). @@ -641,11 +641,11 @@ namespace rpc { uint64_t block_weight_limit; // Maximum allowed block weight. uint64_t block_size_median; // Median block size of latest 100 blocks. uint64_t block_weight_median; // Median block weight of latest 100 blocks. - std::array bns_counts; // BNS registration counts, [session, wallet, beldexnet] + std::array bns_counts; // BNS registration counts, [session, wallet, belnet] std::optional master_node; // Will be true if the node is running in --service-node mode. std::optional start_time; // Start time of the daemon, as UNIX time. std::optional last_storage_server_ping; // Last ping time of the storage server (0 if never or not running as a service node) - std::optional last_beldexnet_ping; // Last ping time of beldexnet (0 if never or not running as a service node) + std::optional last_belnet_ping; // Last ping time of belnet (0 if never or not running as a service node) std::optional free_space; // Available disk space on the node. bool offline; // States if the node is offline (`true`) or online (`false`). bool untrusted; // States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). @@ -2032,7 +2032,7 @@ namespace rpc { bool earned_downtime_blocks; bool master_node_version; - bool beldexnet_version; + bool belnet_version; bool storage_server_version; bool contributors; bool total_contributed; @@ -2053,10 +2053,10 @@ namespace rpc { bool storage_server_last_reachable; bool storage_server_last_unreachable; bool storage_server_first_unreachable; - bool beldexnet_reachable; - bool beldexnet_last_reachable; - bool beldexnet_last_unreachable; - bool beldexnet_first_unreachable; + bool belnet_reachable; + bool belnet_last_reachable; + bool belnet_last_unreachable; + bool belnet_first_unreachable; bool checkpoint_participation; bool POS_participation; bool timestamp_participation; @@ -2101,7 +2101,7 @@ namespace rpc { uint16_t last_decommission_reason_consensus_any; // The reason for the last decommission as voted by any MNs int64_t earned_downtime_blocks; // The number of blocks earned towards decommissioning, or the number of blocks remaining until deregistration if currently decommissioned std::array master_node_version; // The major, minor, patch version of the Master Node respectively. - std::array beldexnet_version; // The major, minor, patch version of the Master Node's beldexnet router. + std::array belnet_version; // The major, minor, patch version of the Master Node's belnet router. std::array storage_server_version; // The major, minor, patch version of the Master Node's storage server. std::vector contributors; // Array of contributors, contributing to this Master Node. uint64_t total_contributed; // The total amount of Beldex in atomic units contributed to this Master Node. @@ -2123,10 +2123,10 @@ namespace rpc { uint64_t storage_server_first_unreachable; // If the last test we received was a failure, this field contains the timestamp when failures started. Will be 0 if the last result was a success or the node has not yet been tested. (To disinguish between these cases check storage_server_last_reachable). uint64_t storage_server_last_unreachable; // The last time this service node's storage server failed a ping test (regardless of whether or not it is currently failing); 0 if it never failed a test since startup. uint64_t storage_server_last_reachable; // The last time we received a successful ping response for this storage server (whether or not it is currently failing); 0 if we have never received a success since startup. - bool beldexnet_reachable; // True if this beldexnet is currently passing tests for the purposes of MN node testing: true if the last test passed, or if it has been unreachable for less than an hour; false if it has been failing tests for more than an hour (and thus is considered unreachable). - uint64_t beldexnet_first_unreachable; // If the last test we received was a failure, this field contains the timestamp when failures started. Will be 0 if the last result was a success or the node has not yet been tested. (To disinguish between these cases check beldexnet_last_reachable). - uint64_t beldexnet_last_unreachable; // The last time this service node's beldexnet failed a reachable test (regardless of whether or not it is currently failing); 0 if it never failed a test since startup. - uint64_t beldexnet_last_reachable; // The last time we received a successful test response for this service node's beldexnet router (whether or not it is currently failing); 0 if we have never received a success since startup. + bool belnet_reachable; // True if this belnet is currently passing tests for the purposes of MN node testing: true if the last test passed, or if it has been unreachable for less than an hour; false if it has been failing tests for more than an hour (and thus is considered unreachable). + uint64_t belnet_first_unreachable; // If the last test we received was a failure, this field contains the timestamp when failures started. Will be 0 if the last result was a success or the node has not yet been tested. (To disinguish between these cases check belnet_last_reachable). + uint64_t belnet_last_unreachable; // The last time this service node's belnet failed a reachable test (regardless of whether or not it is currently failing); 0 if it never failed a test since startup. + uint64_t belnet_last_reachable; // The last time we received a successful test response for this service node's belnet router (whether or not it is currently failing); 0 if we have never received a success since startup. std::vector checkpoint_participation; // Of the last N checkpoints the Master Node is in a checkpointing quorum, record whether or not the Master Node voted to checkpoint a block std::vector POS_participation; // Of the last N POS blocks the Master Node is in a POS quorum, record whether or not the Master Node voted (participated) in that block @@ -2196,13 +2196,13 @@ namespace rpc { }; BELDEX_RPC_DOC_INTROSPECT - struct BELDEXNET_PING : RPC_COMMAND + struct BELNET_PING : RPC_COMMAND { - static constexpr auto names() { return NAMES("beldexnet_ping"); } + static constexpr auto names() { return NAMES("belnet_ping"); } struct request { - std::array version; // Beldexnet version + std::array version; // Belnet version KV_MAP_SERIALIZABLE }; @@ -2391,7 +2391,7 @@ namespace rpc { BELDEX_RPC_DOC_INTROSPECT - // Reports service node peer status (success/fail) from beldexnet and storage server. + // Reports service node peer status (success/fail) from belnet and storage server. struct REPORT_PEER_STATUS : RPC_COMMAND { // TODO: remove the `report_peer_storage_server_status` once we require a storage server version @@ -2400,7 +2400,7 @@ namespace rpc { struct request { - std::string type; // test type; currently supported are: "storage" and "beldexnet" for storage server and beldexnet tests, respectively. + std::string type; // test type; currently supported are: "storage" and "belnet" for storage server and belnet tests, respectively. std::string pubkey; // service node pubkey bool passed; // whether the node is passing the test @@ -2429,7 +2429,7 @@ namespace rpc { BELDEX_RPC_DOC_INTROSPECT // Get the name mapping for a Beldex Name Service entry. Beldex currently supports mappings - // for Session and Beldexnet. + // for Session and Belnet. struct BNS_NAMES_TO_OWNERS : PUBLIC { static constexpr auto names() { return NAMES("bns_names_to_owners", "lns_names_to_owners"); } @@ -2439,7 +2439,7 @@ namespace rpc { struct request_entry { std::string name_hash; // The 32-byte BLAKE2b hash of the name to resolve to a public key via Beldex Name Service. The value must be provided either in hex (64 hex digits) or base64 (44 characters with padding, or 43 characters without). - std::vector types; // If empty, query all types. Currently supported types are 0 (session) and 2 (beldexnet). In future updates more mapping types will be available. + std::vector types; // If empty, query all types. Currently supported types are 0 (session) and 2 (belnet). In future updates more mapping types will be available. KV_MAP_SERIALIZABLE }; @@ -2455,7 +2455,7 @@ namespace rpc { struct response_entry { uint64_t entry_index; // The index in request_entry's `entries` array that was resolved via Beldex Name Service. - bns::mapping_type type; // The type of Beldex Name Service entry that the owner owns: currently supported values are 0 (session), 1 (wallet) and 2 (beldexnet) + bns::mapping_type type; // The type of Beldex Name Service entry that the owner owns: currently supported values are 0 (session), 1 (wallet) and 2 (belnet) std::string name_hash; // The hash of the name that was queried, in base64 std::string owner; // The public key that purchased the Beldex Name Service entry. std::optional backup_owner; // The backup public key that the owner specified when purchasing the Beldex Name Service entry. Omitted if no backup owner. @@ -2495,7 +2495,7 @@ namespace rpc { struct response_entry { uint64_t request_index; // (Deprecated) The index in request's `entries` array that was resolved via Beldex Name Service. - bns::mapping_type type; // The category the Beldex Name Service entry belongs to; currently 0 for Session, 1 for Wallet and 2 for Beldexnet. + bns::mapping_type type; // The category the Beldex Name Service entry belongs to; currently 0 for Session, 1 for Wallet and 2 for Belnet. std::string name_hash; // The hash of the name that the owner purchased via Beldex Name Service in base64 std::string owner; // The backup public key specified by the owner that purchased the Beldex Name Service entry. std::optional backup_owner; // The backup public key specified by the owner that purchased the Beldex Name Service entry. Omitted if no backup owner. @@ -2541,7 +2541,7 @@ namespace rpc { struct request { - uint16_t type; // The BNS type (mandatory); currently supported values are: 0 = session, 1 = wallet, 2 = beldexnet. + uint16_t type; // The BNS type (mandatory); currently supported values are: 0 = session, 1 = wallet, 2 = belnet. std::string name_hash; // The 32-byte BLAKE2b hash of the name to look up, encoded as 64 hex digits or 44/43 base64 characters (with/without padding). KV_MAP_SERIALIZABLE @@ -2645,7 +2645,7 @@ namespace rpc { GET_MASTER_NODES, GET_MASTER_NODE_STATUS, STORAGE_SERVER_PING, - BELDEXNET_PING, + BELNET_PING, GET_STAKING_REQUIREMENT, GET_MASTER_NODE_BLACKLISTED_KEY_IMAGES, GET_OUTPUT_BLACKLIST, diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 3daed6acb0..f0650dbde0 100755 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -255,14 +255,14 @@ namespace const char* USAGE_REQUEST_STAKE_UNLOCK("request_stake_unlock "); const char* USAGE_PRINT_LOCKED_STAKES("print_locked_stakes"); - const char* USAGE_BNS_BUY_MAPPING("bns_buy_mapping [index=[,,...]] [] [type=session|beldexnet|beldexnet_2y|beldexnet_5y|beldexnet_10y] [owner=] [backup_owner=] "); - const char* USAGE_BNS_RENEW_MAPPING("bns_renew_mapping [index=[,,...]] [] [type=beldexnet|beldexnet_2y|beldexnet_5y|beldexnet_10y] "); - const char* USAGE_BNS_UPDATE_MAPPING("bns_update_mapping [index=[,,...]] [] [type=session|beldexnet] [owner=] [backup_owner=] [value=] [signature=] "); + const char* USAGE_BNS_BUY_MAPPING("bns_buy_mapping [index=[,,...]] [] [type=session|belnet|belnet_2y|belnet_5y|belnet_10y] [owner=] [backup_owner=] "); + const char* USAGE_BNS_RENEW_MAPPING("bns_renew_mapping [index=[,,...]] [] [type=belnet|belnet_2y|belnet_5y|belnet_10y] "); + const char* USAGE_BNS_UPDATE_MAPPING("bns_update_mapping [index=[,,...]] [] [type=session|belnet] [owner=] [backup_owner=] [value=] [signature=] "); - const char* USAGE_BNS_ENCRYPT("bns_encrypt [type=session|beldexnet] "); - const char* USAGE_BNS_MAKE_UPDATE_MAPPING_SIGNATURE("bns_make_update_mapping_signature [type=session|beldexnet] [owner=] [backup_owner=] [value=] "); + const char* USAGE_BNS_ENCRYPT("bns_encrypt [type=session|belnet] "); + const char* USAGE_BNS_MAKE_UPDATE_MAPPING_SIGNATURE("bns_make_update_mapping_signature [type=session|belnet] [owner=] [backup_owner=] [value=] "); const char* USAGE_BNS_BY_OWNER("bns_by_owner [ ...]"); - const char* USAGE_BNS_LOOKUP("bns_lookup [type=session|wallet|beldexnet] [ ...]"); + const char* USAGE_BNS_LOOKUP("bns_lookup [type=session|wallet|belnet] [ ...]"); #if defined (BELDEX_ENABLE_INTEGRATION_TEST_HOOKS) std::string input_line(const std::string &prompt, bool yesno = false) @@ -6476,7 +6476,7 @@ static std::optional guess_bns_type(tools::wallet2& wallet, s if (typestr.empty()) { if (tools::ends_with(name, ".beldex") && (tools::ends_with(value, ".beldex") || value.empty())) - return bns::mapping_type::beldexnet; + return bns::mapping_type::belnet; if (!tools::ends_with(name, ".beldex") && tools::starts_with(value, "05") && value.length() == 2*bns::SESSION_PUBLIC_KEY_BINARY_LENGTH) return bns::mapping_type::session; if (cryptonote::is_valid_address(std::string{value}, wallet.nettype())) @@ -6563,13 +6563,13 @@ bool simple_wallet::bns_buy_mapping(std::vector args) std::cout << boost::format(tr("Session Name: %s")) % name << std::endl; else if (*type == bns::mapping_type::wallet) std::cout << boost::format(tr("Wallet Name: %s")) % name << std::endl; - else if (bns::is_beldexnet_type(*type)) + else if (bns::is_belnet_type(*type)) { - std::cout << boost::format(tr("Beldexnet Name: %s")) % name << std::endl; + std::cout << boost::format(tr("Belnet Name: %s")) % name << std::endl; int years = - *type == bns::mapping_type::beldexnet_10years ? 10 : - *type == bns::mapping_type::beldexnet_5years ? 5 : - *type == bns::mapping_type::beldexnet_2years ? 2 : + *type == bns::mapping_type::belnet_10years ? 10 : + *type == bns::mapping_type::belnet_5years ? 5 : + *type == bns::mapping_type::belnet_2years ? 2 : 1; std::optional hf_version = m_wallet->get_hard_fork_version(); if (!hf_version) @@ -6663,15 +6663,15 @@ bool simple_wallet::bns_renew_mapping(std::vector args) dsts.push_back(info); std::cout << "\n" << tr("Renew Beldex Name System Record") << "\n\n"; - if (bns::is_beldexnet_type(type)) - std::cout << boost::format(tr("Beldexnet Name: %s")) % name << "\n"; + if (bns::is_belnet_type(type)) + std::cout << boost::format(tr("Belnet Name: %s")) % name << "\n"; else std::cout << boost::format(tr("Name: %s")) % name << "\n"; int years = 1; - if (type == bns::mapping_type::beldexnet_2years) years = 2; - else if (type == bns::mapping_type::beldexnet_5years) years = 5; - else if (type == bns::mapping_type::beldexnet_10years) years = 10; + if (type == bns::mapping_type::belnet_2years) years = 2; + else if (type == bns::mapping_type::belnet_5years) years = 5; + else if (type == bns::mapping_type::belnet_10years) years = 10; std::optional hf_version = m_wallet->get_hard_fork_version(); if (!hf_version) @@ -6776,8 +6776,8 @@ bool simple_wallet::bns_update_mapping(std::vector args) std::cout << std::endl << tr("Updating Beldex Name System Record") << std::endl << std::endl; if (type == bns::mapping_type::session) std::cout << boost::format(tr("Session Name: %s")) % name << std::endl; - else if (bns::is_beldexnet_type(type)) - std::cout << boost::format(tr("Beldexnet Name: %s")) % name << std::endl; + else if (bns::is_belnet_type(type)) + std::cout << boost::format(tr("Belnet Name: %s")) % name << std::endl; else if (type == bns::mapping_type::wallet) std::cout << boost::format(tr("Wallet Name: %s")) % name << std::endl; else diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index 6c0d79374c..0b9fde8c62 100755 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -1404,7 +1404,7 @@ namespace tools // The signature is derived from the hash of the previous txid blob and previous value blob of the mapping. By default this is signed using the wallet's spend key as an ed25519 keypair. std::vector bns_create_update_mapping_tx(bns::mapping_type type, std::string name, std::string const *value, std::string const *owner, std::string const *backup_owner, std::string const *signature, std::string *reason, uint32_t priority = 0, uint32_t account_index = 0, std::set subaddr_indices = {}, std::vector *response = {}); - // BNS renewal (for beldexnet registrations, not for session/wallet) + // BNS renewal (for belnet registrations, not for session/wallet) std::vector bns_create_renewal_tx(bns::mapping_type type, std::string name, std::string *reason, uint32_t priority = 0, uint32_t account_index = 0, std::set subaddr_indices = {}, std::vector *response = {}); // Generate just the signature required for putting into bns_update_mapping command in the wallet diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index e40d565582..8752e7c9ae 100755 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -3292,8 +3292,8 @@ namespace { { auto& entry = res.known_names.emplace_back(); auto& type = entry_types.emplace_back(details.type); - if (type > bns::mapping_type::beldexnet && type <= bns::mapping_type::beldexnet_10years) - type = bns::mapping_type::beldexnet; + if (type > bns::mapping_type::belnet && type <= bns::mapping_type::belnet_10years) + type = bns::mapping_type::belnet; entry.type = bns::mapping_type_str(type); entry.hashed = details.hashed_name; entry.name = details.name; diff --git a/src/wallet/wallet_rpc_server_commands_defs.h b/src/wallet/wallet_rpc_server_commands_defs.h index b285025be8..db818a1e0b 100755 --- a/src/wallet/wallet_rpc_server_commands_defs.h +++ b/src/wallet/wallet_rpc_server_commands_defs.h @@ -2217,11 +2217,11 @@ BELDEX_RPC_DOC_INTROSPECT static constexpr auto names() { return NAMES("bns_buy_mapping"); } static constexpr const char *description = -R"(Buy a Beldex Name System (BNS) mapping that maps a unique name to a Session ID or Beldexnet address. +R"(Buy a Beldex Name System (BNS) mapping that maps a unique name to a Session ID or Belnet address. -Currently supports Session, Beldexnet and Wallet registrations. Beldexnet registrations can be for 1, 2, 5, or 10 years by specifying a type value of "beldexnet", "beldexnet_2y", "beldexnet_5y", "beldexnet_10y". Session registrations do not expire. +Currently supports Session, Belnet and Wallet registrations. Belnet registrations can be for 1, 2, 5, or 10 years by specifying a type value of "belnet", "belnet_2y", "belnet_5y", "belnet_10y". Session registrations do not expire. -The owner of the BNS entry (by default, the purchasing wallet) will be permitted to submit BNS update transactions to the Beldex blockchain (for example to update a Session pubkey or the target Beldexnet address). You may change the primary owner or add a backup owner in the registration and can change them later with update transactions. Owner addresses can be either Beldex wallets, or generic ed25519 pubkeys (for advanced uses). +The owner of the BNS entry (by default, the purchasing wallet) will be permitted to submit BNS update transactions to the Beldex blockchain (for example to update a Session pubkey or the target Belnet address). You may change the primary owner or add a backup owner in the registration and can change them later with update transactions. Owner addresses can be either Beldex wallets, or generic ed25519 pubkeys (for advanced uses). For Session, the recommended owner or backup owner is the ed25519 public key of the user's Session ID. @@ -2231,11 +2231,11 @@ For more information on updating and signing see the BNS_UPDATE_MAPPING document struct request { - std::string type; // The mapping type: "session", "beldexnet", "beldexnet_2y", "beldexnet_5y", "beldexnet_10y", "wallet". + std::string type; // The mapping type: "session", "belnet", "belnet_2y", "belnet_5y", "belnet_10y", "wallet". std::string owner; // (Optional): The ed25519 public key or wallet address that has authority to update the mapping. std::string backup_owner; // (Optional): The secondary, backup public key that has authority to update the mapping. std::string name; // The name to purchase via Beldex Name Service - std::string value; // The value that the name maps to via Beldex Name Service, (i.e. For Session: [display name->session public key], for wallets: [name->wallet address], for Beldexnet: [name->domain name]). + std::string value; // The value that the name maps to via Beldex Name Service, (i.e. For Session: [display name->session public key], for wallets: [name->wallet address], for Belnet: [name->domain name]). uint32_t account_index; // (Optional) Transfer from this account index. (Defaults to 0) std::set subaddr_indices; // (Optional) Transfer from this set of subaddresses. (Defaults to 0) @@ -2264,19 +2264,19 @@ For more information on updating and signing see the BNS_UPDATE_MAPPING document }; BELDEX_RPC_DOC_INTROSPECT - // Renew an active beldexnet BNS registration + // Renew an active belnet BNS registration struct BNS_RENEW_MAPPING : RESTRICTED { static constexpr auto names() { return NAMES("bns_renew_mapping"); } static constexpr const char *description = -R"(Renews a Beldex Name System beldexnet mapping by adding to the existing expiry time. +R"(Renews a Beldex Name System belnet mapping by adding to the existing expiry time. -The renewal can be for 1, 2, 5, or 10 years by specifying a `type` value of "beldexnet_2y", "beldexnet_10y", etc.)"; +The renewal can be for 1, 2, 5, or 10 years by specifying a `type` value of "belnet_2y", "belnet_10y", etc.)"; struct request { - std::string type; // The mapping type, "beldexnet" (1-year), or "beldexnet_2y", "beldexnet_5y", "beldexnet_10y" for multi-year registrations. + std::string type; // The mapping type, "belnet" (1-year), or "belnet_2y", "belnet_5y", "belnet_10y" for multi-year registrations. std::string name; // The name to update uint32_t account_index; // (Optional) Transfer from this account index. (Defaults to 0) @@ -2310,7 +2310,7 @@ If signing is performed externally then you must first encrypt the `value` (if b struct request { - std::string type; // The mapping type, "session", "beldexnet", or "wallet". + std::string type; // The mapping type, "session", "belnet", or "wallet". std::string name; // The name to update via Beldex Name Service std::string value; // (Optional): The new value that the name maps to via Beldex Name Service. If not specified or given the empty string "", then the mapping's value remains unchanged. If using a `signature` then this value (if non-empty) must be already encrypted. std::string owner; // (Optional): The new owner of the mapping. If not specified or given the empty string "", then the mapping's owner remains unchanged. @@ -2356,7 +2356,7 @@ This command is only required if the open wallet is one of the owners of a BNS r struct request { - std::string type; // The mapping type, currently we support "session", "beldexnet" and "wallet" mappings. + std::string type; // The mapping type, currently we support "session", "belnet" and "wallet" mappings. std::string name; // The desired name to update via Beldex Name Service std::string encrypted_value; // (Optional): The new encrypted value that the name maps to via Beldex Name Service. If not specified or given the empty string "", then the mapping's value remains unchanged. std::string owner; // (Optional): The new owner of the mapping. If not specified or given the empty string "", then the mapping's owner remains unchanged. @@ -2382,7 +2382,7 @@ This command is only required if the open wallet is one of the owners of a BNS r struct request { - std::string type; // The mapping type, "session", "beldexnet" or "wallet". + std::string type; // The mapping type, "session", "belnet" or "wallet". std::string name; // The desired name to hash KV_MAP_SERIALIZABLE @@ -2406,7 +2406,7 @@ This command is only required if the open wallet is one of the owners of a BNS r struct known_record { - std::string type; // The mapping type, "session" or "beldexnet". + std::string type; // The mapping type, "session" or "belnet". std::string hashed; // The hashed name (in base64) std::string name; // The plaintext name std::string owner; // The public key that purchased the Beldex Name Service entry. @@ -2444,7 +2444,7 @@ This command is only required if the open wallet is one of the owners of a BNS r struct record { - std::string type; // The BNS type (mandatory); currently support values are: "session", "beldexnet" + std::string type; // The BNS type (mandatory); currently support values are: "session", "belnet" std::string name; // The (unhashed) name of the record KV_MAP_SERIALIZABLE @@ -2469,7 +2469,7 @@ This command is only required if the open wallet is one of the owners of a BNS r struct request { std::string name; // The BNS name with which to encrypt the value. - std::string type; // The mapping type: "session" or "beldexnet". + std::string type; // The mapping type: "session" or "belnet". std::string value; // The value to be encrypted. KV_MAP_SERIALIZABLE @@ -2492,7 +2492,7 @@ This command is only required if the open wallet is one of the owners of a BNS r struct request { std::string name; // The BNS name of the given encrypted value. - std::string type; // The mapping type: "session" or "beldexnet". + std::string type; // The mapping type: "session" or "belnet". std::string encrypted_value; // The encrypted value represented in hex. KV_MAP_SERIALIZABLE diff --git a/tests/core_tests/beldex_tests.cpp b/tests/core_tests/beldex_tests.cpp index 0baa326901..077fcfb7b3 100755 --- a/tests/core_tests/beldex_tests.cpp +++ b/tests/core_tests/beldex_tests.cpp @@ -1080,7 +1080,7 @@ struct bns_keys_t { bns::generic_owner owner; bns::mapping_value wallet_value; // NOTE: this field is the binary (value) part of the name -> (value) mapping - bns::mapping_value beldexnet_value; + bns::mapping_value belnet_value; bns::mapping_value session_value; }; @@ -1090,22 +1090,22 @@ static bns_keys_t make_bns_keys(cryptonote::account_base const &src) result.owner = bns::make_monero_owner(src.get_keys().m_account_address, false /*is_subaddress*/); result.session_value.len = bns::SESSION_PUBLIC_KEY_BINARY_LENGTH; result.wallet_value.len = sizeof(src.get_keys().m_account_address); - result.beldexnet_value.len = sizeof(result.owner.wallet.address.m_spend_public_key); + result.belnet_value.len = sizeof(result.owner.wallet.address.m_spend_public_key); - memcpy(&result.session_value.buffer[0] + 1, &result.owner.wallet.address.m_spend_public_key, result.beldexnet_value.len); + memcpy(&result.session_value.buffer[0] + 1, &result.owner.wallet.address.m_spend_public_key, result.belnet_value.len); memcpy(&result.wallet_value.buffer[0], (char *)&src.get_keys().m_account_address, result.wallet_value.len); // NOTE: Just needs a 32 byte key. Reuse spend key - memcpy(&result.beldexnet_value.buffer[0], (char *)&result.owner.wallet.address.m_spend_public_key, result.beldexnet_value.len); + memcpy(&result.belnet_value.buffer[0], (char *)&result.owner.wallet.address.m_spend_public_key, result.belnet_value.len); result.session_value.buffer[0] = 5; // prefix with 0x05 return result; } -// beldexnet FAKECHAIN BNS expiry blocks -uint64_t beldexnet_expiry(bns::mapping_type type) { +// belnet FAKECHAIN BNS expiry blocks +uint64_t belnet_expiry(bns::mapping_type type) { auto exp = bns::expiry_blocks(cryptonote::FAKECHAIN, type,0); - if (!exp) throw std::logic_error{"test suite bug: beldexnet_expiry called with non-beldexnet mapping type"}; + if (!exp) throw std::logic_error{"test suite bug: belnet_expiry called with non-belnet mapping type"}; return *exp; } @@ -1119,19 +1119,19 @@ bool beldex_name_system_expiration::generate(std::vector &even gen.add_mined_money_unlock_blocks(); bns_keys_t miner_key = make_bns_keys(miner); - for (auto mapping_type = bns::mapping_type::beldexnet; - mapping_type <= bns::mapping_type::beldexnet_10years; + for (auto mapping_type = bns::mapping_type::belnet; + mapping_type <= bns::mapping_type::belnet_10years; mapping_type = static_cast(static_cast(mapping_type) + 1)) { std::string const name = "mydomain.beldex"; if (bns::mapping_type_allowed(gen.hardfork(), mapping_type)) { - cryptonote::transaction tx = gen.create_and_add_beldex_name_system_tx(miner, gen.hardfork(), mapping_type, name, miner_key.beldexnet_value); + cryptonote::transaction tx = gen.create_and_add_beldex_name_system_tx(miner, gen.hardfork(), mapping_type, name, miner_key.belnet_value); gen.create_and_add_next_block({tx}); crypto::hash tx_hash = cryptonote::get_transaction_hash(tx); uint64_t height_of_bns_entry = gen.height(); - uint64_t expected_expiry_block = height_of_bns_entry + beldexnet_expiry(mapping_type); + uint64_t expected_expiry_block = height_of_bns_entry + belnet_expiry(mapping_type); std::string name_hash = bns::name_to_base64_hash(name); beldex_register_callback(events, "check_bns_entries", [=](cryptonote::core &c, size_t ev_index) @@ -1146,7 +1146,7 @@ bool beldex_name_system_expiration::generate(std::vector &even << " == " << owner.address.to_string(cryptonote::FAKECHAIN)); bns::mapping_record record = bns_db.get_mapping(mapping_type, name_hash); - CHECK_TEST_CONDITION(verify_bns_mapping_record(perr_context, record, bns::mapping_type::beldexnet, name, miner_key.beldexnet_value, height_of_bns_entry, height_of_bns_entry + beldexnet_expiry(mapping_type), tx_hash, miner_key.owner, {} /*backup_owner*/)); + CHECK_TEST_CONDITION(verify_bns_mapping_record(perr_context, record, bns::mapping_type::belnet, name, miner_key.belnet_value, height_of_bns_entry, height_of_bns_entry + belnet_expiry(mapping_type), tx_hash, miner_key.owner, {} /*backup_owner*/)); return true; }); @@ -1167,14 +1167,14 @@ bool beldex_name_system_expiration::generate(std::vector &even << " == " << owner.address.to_string(cryptonote::FAKECHAIN)); bns::mapping_record record = bns_db.get_mapping(mapping_type, name_hash); - CHECK_TEST_CONDITION(verify_bns_mapping_record(perr_context, record, bns::mapping_type::beldexnet, name, miner_key.beldexnet_value, height_of_bns_entry, height_of_bns_entry + beldexnet_expiry(mapping_type), tx_hash, miner_key.owner, {} /*backup_owner*/)); + CHECK_TEST_CONDITION(verify_bns_mapping_record(perr_context, record, bns::mapping_type::belnet, name, miner_key.belnet_value, height_of_bns_entry, height_of_bns_entry + belnet_expiry(mapping_type), tx_hash, miner_key.owner, {} /*backup_owner*/)); CHECK_EQ(record.active(blockchain_height), false); return true; }); } else { - cryptonote::transaction tx = gen.create_beldex_name_system_tx(miner, gen.hardfork(), mapping_type, name, miner_key.beldexnet_value); + cryptonote::transaction tx = gen.create_beldex_name_system_tx(miner, gen.hardfork(), mapping_type, name, miner_key.belnet_value); gen.add_tx(tx, false /*can_be_added_to_blockchain*/, "Can not add BNS TX that uses disallowed type"); } } @@ -1219,21 +1219,21 @@ bool beldex_name_system_get_mappings_by_owner::generate(std::vector(3928); - crypto::hash session_tx_hash = {}, beldexnet_tx_hash = {}; + crypto::hash session_tx_hash = {}, belnet_tx_hash = {}; { // NOTE: Allow duplicates with the same name but different type cryptonote::transaction bar = gen.create_and_add_beldex_name_system_tx(miner, gen.hardfork(), bns::mapping_type::session, session_name, bob_key.session_value); @@ -1440,11 +1440,11 @@ bool beldex_name_system_handles_duplicate_in_bns_db::generate(std::vector txs; txs.push_back(bar); - if (bns::mapping_type_allowed(gen.hardfork(), bns::mapping_type::beldexnet)) + if (bns::mapping_type_allowed(gen.hardfork(), bns::mapping_type::belnet)) { - cryptonote::transaction bar3 = gen.create_and_add_beldex_name_system_tx(miner, gen.hardfork(), bns::mapping_type::beldexnet_2years, session_name, miner_key.beldexnet_value); + cryptonote::transaction bar3 = gen.create_and_add_beldex_name_system_tx(miner, gen.hardfork(), bns::mapping_type::belnet_2years, session_name, miner_key.belnet_value); txs.push_back(bar3); - beldexnet_tx_hash = get_transaction_hash(bar3); + belnet_tx_hash = get_transaction_hash(bar3); } gen.create_and_add_next_block(txs); @@ -1474,10 +1474,10 @@ bool beldex_name_system_handles_duplicate_in_bns_db::generate(std::vector &eve // NOTE: Generate the first round of ONS transactions belonging to miner uint64_t first_ons_height = 0; - std::string const beldexnet_name1 = "website.beldex"; + std::string const belnet_name1 = "website.beldex"; std::string const wallet_name1 = "MyWallet"; std::string const session_name1 = "I-Like-beldex"; - crypto::hash session_tx_hash1 = {}, wallet_tx_hash1 = {}, beldexnet_tx_hash1 = {}; + crypto::hash session_tx_hash1 = {}, wallet_tx_hash1 = {}, belnet_tx_hash1 = {}; { // NOTE: Generate and add the (transactions + block) to the blockchain { @@ -1693,11 +1693,11 @@ bool beldex_name_system_large_reorg::generate(std::vector &eve wallet_tx_hash1 = get_transaction_hash(wallet_tx); } - if (bns::mapping_type_allowed(gen.hardfork(), bns::mapping_type::beldexnet_10years)) + if (bns::mapping_type_allowed(gen.hardfork(), bns::mapping_type::belnet_10years)) { - cryptonote::transaction beldexnet_tx = gen.create_and_add_beldex_name_system_tx(miner, gen.hardfork(), bns::mapping_type::beldexnet_10years, beldexnet_name1, miner_key.beldexnet_value); - txs.push_back(beldexnet_tx); - beldexnet_tx_hash1 = get_transaction_hash(beldexnet_tx); + cryptonote::transaction belnet_tx = gen.create_and_add_beldex_name_system_tx(miner, gen.hardfork(), bns::mapping_type::belnet_10years, belnet_name1, miner_key.belnet_value); + txs.push_back(belnet_tx); + belnet_tx_hash1 = get_transaction_hash(belnet_tx); } gen.create_and_add_next_block(txs); } @@ -1713,15 +1713,15 @@ bool beldex_name_system_large_reorg::generate(std::vector &eve size_t expected_size = 1; auto netv = get_network_version(c.get_nettype(), c.get_current_blockchain_height()); if (bns::mapping_type_allowed(netv, bns::mapping_type::wallet)) expected_size += 1; - if (bns::mapping_type_allowed(netv, bns::mapping_type::beldexnet)) expected_size += 1; + if (bns::mapping_type_allowed(netv, bns::mapping_type::belnet)) expected_size += 1; CHECK_EQ(records.size(), expected_size); for (bns::mapping_record const &record : records) { if (record.type == bns::mapping_type::session) CHECK_TEST_CONDITION(verify_bns_mapping_record(perr_context, record, bns::mapping_type::session, session_name1, miner_key.session_value, first_ons_height, std::nullopt, session_tx_hash1, miner_key.owner, {} /*backup_owner*/)); - else if (record.type == bns::mapping_type::beldexnet) - CHECK_TEST_CONDITION(verify_bns_mapping_record(perr_context, record, bns::mapping_type::beldexnet, beldexnet_name1, miner_key.beldexnet_value, first_ons_height, first_ons_height + beldexnet_expiry(bns::mapping_type::beldexnet_10years), beldexnet_tx_hash1, miner_key.owner, {} /*backup_owner*/)); + else if (record.type == bns::mapping_type::belnet) + CHECK_TEST_CONDITION(verify_bns_mapping_record(perr_context, record, bns::mapping_type::belnet, belnet_name1, miner_key.belnet_value, first_ons_height, first_ons_height + belnet_expiry(bns::mapping_type::belnet_10years), belnet_tx_hash1, miner_key.owner, {} /*backup_owner*/)); else if (record.type == bns::mapping_type::wallet) CHECK_TEST_CONDITION(verify_bns_mapping_record(perr_context, record, bns::mapping_type::wallet, wallet_name1, miner_key.wallet_value, first_ons_height, std::nullopt, wallet_tx_hash1, miner_key.owner, {} /*backup_owner*/)); else @@ -1733,22 +1733,22 @@ bool beldex_name_system_large_reorg::generate(std::vector &eve }); } - // NOTE: Generate and add the second round of (transactions + block) to the blockchain, renew beldexnet and add bob's session, update miner's session value to other's session value + // NOTE: Generate and add the second round of (transactions + block) to the blockchain, renew belnet and add bob's session, update miner's session value to other's session value cryptonote::account_base const other = gen.add_account(); bns_keys_t const other_key = make_bns_keys(other); uint64_t second_ons_height = 0; { std::string const bob_session_name1 = "I-Like-Session"; - crypto::hash session_tx_hash2 = {}, beldexnet_tx_hash2 = {}, session_tx_hash3; + crypto::hash session_tx_hash2 = {}, belnet_tx_hash2 = {}, session_tx_hash3; { std::vector txs; txs.push_back(gen.create_and_add_beldex_name_system_tx(bob, gen.hardfork(), bns::mapping_type::session, bob_session_name1, bob_key.session_value)); session_tx_hash2 = cryptonote::get_transaction_hash(txs[0]); - if (bns::mapping_type_allowed(gen.hardfork(), bns::mapping_type::beldexnet)) + if (bns::mapping_type_allowed(gen.hardfork(), bns::mapping_type::belnet)) { - txs.push_back(gen.create_and_add_beldex_name_system_tx_renew(miner, gen.hardfork(), bns::mapping_type::beldexnet_5years, beldexnet_name1)); - beldexnet_tx_hash2 = cryptonote::get_transaction_hash(txs.back()); + txs.push_back(gen.create_and_add_beldex_name_system_tx_renew(miner, gen.hardfork(), bns::mapping_type::belnet_5years, belnet_name1)); + belnet_tx_hash2 = cryptonote::get_transaction_hash(txs.back()); } txs.push_back(gen.create_and_add_beldex_name_system_tx_update(miner, gen.hardfork(), bns::mapping_type::session, session_name1, &other_key.session_value)); @@ -1771,8 +1771,8 @@ bool beldex_name_system_large_reorg::generate(std::vector &eve { if (record.type == bns::mapping_type::session) CHECK_TEST_CONDITION(verify_bns_mapping_record(perr_context, record, bns::mapping_type::session, session_name1, other_key.session_value, second_ons_height, std::nullopt, session_tx_hash3, miner_key.owner, {} /*backup_owner*/)); - else if (record.type == bns::mapping_type::beldexnet) - CHECK_TEST_CONDITION(verify_bns_mapping_record(perr_context, record, bns::mapping_type::beldexnet, beldexnet_name1, miner_key.beldexnet_value, second_ons_height, first_ons_height + beldexnet_expiry(bns::mapping_type::beldexnet_5years) + beldexnet_expiry(bns::mapping_type::beldexnet_10years), beldexnet_tx_hash2, miner_key.owner, {} /*backup_owner*/)); + else if (record.type == bns::mapping_type::belnet) + CHECK_TEST_CONDITION(verify_bns_mapping_record(perr_context, record, bns::mapping_type::belnet, belnet_name1, miner_key.belnet_value, second_ons_height, first_ons_height + belnet_expiry(bns::mapping_type::belnet_5years) + belnet_expiry(bns::mapping_type::belnet_10years), belnet_tx_hash2, miner_key.owner, {} /*backup_owner*/)); else if (record.type == bns::mapping_type::wallet) CHECK_TEST_CONDITION(verify_bns_mapping_record(perr_context, record, bns::mapping_type::wallet, wallet_name1, miner_key.wallet_value, first_ons_height, std::nullopt, wallet_tx_hash1, miner_key.owner, {} /*backup_owner*/)); else @@ -1820,15 +1820,15 @@ bool beldex_name_system_large_reorg::generate(std::vector &eve size_t expected_size = 1; auto netv = get_network_version(c.get_nettype(), c.get_current_blockchain_height()); if (bns::mapping_type_allowed(netv, bns::mapping_type::wallet)) expected_size += 1; - if (bns::mapping_type_allowed(netv, bns::mapping_type::beldexnet)) expected_size += 1; + if (bns::mapping_type_allowed(netv, bns::mapping_type::belnet)) expected_size += 1; CHECK_EQ(records.size(), expected_size); for (bns::mapping_record const &record : records) { if (record.type == bns::mapping_type::session) CHECK_TEST_CONDITION(verify_bns_mapping_record(perr_context, record, bns::mapping_type::session, session_name1, miner_key.session_value, first_ons_height, std::nullopt, session_tx_hash1, miner_key.owner, {} /*backup_owner*/)); - else if (record.type == bns::mapping_type::beldexnet) - CHECK_TEST_CONDITION(verify_bns_mapping_record(perr_context, record, bns::mapping_type::beldexnet, beldexnet_name1, miner_key.beldexnet_value, first_ons_height, first_ons_height + beldexnet_expiry(bns::mapping_type::beldexnet_10years), beldexnet_tx_hash1, miner_key.owner, {} /*backup_owner*/)); + else if (record.type == bns::mapping_type::belnet) + CHECK_TEST_CONDITION(verify_bns_mapping_record(perr_context, record, bns::mapping_type::belnet, belnet_name1, miner_key.belnet_value, first_ons_height, first_ons_height + belnet_expiry(bns::mapping_type::belnet_10years), belnet_tx_hash1, miner_key.owner, {} /*backup_owner*/)); else if (record.type == bns::mapping_type::wallet) CHECK_TEST_CONDITION(verify_bns_mapping_record(perr_context, record, bns::mapping_type::wallet, wallet_name1, miner_key.wallet_value, first_ons_height, std::nullopt, wallet_tx_hash1, miner_key.owner, {} /*backup_owner*/)); else @@ -1872,7 +1872,7 @@ bool beldex_name_system_name_renewal::generate(std::vector &ev beldex_chain_generator gen(events, hard_forks); cryptonote::account_base miner = gen.first_miner_; - if (!bns::mapping_type_allowed(hard_forks.back().version, bns::mapping_type::beldexnet)) + if (!bns::mapping_type_allowed(hard_forks.back().version, bns::mapping_type::belnet)) return true; { @@ -1882,7 +1882,7 @@ bool beldex_name_system_name_renewal::generate(std::vector &ev bns_keys_t miner_key = make_bns_keys(miner); std::string const name = "mydomain.beldex"; - cryptonote::transaction tx = gen.create_and_add_beldex_name_system_tx(miner, gen.hardfork(), bns::mapping_type::beldexnet, name, miner_key.beldexnet_value); + cryptonote::transaction tx = gen.create_and_add_beldex_name_system_tx(miner, gen.hardfork(), bns::mapping_type::belnet, name, miner_key.belnet_value); gen.create_and_add_next_block({tx}); crypto::hash prev_txid = get_transaction_hash(tx); @@ -1901,21 +1901,21 @@ bool beldex_name_system_name_renewal::generate(std::vector &ev << " == " << owner.address.to_string(cryptonote::FAKECHAIN)); std::string name_hash = bns::name_to_base64_hash(name); - bns::mapping_record record = bns_db.get_mapping(bns::mapping_type::beldexnet, name_hash); - CHECK_TEST_CONDITION(verify_bns_mapping_record(perr_context, record, bns::mapping_type::beldexnet, name, miner_key.beldexnet_value, height_of_ons_entry, height_of_ons_entry + beldexnet_expiry(bns::mapping_type::beldexnet), prev_txid, miner_key.owner, {} /*backup_owner*/)); + bns::mapping_record record = bns_db.get_mapping(bns::mapping_type::belnet, name_hash); + CHECK_TEST_CONDITION(verify_bns_mapping_record(perr_context, record, bns::mapping_type::belnet, name, miner_key.belnet_value, height_of_ons_entry, height_of_ons_entry + belnet_expiry(bns::mapping_type::belnet), prev_txid, miner_key.owner, {} /*backup_owner*/)); return true; }); gen.create_and_add_next_block(); - // Renew the beldexnet entry a few times - cryptonote::transaction renew_tx = gen.create_and_add_beldex_name_system_tx_renew(miner, gen.hardfork(), bns::mapping_type::beldexnet_5years, name); + // Renew the belnet entry a few times + cryptonote::transaction renew_tx = gen.create_and_add_beldex_name_system_tx_renew(miner, gen.hardfork(), bns::mapping_type::belnet_5years, name); gen.create_and_add_next_block({renew_tx}); - renew_tx = gen.create_and_add_beldex_name_system_tx_renew(miner, gen.hardfork(), bns::mapping_type::beldexnet_10years, name); + renew_tx = gen.create_and_add_beldex_name_system_tx_renew(miner, gen.hardfork(), bns::mapping_type::belnet_10years, name); gen.create_and_add_next_block({renew_tx}); - renew_tx = gen.create_and_add_beldex_name_system_tx_renew(miner, gen.hardfork(), bns::mapping_type::beldexnet_2years, name); + renew_tx = gen.create_and_add_beldex_name_system_tx_renew(miner, gen.hardfork(), bns::mapping_type::belnet_2years, name); gen.create_and_add_next_block({renew_tx}); - renew_tx = gen.create_and_add_beldex_name_system_tx_renew(miner, gen.hardfork(), bns::mapping_type::beldexnet, name); + renew_tx = gen.create_and_add_beldex_name_system_tx_renew(miner, gen.hardfork(), bns::mapping_type::belnet, name); gen.create_and_add_next_block({renew_tx}); crypto::hash txid = cryptonote::get_transaction_hash(renew_tx); uint64_t renewal_height = gen.height(); @@ -1933,15 +1933,15 @@ bool beldex_name_system_name_renewal::generate(std::vector &ev << " == " << owner.address.to_string(cryptonote::FAKECHAIN)); std::string name_hash = bns::name_to_base64_hash(name); - bns::mapping_record record = bns_db.get_mapping(bns::mapping_type::beldexnet, name_hash); - CHECK_TEST_CONDITION(verify_bns_mapping_record(perr_context, record, bns::mapping_type::beldexnet, name, miner_key.beldexnet_value, renewal_height, + bns::mapping_record record = bns_db.get_mapping(bns::mapping_type::belnet, name_hash); + CHECK_TEST_CONDITION(verify_bns_mapping_record(perr_context, record, bns::mapping_type::belnet, name, miner_key.belnet_value, renewal_height, // Original registration: - height_of_ons_entry + beldexnet_expiry(bns::mapping_type::beldexnet) + height_of_ons_entry + belnet_expiry(bns::mapping_type::belnet) // The renewals: - + beldexnet_expiry(bns::mapping_type::beldexnet_5years) - + beldexnet_expiry(bns::mapping_type::beldexnet_10years) - + beldexnet_expiry(bns::mapping_type::beldexnet_2years) - + beldexnet_expiry(bns::mapping_type::beldexnet), + + belnet_expiry(bns::mapping_type::belnet_5years) + + belnet_expiry(bns::mapping_type::belnet_10years) + + belnet_expiry(bns::mapping_type::belnet_2years) + + belnet_expiry(bns::mapping_type::belnet), txid, miner_key.owner, {} /*backup_owner*/)); return true; }); @@ -1995,15 +1995,15 @@ bool beldex_name_system_name_value_max_lengths::generate(std::vector &even } bns_keys_t ons_keys = make_bns_keys(miner); - bns::mapping_type const types[] = {bns::mapping_type::session, bns::mapping_type::wallet, bns::mapping_type::beldexnet}; + bns::mapping_type const types[] = {bns::mapping_type::session, bns::mapping_type::wallet, bns::mapping_type::belnet}; for (int i = 0; i < 2; i++) { bool under_burn = (i == 0); @@ -2539,10 +2539,10 @@ bool beldex_name_system_wrong_burn::generate(std::vector &even value = ons_keys.wallet_value; name = "my-friendly-wallet-name"; } - else if (type == bns::mapping_type::beldexnet) + else if (type == bns::mapping_type::belnet) { - value = ons_keys.beldexnet_value; - name = "myfriendlybeldexnetname.beldex"; + value = ons_keys.belnet_value; + name = "myfriendlybelnetname.beldex"; } else assert("Unhandled type enum" == nullptr); diff --git a/tests/network_tests/daemons.py b/tests/network_tests/daemons.py index 56c3c5dd65..33e68da7a4 100755 --- a/tests/network_tests/daemons.py +++ b/tests/network_tests/daemons.py @@ -211,12 +211,12 @@ def txpool_hashes(self): return [x['id_hash'] for x in self.rpc("/get_transaction_pool").json()['transactions']] - def ping(self, *, storage=True, beldexnet=True): - """Sends fake storage server and beldexnet pings to the running beldexd""" + def ping(self, *, storage=True, belnet=True): + """Sends fake storage server and belnet pings to the running beldexd""" if storage: self.json_rpc("storage_server_ping", { "version_major": 9, "version_minor": 9, "version_patch": 9 }) - if beldexnet: - self.json_rpc("beldexnet_ping", { "version": [9,9,9] }) + if belnet: + self.json_rpc("belnet_ping", { "version": [9,9,9] }) def p2p_resync(self): diff --git a/tests/network_tests/master_node_network.py b/tests/network_tests/master_node_network.py index cde73a76b3..551d41b61c 100755 --- a/tests/network_tests/master_node_network.py +++ b/tests/network_tests/master_node_network.py @@ -148,7 +148,7 @@ def __init__(self, datadir, *, binpath='../../build/bin', sns=20, nodes=3): self.print_wallet_balances() - vprint("Sending fake beldexnet/ss pings") + vprint("Sending fake belnet/ss pings") for mn in self.mns: mn.ping() diff --git a/tests/unit_tests/beldex_name_system.cpp b/tests/unit_tests/beldex_name_system.cpp index 50248e3a0e..96bf80c15b 100755 --- a/tests/unit_tests/beldex_name_system.cpp +++ b/tests/unit_tests/beldex_name_system.cpp @@ -12,7 +12,7 @@ TEST(beldex_name_system, name_tests) bool allowed; }; - name_test const beldexnet_names[] = { + name_test const belnet_names[] = { {"a.beldex", true}, {"domain.beldex", true}, {"xn--tda.beldex", true}, // ΓΌ @@ -72,8 +72,8 @@ TEST(beldex_name_system, name_tests) { auto type = static_cast(type16); if (type == bns::mapping_type::wallet) continue; // Not yet supported - name_test const *names = bns::is_beldexnet_type(type) ? beldexnet_names : session_wallet_names; - size_t names_count = bns::is_beldexnet_type(type) ? beldex::char_count(beldexnet_names) : beldex::char_count(session_wallet_names); + name_test const *names = bns::is_belnet_type(type) ? belnet_names : session_wallet_names; + size_t names_count = bns::is_belnet_type(type) ? beldex::char_count(belnet_names) : beldex::char_count(session_wallet_names); for (size_t i = 0; i < names_count; i++) { @@ -90,9 +90,9 @@ TEST(beldex_name_system, value_encrypt_and_decrypt) value.len = 32; memset(&value.buffer[0], 'a', value.len); - // The type here is not hugely important for decryption except that beldexnet (as opposed to + // The type here is not hugely important for decryption except that belnet (as opposed to // session) doesn't fall back to argon2 decryption if decryption fails. - constexpr auto type = bns::mapping_type::beldexnet; + constexpr auto type = bns::mapping_type::belnet; // Encryption and Decryption success { diff --git a/tests/unit_tests/dns_resolver.cpp b/tests/unit_tests/dns_resolver.cpp index 43446a3338..3fc39e0dd0 100755 --- a/tests/unit_tests/dns_resolver.cpp +++ b/tests/unit_tests/dns_resolver.cpp @@ -160,7 +160,7 @@ TEST(DNSResolver, GetTXTRecord) TEST(DNSResolver, GetMulti) { - auto records = tools::DNSResolver::instance().get_many(tools::DNS_TYPE_A, {"beldex.network", "example.invalid", "beldexnet.org"}); + auto records = tools::DNSResolver::instance().get_many(tools::DNS_TYPE_A, {"beldex.network", "example.invalid", "belnet.org"}); EXPECT_EQ(records.size(), 3); EXPECT_TRUE(records[0].size() > 0); EXPECT_EQ(records[1].size(), 0); diff --git a/utils/beldex-launcher-to-debs.sh b/utils/beldex-launcher-to-debs.sh index c7dfe61534..203bdb4393 100755 --- a/utils/beldex-launcher-to-debs.sh +++ b/utils/beldex-launcher-to-debs.sh @@ -121,7 +121,7 @@ Extra options (for typical beldex-launcher installs these are not needed): --overwrite -- run the script even if /var/lib/beldex already exists. ${RED}Use caution!$RESET --no-process-checks -- allow the migration to run even if beldexd/ss/ - beldexnet processes are still running after + belnet processes are still running after stopping beldex-launcher. --distro= -- allows overriding the detected Ubuntu/Debian distribution (default: $(lsb_release -sc)) @@ -192,8 +192,8 @@ START read existing= -if systemctl is-active -q beldex-node beldexnet-router beldex-storage-server; then - existing="systemd services ${BOLD}beldex-node$RESET, ${BOLD}beldexnet-router$RESET, and/or ${BOLD}beldex-storage-server$RESET are +if systemctl is-active -q beldex-node belnet-router beldex-storage-server; then + existing="systemd services ${BOLD}beldex-node$RESET, ${BOLD}belnet-router$RESET, and/or ${BOLD}beldex-storage-server$RESET are already running!'" elif [ -d /var/lib/beldex ] && [ -z "$overwrite" ]; then existing="$BOLD/var/lib/beldex$RESET already exists!" @@ -205,7 +205,7 @@ if [ -n "$existing" ]; then If you intend to overwrite an existing deb installation then you must stop them using: - sudo systemctl disable --now beldex-node beldexnet-router beldex-storage-server + sudo systemctl disable --now beldex-node belnet-router beldex-storage-server and then must rerun this script adding the ${BOLD}--overwrite$RESET option. Be careful: this will overwrite any existing configuration and data (including @@ -304,16 +304,16 @@ ss_data=$(jq -r .runningConfig.storage.data_dir <<<"$lljson") ss_http=$(jq -r .runningConfig.storage.port <<<"$lljson") ss_lmq=$(jq -r .runningConfig.storage.lmq_port <<<"$lljson") ss_listen=$(jq -r .runningConfig.storage.ip <<<"$lljson") -beldexnet_data=$(jq -r .runningConfig.network.data_dir <<<"$lljson") -beldexnet_ip=${ip_public} # Currently beldex-launcher doesn't support specifying this separately -beldexnet_port=$(jq -r .runningConfig.network.public_port <<<"$lljson") -beldexnet_simple= +belnet_data=$(jq -r .runningConfig.network.data_dir <<<"$lljson") +belnet_ip=${ip_public} # Currently beldex-launcher doesn't support specifying this separately +belnet_port=$(jq -r .runningConfig.network.public_port <<<"$lljson") +belnet_simple= -if [ "$beldexnet_ip" != "$ip_public" ]; then - die "Unsupported configuration anamoly detected: publicIPv4 ($ip_public) is not the same as beldexnet's public IP ($beldexnet_ip)" +if [ "$belnet_ip" != "$ip_public" ]; then + die "Unsupported configuration anamoly detected: publicIPv4 ($ip_public) is not the same as belnet's public IP ($belnet_ip)" fi -# Beldexnet configuration: if the public IP is a local system IP then we can just produce: +# Belnet configuration: if the public IP is a local system IP then we can just produce: # # [bind] # IP=port @@ -328,11 +328,11 @@ fi # # which will listen on all interfaces, and use the public-ip value to advertise itself to the network. if [[ "$(ip -o route get ${ip_public})" =~ \ dev\ lo\ ]]; then - beldexnet_simple=1 + belnet_simple=1 fi if [ "$ss_listen" != "0.0.0.0" ]; then - # Not listening on 0.0.0.0 is a bug (because it means SS isn't accessible over beldexnet), unless you have + # Not listening on 0.0.0.0 is a bug (because it means SS isn't accessible over belnet), unless you have # some exotic packet forwarding set up locally. warn "WARNING: storage server listening IP will be changed from $ss_listen to 0.0.0.0 (all addresses)" >&2 fi @@ -365,16 +365,16 @@ beldex-storage-server: - public IP: $BOLD$ip_public$RESET - HTTP/LokiMQ ports: $BOLD$ss_http/$ss_lmq$RESET -beldexnet: -- data directory: $BOLD$beldexnet_data$RESET (=> $BOLD/var/lib/beldexnet$RESET) +belnet: +- data directory: $BOLD$belnet_data$RESET (=> $BOLD/var/lib/belnet$RESET) - public IP: $BOLD$ip_public$RESET -- port: $BOLD$beldexnet_port$RESET +- port: $BOLD$belnet_port$RESET $custom_ll_warning After migration you can change configuration settings through the files: $BOLD/etc/beldex/beldex.conf$RESET $BOLD/etc/beldex/storage.conf$RESET - $BOLD/etc/beldex/beldexnet-router.conf$RESET + $BOLD/etc/beldex/belnet-router.conf$RESET DETAILS @@ -394,17 +394,17 @@ if systemctl -q is-active "${service}"; then die "beldex-launcher is still running!" fi -if [ -z "$no_proc_check" ] && pidof -q beldexd beldex-storage beldexnet; then - die $'Stopped storage server, but one or more of beldexd/beldex-storage/beldexnet is still running. +if [ -z "$no_proc_check" ] && pidof -q beldexd beldex-storage belnet; then + die $'Stopped storage server, but one or more of beldexd/beldex-storage/belnet is still running. -(If you know that you have other beldexd/ss/beldexnets running on this machine then rerun this script with the --no-process-checks option)' +(If you know that you have other beldexd/ss/belnets running on this machine then rerun this script with the --no-process-checks option)' fi systemctl_verbose 'Disabling beldex-launcher automatic startup' \ systemctl disable "${service}" systemctl_verbose 'Temporarily masking beldex services from startup until we are done migrating' \ - systemctl mask beldex-node.service beldexnet-router.service beldex-storage-server.service + systemctl mask beldex-node.service belnet-router.service beldex-storage-server.service if ! [ -f /etc/apt/sources.list.d/beldex.list ]; then echo 'Adding deb repository to /etc/apt/sources.list.d/beldex.list' @@ -420,7 +420,7 @@ apt-get update echo 'Installing beldex packages' -apt-get -y install beldexd beldex-storage-server beldexnet-router +apt-get -y install beldexd beldex-storage-server belnet-router echo "${GREEN}Moving beldexd data files to /var/lib/beldex$RESET" echo "${GREEN}========================================$RESET" @@ -461,55 +461,55 @@ echo -e "ip=0.0.0.0\nport=$ss_http\nlmq-port=$ss_lmq\ndata-dir=/var/lib/beldex/s -echo "${GREEN}Moving beldexnet files to /var/lib/beldexnet/router${RESET}" +echo "${GREEN}Moving belnet files to /var/lib/belnet/router${RESET}" echo "${GREEN}===============================================${RESET}" -mv -vf "$beldexnet_data"/{*.private,*.signed,netdb,profiles.dat} /var/lib/beldexnet/router -chown -v _beldexnet:_beldex /var/lib/beldexnet/router/{*.private,*.signed,profiles.dat} -chown -R _beldexnet:_beldex /var/lib/beldexnet/router/netdb # too much for -v +mv -vf "$belnet_data"/{*.private,*.signed,netdb,profiles.dat} /var/lib/belnet/router +chown -v _belnet:_beldex /var/lib/belnet/router/{*.private,*.signed,profiles.dat} +chown -R _belnet:_beldex /var/lib/belnet/router/netdb # too much for -v echo "${GREEN}Updating beldexd configuration in /etc/beldex/beldex.conf${RESET}" echo "${GREEN}===================================================${RESET}" -if [ -n "$beldexnet_simple" ]; then +if [ -n "$belnet_simple" ]; then perl -pi -e " if (/^\[beldexd/ ... /^\[/) { s/jsonrpc=127\.0\.0\.1:22023/jsonrpc=127.0.0.1:${beldexd_rpc}/; } if (/^\[bind/ ... /^\[/) { - s/^#?[\w:.{}-]+=\d+/$beldexnet_ip=$beldexnet_port/; - }" /etc/beldex/beldexnet-router.ini + s/^#?[\w:.{}-]+=\d+/$belnet_ip=$belnet_port/; + }" /etc/beldex/belnet-router.ini else perl -pi -e " if (/^\[beldexd/ ... /^\[/) { s/jsonrpc=127\.0\.0\.1:22023/jsonrpc=127.0.0.1:${beldexd_rpc}/; } if (/^\[router\]/) { - \$_ .= qq{public-ip=$beldexnet_ip\npublic-port=$beldexnet_port\n}; + \$_ .= qq{public-ip=$belnet_ip\npublic-port=$belnet_port\n}; } if (/^\[router/ ... /^\[/) { s/^public-(?:ip|port)=.*//; } if (/^\[bind/ ... /^\[/) { - s/^#?[\w:.{}-]+=\d+/0.0.0.0=$beldexnet_port/; - }" /etc/beldex/beldexnet-router.ini + s/^#?[\w:.{}-]+=\d+/0.0.0.0=$belnet_port/; + }" /etc/beldex/belnet-router.ini fi echo "${GREEN}Done moving/copying files. Starting beldex services...${RESET}" systemctl_verbose 'Unmasking services' \ - systemctl unmask beldex-node.service beldexnet-router.service beldex-storage-server.service + systemctl unmask beldex-node.service belnet-router.service beldex-storage-server.service systemctl_verbose 'Enabling automatic startup of beldex services' \ - systemctl enable beldex-node.service beldexnet-router.service beldex-storage-server.service + systemctl enable beldex-node.service belnet-router.service beldex-storage-server.service -# Try to start a few times because beldexnet deliberately dies (expecting to be restarted) if it can't +# Try to start a few times because belnet deliberately dies (expecting to be restarted) if it can't # reach beldexd on startup to get keys. for ((i = 0; i < 10; i++)); do - if systemctl start beldex-node.service beldexnet-router.service beldex-storage-server.service 2>/dev/null; then + if systemctl start beldex-node.service belnet-router.service beldex-storage-server.service 2>/dev/null; then break fi sleep 1 done -for s in beldex-node beldexnet-router beldex-storage-server; do +for s in beldex-node belnet-router beldex-storage-server; do if ! systemctl is-active -q $s.service; then echo -e "${BYELLOW}$s.service failed to start.${RESET} Check its status using the commands below.\n" fi @@ -522,7 +522,7 @@ You can check on and control your service using these commands: # Show general status of the process: sudo systemctl status beldex-node sudo systemctl status beldex-storage-server - sudo systemctl status beldexnet-router + sudo systemctl status belnet-router # Start/stop/restart a service: sudo systemctl start beldex-node diff --git a/utils/local-devnet/daemons.py b/utils/local-devnet/daemons.py index 4b4d569140..5e2da4ee6a 100644 --- a/utils/local-devnet/daemons.py +++ b/utils/local-devnet/daemons.py @@ -219,12 +219,12 @@ def txpool_hashes(self): return [x['id_hash'] for x in self.rpc("/get_transaction_pool").json()['transactions']] - def ping(self, *, storage=True, beldexnet=True): - """Sends fake storage server and beldexnet pings to the running beldexd""" + def ping(self, *, storage=True, belnet=True): + """Sends fake storage server and belnet pings to the running beldexd""" if storage: self.json_rpc("storage_server_ping", { "version_major": 2, "version_minor": 1, "version_patch": 0 }) - if beldexnet: - self.json_rpc("beldexnet_ping", { "version": [9,9,9] }) + if belnet: + self.json_rpc("belnet_ping", { "version": [9,9,9] }) def send_uptime_proof(self): """Triggerst test uptime proof""" diff --git a/utils/local-devnet/master_node_network.py b/utils/local-devnet/master_node_network.py index c14eac888b..4496e29f69 100755 --- a/utils/local-devnet/master_node_network.py +++ b/utils/local-devnet/master_node_network.py @@ -143,7 +143,7 @@ def __init__(self, datadir, *, binpath='../../build/bin', mns=12, nodes=3): self.print_wallet_balances() - vprint("Sending fake beldexnet/ss pings") + vprint("Sending fake belnet/ss pings") for mn in self.mns: mn.ping() From e3ed82164669b13597273d0e5487776810166d66 Mon Sep 17 00:00:00 2001 From: victor-tucci Date: Tue, 16 Nov 2021 12:32:18 +0530 Subject: [PATCH 2/3] Governance wallet added --- src/cryptonote_config.h | 4 ++-- src/p2p/net_node.inl | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cryptonote_config.h b/src/cryptonote_config.h index 9a9b59367b..d39d2c5d04 100644 --- a/src/cryptonote_config.h +++ b/src/cryptonote_config.h @@ -242,8 +242,8 @@ namespace config inline constexpr uint64_t GOVERNANCE_REWARD_INTERVAL_IN_BLOCKS = PRE_POS_BLOCKS_EXPECTED_IN_DAYS(7);//Governance added from V17 inline constexpr std::array GOVERNANCE_WALLET_ADDRESS = { - "bxcguQiBhYaDW5wAdPLSwRHA6saX1nCEYUF89SPKZfBY1BENdLQWjti59aEtAEgrVZjnCJEVFoCDrG1DCoz2HeeN2pxhxL9xa"sv, // hardfork v7-10 - "bxcguQiBhYaDW5wAdPLSwRHA6saX1nCEYUF89SPKZfBY1BENdLQWjti59aEtAEgrVZjnCJEVFoCDrG1DCoz2HeeN2pxhxL9xa"sv, + "bxdwQ4ruRpW9QTfBpStRAMNKgdt7Rr39UcThNZ7mwsfxH7StmykPe9ah1KgJL2LwEAgqRXHLvZYBm1aaUVR8mLtB1u3WauV6P"sv, + "bxdwQ4ruRpW9QTfBpStRAMNKgdt7Rr39UcThNZ7mwsfxH7StmykPe9ah1KgJL2LwEAgqRXHLvZYBm1aaUVR8mLtB1u3WauV6P"sv, // V17 }; inline constexpr auto UPTIME_PROOF_TOLERANCE = 5min; // How much an uptime proof timestamp can deviate from our timestamp before we refuse it diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index 8d791c9726..738a96cb7a 100755 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -624,11 +624,11 @@ namespace nodetool } else { - full_addrs.insert("34.85.44.103:19090"); - full_addrs.insert("35.211.123.115:19090"); - full_addrs.insert("35.228.216.218:19090"); - full_addrs.insert("35.228.9.140:19090"); - full_addrs.insert("35.229.161.161:19090"); + full_addrs.insert("seed1.beldex.io:19090"); + full_addrs.insert("seed2.rpcnode.stream:19090"); + full_addrs.insert("seed3.beldex.io:19090"); + full_addrs.insert("seed4.rpcnode.stream:19090"); + full_addrs.insert("seed5.beldex.io:19090"); } return full_addrs; } From 89aeb5be19de295b7082130447982f060f313180 Mon Sep 17 00:00:00 2001 From: scilicet64 Date: Tue, 16 Nov 2021 10:18:24 -0800 Subject: [PATCH 3/3] keep old governance address on old forks and switch to new address on V17 --- src/cryptonote_config.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/cryptonote_config.h b/src/cryptonote_config.h index d39d2c5d04..3397086613 100644 --- a/src/cryptonote_config.h +++ b/src/cryptonote_config.h @@ -242,7 +242,7 @@ namespace config inline constexpr uint64_t GOVERNANCE_REWARD_INTERVAL_IN_BLOCKS = PRE_POS_BLOCKS_EXPECTED_IN_DAYS(7);//Governance added from V17 inline constexpr std::array GOVERNANCE_WALLET_ADDRESS = { - "bxdwQ4ruRpW9QTfBpStRAMNKgdt7Rr39UcThNZ7mwsfxH7StmykPe9ah1KgJL2LwEAgqRXHLvZYBm1aaUVR8mLtB1u3WauV6P"sv, + "bxcguQiBhYaDW5wAdPLSwRHA6saX1nCEYUF89SPKZfBY1BENdLQWjti59aEtAEgrVZjnCJEVFoCDrG1DCoz2HeeN2pxhxL9xa"sv, // = wallet_switch ? 1 : 0]; + return GOVERNANCE_WALLET_ADDRESS[hard_fork_version >= cryptonote::network_version_17_POS ? 1 : 0]; } }; inline constexpr network_config mainnet_config{