From bf51e1cf42147cbe39c478532a920de8b04b7888 Mon Sep 17 00:00:00 2001 From: wowario Date: Mon, 23 Jan 2023 12:16:38 +0300 Subject: [PATCH] testnet v0.11 --- src/CMakeLists.txt | 2 +- src/blocks/CMakeLists.txt | 2 +- src/blocks/testnet_blocks.dat | Bin 0 -> 4 bytes src/checkpoints/checkpoints.cpp | 4 ++++ src/cryptonote_basic/difficulty.cpp | 14 ++------------ src/cryptonote_config.h | 8 +++----- src/hardforks/hardforks.cpp | 14 ++++++++++++++ src/p2p/net_node.inl | 3 +++ src/version.cpp.in | 4 ++-- 9 files changed, 30 insertions(+), 21 deletions(-) create mode 100644 src/blocks/testnet_blocks.dat diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9216bcaa5..ab96c14e9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -108,11 +108,11 @@ if(NOT IOS) add_subdirectory(simplewallet) add_subdirectory(daemonizer) add_subdirectory(daemon) + add_subdirectory(blockchain_utilities) endif() if(BUILD_DEBUG_UTILITIES) add_subdirectory(debug_utilities) - add_subdirectory(blockchain_utilities) add_subdirectory(gen_multisig) add_subdirectory(gen_ssl_cert) endif() diff --git a/src/blocks/CMakeLists.txt b/src/blocks/CMakeLists.txt index bab121617..e6b7f4c8d 100644 --- a/src/blocks/CMakeLists.txt +++ b/src/blocks/CMakeLists.txt @@ -41,7 +41,7 @@ const size_t ${BLOB_NAME}_len = sizeof(${BLOB_NAME}); " ) ]=]) -foreach(BLOB_NAME checkpoints) +foreach(BLOB_NAME checkpoints testnet_blocks) set(OUTPUT_C_SOURCE "generated_${BLOB_NAME}.c") list(APPEND GENERATED_SOURCES ${OUTPUT_C_SOURCE}) set(INPUT_DAT_FILE "${BLOB_NAME}.dat") diff --git a/src/blocks/testnet_blocks.dat b/src/blocks/testnet_blocks.dat new file mode 100644 index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4 GIT binary patch literal 4 LcmZQzU|;|M00aO5 literal 0 HcmV?d00001 diff --git a/src/checkpoints/checkpoints.cpp b/src/checkpoints/checkpoints.cpp index 626d1755c..aa55f38bd 100644 --- a/src/checkpoints/checkpoints.cpp +++ b/src/checkpoints/checkpoints.cpp @@ -184,6 +184,10 @@ namespace cryptonote { if (nettype == TESTNET) { + ADD_CHECKPOINT2(1, "6c5a3febcd45fc05b99bf5260abacc178925e517b09a52214404fa9d86c90820", "0x65"); + ADD_CHECKPOINT2(50, "e59709f523573441c02ba3cceafb1c5d6756cbc246e9158215a9afbdf4f668b4", "0x1389"); + ADD_CHECKPOINT2(100, "ccb1cda16a62caaa85725f35ab0f8e4d90e9f7a05cac3dfd3f1f5f0d23a74358", "0x2711"); + ADD_CHECKPOINT2(200, "600320660dffa07f8de62931c68a186dc7e2a543733c98e6a5c78d1a373dbc8c", "0xc115"); return true; } if (nettype == STAGENET) diff --git a/src/cryptonote_basic/difficulty.cpp b/src/cryptonote_basic/difficulty.cpp index fa4f3eff9..dd0b8d83c 100644 --- a/src/cryptonote_basic/difficulty.cpp +++ b/src/cryptonote_basic/difficulty.cpp @@ -215,7 +215,6 @@ namespace cryptonote { if (length <= 1) { return 1; } - if (HEIGHT <= DIFFICULTY_RESET_HEIGHT + DIFFICULTY_WINDOW && HEIGHT >= DIFFICULTY_RESET_HEIGHT) { return DIFFICULTY_RESET_LEVEL; } static_assert(DIFFICULTY_WINDOW >= 2, "Window is too small"); assert(length <= DIFFICULTY_WINDOW); sort(timestamps.begin(), timestamps.end()); @@ -320,7 +319,6 @@ namespace cryptonote { uint64_t N = DIFFICULTY_WINDOW_V2; uint64_t L(0), ST(0), next_D, prev_D, avg_D, i; assert(timestamps.size() == cumulative_difficulties.size() && timestamps.size() <= N+1 ); - if (HEIGHT <= 63469 + 1) { return 100000069; } std::vectorTS(N+1); TS[0] = timestamps[0]; for ( i = 1; i <= N; i++) { @@ -367,16 +365,8 @@ namespace cryptonote { uint64_t N = DIFFICULTY_WINDOW_V3; assert(timestamps.size() == cumulative_difficulties.size() && timestamps.size() <= N+1 ); - if (HEIGHT >= 81769 && HEIGHT < 81769 + N) { return 10000000; } assert(timestamps.size() == N+1); - // hardcoding previously erroneously calculated difficulty entries - if(HEIGHT == 307686) return 25800000; - if(HEIGHT == 307692) return 1890000; - if(HEIGHT == 307735) return 17900000; - if(HEIGHT == 307742) return 21300000; - if(HEIGHT == 307750) return 10900000; - if(HEIGHT == 307766) return 2960000; uint64_t i, this_timestamp(0), previous_timestamp(0); difficulty_type L(0), next_D, avg_D; @@ -393,10 +383,10 @@ namespace cryptonote { avg_D = ( cumulative_difficulties[N] - cumulative_difficulties[0] )/ N; // Prevent round off error for small D and overflow for large D. - if (avg_D > 2000000*N*N*T && HEIGHT < 307800) { + if (avg_D > 2000000*N*N*T) { next_D = (avg_D/(200*L))*(N*(N+1)*T*99); } - else if (avg_D > uint64_t(-1)/(N*(N+1)*T*99) && HEIGHT > 307800) { + else if (avg_D > uint64_t(-1)/(N*(N+1)*T*99)) { next_D = (avg_D/(200*L))*(N*(N+1)*T*99); } else { next_D = (avg_D*N*(N+1)*T*99)/(200*L); } diff --git a/src/cryptonote_config.h b/src/cryptonote_config.h index fc5a0aade..a9ce375e8 100644 --- a/src/cryptonote_config.h +++ b/src/cryptonote_config.h @@ -94,8 +94,6 @@ #define DIFFICULTY_BLOCKS_COUNT_V3 DIFFICULTY_WINDOW_V3 + 1 // added +1 to make N=N #define DIFFICULTY_BLOCKS_COUNT_V2 DIFFICULTY_WINDOW_V2 + 1 // added +1 to make N=N #define DIFFICULTY_BLOCKS_COUNT DIFFICULTY_WINDOW + DIFFICULTY_LAG -#define DIFFICULTY_RESET_HEIGHT 331170// ~July 4, 2021 Pool Independence Day -#define DIFFICULTY_RESET_LEVEL 100000000 // 100 mill #define CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS_V1 DIFFICULTY_TARGET_V1 * CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS @@ -272,9 +270,9 @@ namespace config uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX = 53; uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX = 54; uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX = 63; - uint16_t const P2P_DEFAULT_PORT = 11180; - uint16_t const RPC_DEFAULT_PORT = 11181; - uint16_t const ZMQ_RPC_DEFAULT_PORT = 11182; + uint16_t const P2P_DEFAULT_PORT = 34569; + uint16_t const RPC_DEFAULT_PORT = 34570; + uint16_t const ZMQ_RPC_DEFAULT_PORT = 34571; boost::uuids::uuid const NETWORK_ID = { { 0x11, 0x33, 0xFF, 0x77 , 0x61, 0x04 , 0x41, 0x61, 0x17, 0x31, 0x00, 0x82, 0x16, 0xA1, 0xA1, 0x11 } }; // Bender's daydream diff --git a/src/hardforks/hardforks.cpp b/src/hardforks/hardforks.cpp index 668d7b731..f3be48603 100644 --- a/src/hardforks/hardforks.cpp +++ b/src/hardforks/hardforks.cpp @@ -49,6 +49,20 @@ const hardfork_t mainnet_hard_forks[] = { const size_t num_mainnet_hard_forks = sizeof(mainnet_hard_forks) / sizeof(mainnet_hard_forks[0]); const hardfork_t testnet_hard_forks[] = { + { 7, 1, 0, 1519605000 }, + { 8, 10, 0, 1524214739 }, + { 9, 20, 0, 1538689773 }, + { 10, 30, 0, 1541700352 }, + { 11, 40, 0, 1549238400 }, + { 12, 50, 0, 1549318761 }, + { 13, 60, 0, 1559292691 }, + { 14, 70, 0, 1559292774 }, + { 15, 80, 0, 1573280497 }, + { 16, 90, 0, 1600576508 }, + { 17, 100, 0, 1600576524 }, + { 18, 110, 0, 1623245591 }, + { 19, 120, 0, 1624793373 }, + { 20, 130, 0, 1674457368 }, }; const size_t num_testnet_hard_forks = sizeof(testnet_hard_forks) / sizeof(testnet_hard_forks[0]); diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index 75a20cf8c..d388d95dc 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -685,6 +685,9 @@ namespace nodetool std::set full_addrs; if (m_nettype == cryptonote::TESTNET) { + full_addrs.insert("204.48.28.218:34569"); + full_addrs.insert("134.122.53.193:34569"); + full_addrs.insert("143.198.195.132:34569"); } else if (m_nettype == cryptonote::STAGENET) { diff --git a/src/version.cpp.in b/src/version.cpp.in index 58a0edc7d..f53425c7c 100644 --- a/src/version.cpp.in +++ b/src/version.cpp.in @@ -1,6 +1,6 @@ #define DEF_MONERO_VERSION_TAG "@VERSIONTAG@" -#define DEF_MONERO_VERSION "0.11.0.0" -#define DEF_MONERO_RELEASE_NAME "Kunty Karen" +#define DEF_MONERO_VERSION "0.11.0.0.rc.testnet" +#define DEF_MONERO_RELEASE_NAME "Kunty Karen-TESTNET" #define DEF_MONERO_VERSION_FULL DEF_MONERO_VERSION "-" DEF_MONERO_VERSION_TAG #define DEF_MONERO_VERSION_IS_RELEASE @VERSION_IS_RELEASE@