From c3782ce0aaea82c001a3a9205cc72f9c3df5d88a Mon Sep 17 00:00:00 2001 From: Guilherme Lawless Date: Mon, 3 Aug 2020 18:42:07 +0100 Subject: [PATCH] Beta reset for V22 development (#2830) * Change beta preconfigured_representatives One of them was not used. Account->key: - nano_1beta1ayfkpj1tfbhi3e9ihkocjkqi6ms5e4xrbmbybqnkza1e5jrake8wai -> 259A4011E6CAD1069A97C02C3C1F2AAA32BC093C8D82EE1334F937A4BE803071 - nano_1betazh7m3c9gwcsy7w3rzynbqr9gomjwn3cp59xqky48we46eaqptbdskh4 -> 259A47DE59854777159F1781C7FD44DF0775671E502AB0CFDBCBC23718223117 * Change online weight samples to span a 1-day period for beta * Beta network reset for V22 development Genesis nano_1betag41gqumw8fywwp1yay6k9jinswhqhbjtogmm1ibmnyfo1apej3medr3 * Change epoch 2 send/change threshold to be the same as epoch 1 * Fix difficulty tests * Change default beta network representative to a burn address * Fix cross initialization error --- nano/core_test/difficulty.cpp | 2 +- nano/lib/config.cpp | 2 +- nano/node/nodeconfig.cpp | 7 +++++-- nano/secure/common.cpp | 16 ++++++++-------- nano/secure/common.hpp | 2 +- rep_weights_beta.bin | Bin 1024 -> 0 bytes 6 files changed, 16 insertions(+), 13 deletions(-) delete mode 100644 rep_weights_beta.bin diff --git a/nano/core_test/difficulty.cpp b/nano/core_test/difficulty.cpp index 61affc0b4..9c4dc4605 100644 --- a/nano/core_test/difficulty.cpp +++ b/nano/core_test/difficulty.cpp @@ -134,7 +134,7 @@ TEST (difficulty, network_constants) ASSERT_NEAR (1., nano::difficulty::to_multiplier (full_thresholds.epoch_2, full_thresholds.base), 1e-10); ASSERT_NEAR (1 / 64., nano::difficulty::to_multiplier (beta_thresholds.epoch_1, full_thresholds.epoch_1), 1e-10); - ASSERT_NEAR (2., nano::difficulty::to_multiplier (beta_thresholds.epoch_2, beta_thresholds.epoch_1), 1e-10); + ASSERT_NEAR (1., nano::difficulty::to_multiplier (beta_thresholds.epoch_2, beta_thresholds.epoch_1), 1e-10); ASSERT_NEAR (1 / 2., nano::difficulty::to_multiplier (beta_thresholds.epoch_2_receive, beta_thresholds.epoch_1), 1e-10); ASSERT_NEAR (1., nano::difficulty::to_multiplier (beta_thresholds.epoch_2_receive, beta_thresholds.entry), 1e-10); ASSERT_NEAR (1., nano::difficulty::to_multiplier (beta_thresholds.epoch_2, beta_thresholds.base), 1e-10); diff --git a/nano/lib/config.cpp b/nano/lib/config.cpp index 7d462981d..411c51ce1 100644 --- a/nano/lib/config.cpp +++ b/nano/lib/config.cpp @@ -15,7 +15,7 @@ work_thresholds const network_constants::publish_full ( work_thresholds const network_constants::publish_beta ( 0xfffff00000000000, // 64x lower than publish_full.epoch_1 -0xfffff80000000000, // 2x higher than epoch_1 +0xfffff00000000000, // same as epoch_1 0xffffe00000000000 // 2x lower than epoch_1 ); diff --git a/nano/node/nodeconfig.cpp b/nano/node/nodeconfig.cpp index 4e45a7c61..e9f1b26fe 100644 --- a/nano/node/nodeconfig.cpp +++ b/nano/node/nodeconfig.cpp @@ -42,10 +42,13 @@ external_address (boost::asio::ip::address_v6{}.to_string ()) preconfigured_representatives.push_back (network_params.ledger.genesis_account); break; case nano::nano_networks::nano_beta_network: + { preconfigured_peers.push_back (default_beta_peer_network); - preconfigured_representatives.emplace_back ("259A4011E6CAD1069A97C02C3C1F2AAA32BC093C8D82EE1334F937A4BE803071"); - preconfigured_representatives.emplace_back ("259A40656144FAA16D2A8516F7BE9C74A63C6CA399960EDB747D144ABB0F7ABD"); + nano::account offline_representative; + release_assert (!offline_representative.decode_account ("nano_1defau1t9off1ine9rep99999999999999999999999999999999wgmuzxxy")); + preconfigured_representatives.emplace_back (offline_representative); break; + } case nano::nano_networks::nano_live_network: preconfigured_peers.push_back (default_live_peer_network); preconfigured_representatives.emplace_back ("A30E0A32ED41C8607AA9212843392E853FCBCB4E7CB194E35C94F07F91DE59EF"); diff --git a/nano/secure/common.cpp b/nano/secure/common.cpp index 4c625a58a..e57d6331c 100644 --- a/nano/secure/common.cpp +++ b/nano/secure/common.cpp @@ -27,7 +27,7 @@ namespace { char const * test_private_key_data = "34F0A37AAD20F4A260F0A5B3CB3D7FB50673212263E58A380BC10474BB039CE4"; char const * test_public_key_data = "B0311EA55708D6A53C75CDBF88300259C6D018522FE3D4D0A242E431F9E8B6D0"; // xrb_3e3j5tkog48pnny9dmfzj1r16pg8t1e76dz5tmac6iq689wyjfpiij4txtdo -char const * beta_public_key_data = "259A4394DB16B1FFE5568476655E844BA59E8EB5D222F20D42E50684D0C16B54"; // nano_1betagcfp7ojzzkof35peohaakx7mt9ddnj4ya8n7sa8imae4ttnm16dm753 +char const * beta_public_key_data = "259A4384075F73E19BEE72C0F23C491E30A678FBBD31D55D3982099D3CDA8116"; // nano_1betag41gqumw8fywwp1yay6k9jinswhqhbjtogmm1ibmnyfo1apej3medr3 char const * live_public_key_data = "E89208DD038FBB269987689621D52292AE9C35941A7484756ECCED92A65093BA"; // xrb_3t6k35gi95xu6tergt6p69ck76ogmitsa8mnijtpxm9fkcm736xtoncuohr3 char const * test_genesis_data = R"%%%({ "type": "open", @@ -40,11 +40,11 @@ char const * test_genesis_data = R"%%%({ char const * beta_genesis_data = R"%%%({ "type": "open", - "source": "259A4394DB16B1FFE5568476655E844BA59E8EB5D222F20D42E50684D0C16B54", - "representative": "nano_1betagcfp7ojzzkof35peohaakx7mt9ddnj4ya8n7sa8imae4ttnm16dm753", - "account": "nano_1betagcfp7ojzzkof35peohaakx7mt9ddnj4ya8n7sa8imae4ttnm16dm753", - "work": "7f5c2eb5e2658e81", - "signature": "DB9EFAC98A28EEA048E722F91C2A2720E1D8EF2A81453C80FC53B453180C0A264CE021D38D5B4540B1BBB0C378B80F2DF7389027593C08DDEF9F47934B9CF805" + "source": "259A4384075F73E19BEE72C0F23C491E30A678FBBD31D55D3982099D3CDA8116", + "representative": "nano_1betag41gqumw8fywwp1yay6k9jinswhqhbjtogmm1ibmnyfo1apej3medr3", + "account": "nano_1betag41gqumw8fywwp1yay6k9jinswhqhbjtogmm1ibmnyfo1apej3medr3", + "work": "7fa41edc9f5c8049", + "signature": "8E771BAC91958B2323A3613ACAAE8A01BB6DD2EA161FA57ADC7223DB37405D0F774B972EEE99D19E2572211E4C2A967E577F36F3DAFA29FAD2BC17911490DA08" })%%%"; char const * live_genesis_data = R"%%%({ @@ -76,7 +76,7 @@ network (network_a), ledger (network), voting (network), node (network), portmap unsigned constexpr kdf_full_work = 64 * 1024; unsigned constexpr kdf_test_work = 8; kdf_work = network.is_test_network () ? kdf_test_work : kdf_full_work; - header_magic_number = network.is_test_network () ? std::array{ { 'R', 'A' } } : network.is_beta_network () ? std::array{ { 'N', 'D' } } : std::array{ { 'R', 'C' } }; + header_magic_number = network.is_test_network () ? std::array{ { 'R', 'A' } } : network.is_beta_network () ? std::array{ { 'R', 'B' } } : std::array{ { 'R', 'C' } }; } uint8_t nano::protocol_constants::protocol_version_min (bool use_epoch_2_min_version_a) const @@ -138,7 +138,7 @@ nano::node_constants::node_constants (nano::network_constants & network_constant unchecked_cleaning_interval = std::chrono::minutes (30); process_confirmed_interval = network_constants.is_test_network () ? std::chrono::milliseconds (50) : std::chrono::milliseconds (500); max_peers_per_ip = network_constants.is_test_network () ? 10 : 5; - max_weight_samples = network_constants.is_live_network () ? 4032 : 864; + max_weight_samples = network_constants.is_live_network () ? 4032 : 288; weight_period = 5 * 60; // 5 minutes } diff --git a/nano/secure/common.hpp b/nano/secure/common.hpp index c265325ce..7490462f2 100644 --- a/nano/secure/common.hpp +++ b/nano/secure/common.hpp @@ -419,7 +419,7 @@ public: /** Maximum number of peers per IP */ size_t max_peers_per_ip; - /** The maximum amount of samples for a 2 week period on live or 3 days on beta */ + /** The maximum amount of samples for a 2 week period on live or 1 day on beta */ uint64_t max_weight_samples; uint64_t weight_period; }; diff --git a/rep_weights_beta.bin b/rep_weights_beta.bin deleted file mode 100644 index ece928caaef2d2c7db0efed6f06bf1995c594455..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1024 zcmZQzKmxh5np9^w2tGS?k!{xW13EVHTC0rqaN6`Xy%RS1X})A%gFzubXZkX^nvJ>A z|IU<60BTK~wlwTu+?AyKkgIRqL!LbRb?5dZqk_J>si(PKIg4d`1J&C)KGFQOuvYl7 zlg%q8)miTMB3s?dMdyn*9{=ldpS?6)EmtPBW zwOYl#@0(My%qC~?%xQeLOKL^DcJo*5ck@j)El~if-_9}dw$Lt)hr1nB zyT5fmNPM=4X{V6A@{~NUimm>)H*92OR?0lEFgdtebED@4pn5N<%W{g(IiJnzyTfqB zO{MU`HOu`OQzdO0Ex)(w2P`l|SFhwTIhn)jVXt%8{L`tq`^y$7-VTY*--}T(j!rrnx6~e!2Di zP90Ev=0}$~hR1gN%#8on{_J?=g^dp{&3PlX{XnJ4nb%6qmuGI>k|X%!JX62<{p-TJqeaAFE zZuR=1jqYmO{L~f8n5wlJ76-i!J9l<%&FpoSEli9> zE)V3k`q^6K9aI3izi8uSl?2PRrfZw>r|mhc*8lu`=RDPW8i9hxmGkwOYpl`LUlQqJ ztq|aPWXRI&@5g+&t7T8~q*uQm?+nXr@;9jps$pVu_%3-%eK$+F@OF^-wj%%gzE>Rj zS@r%ytI4^_KJ(z-5Q*0U?6=yBRio+?tI^dLO1MaWo4Diq{J{6MX?|QBzit|+^<}v2 z`8sFS`t>S%H=wIGI?pU4Dm{xjUS_txKTYdRck3{3K7{J6C4UO~MthI*~4iB(}nT;42#S+Dx!-TWl3DLOW1d;YDyYVmPS?#!P&H!C$yS)Mjs^F+5zLDJ70sJ_qE zv2TLj83w*i83u-=mFwpGcq#3{v-65T&A!LSEG5cy?RRWzzqE;mcTOZHKjZ)4x6wND zf1P>R8Vm|gWj^QKEtjJou6+B}VYAS_dv4`?R&mCgyAR$xRzEehN1l=4;>lpcg$29* LJbBu+XlnxiE!W6H