From 6f230bae40e6daf68456b44d1133214090a5b14e Mon Sep 17 00:00:00 2001 From: "James C. Owens" Date: Tue, 12 Mar 2024 17:02:12 -0400 Subject: [PATCH 1/3] Ban nodes 5.4.5.0 and below --- src/main.cpp | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 8aa9e05018..f20773b226 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2049,11 +2049,12 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // Note the std::max is there to deal with the rollover of BlockV12Height + DISCONNECT_GRACE_PERIOD if // BlockV12Height is set to std::numeric_limits::max() which is the case during testing. if (pfrom->nVersion < MIN_PEER_PROTO_VERSION - || (DISCONNECT_OLD_VERSION_AFTER_GRACE_PERIOD - && pfrom->nVersion < PROTOCOL_VERSION - && pindexBest->nHeight > std::max(Params().GetConsensus().BlockV12Height, - Params().GetConsensus().BlockV12Height + DISCONNECT_GRACE_PERIOD))) - { + || (DISCONNECT_OLD_VERSION_AFTER_GRACE_PERIOD + && pfrom->nVersion < PROTOCOL_VERSION + && pindexBest->nHeight > std::max(Params().GetConsensus().BlockV12Height, + Params().GetConsensus().BlockV12Height + DISCONNECT_GRACE_PERIOD) + ) + ) { // disconnect from peers older than this proto version LogPrint(BCLog::LogFlags::NOISY, "partner %s using obsolete version %i; disconnecting", pfrom->addr.ToString(), pfrom->nVersion); @@ -2064,8 +2065,27 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, if (!vRecv.empty()) vRecv >> addrFrom >> nNonce; - if (!vRecv.empty()) + + if (!vRecv.empty()) { vRecv >> pfrom->strSubVer; + + // This handles the special disconnect for clients between the mandatory 5.4.0.0 and the 5.4.5.0 since + // 5.4.6.0 effectively became a mandatory due to the contract version error in TxMessage. The protocol version + // was not incremented since 5.4.6.0 was originally a leisure and so this is the only reasonable way to distinguish + // in this situation. + if (pfrom->strSubVer.find("5.4.5") != std::string::npos + || pfrom->strSubVer.find("5.4.4") != std::string::npos + || pfrom->strSubVer.find("5.4.3") != std::string::npos + || pfrom->strSubVer.find("5.4.2") != std::string::npos + || pfrom->strSubVer.find("5.4.1") != std::string::npos + || pfrom->strSubVer.find("5.4.0") != std::string::npos + ) { + + pfrom->fDisconnect = true; + return false; + } + } + if (!vRecv.empty()) vRecv >> pfrom->nStartingHeight; From 9c9f280f2bb07bcef82aacb731ba31858211342d Mon Sep 17 00:00:00 2001 From: "James C. Owens" Date: Tue, 12 Mar 2024 23:11:21 -0400 Subject: [PATCH 2/3] Increment version to 5.4.7.0 for release. --- CMakeLists.txt | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09cc834388..0836128949 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ cmake_minimum_required(VERSION 3.18) project("Gridcoin" - VERSION 5.4.6.0 + VERSION 5.4.7.0 DESCRIPTION "POS-based cryptocurrency that rewards BOINC computation" HOMEPAGE_URL "https://gridcoin.us" LANGUAGES ASM C CXX diff --git a/configure.ac b/configure.ac index db4d895adc..fa97189dad 100755 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N) AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 5) define(_CLIENT_VERSION_MINOR, 4) -define(_CLIENT_VERSION_REVISION, 6) +define(_CLIENT_VERSION_REVISION, 7) define(_CLIENT_VERSION_BUILD, 0) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2024) From a84055bcbaa87a944cac158671f721a6ce38fe6e Mon Sep 17 00:00:00 2001 From: "James C. Owens" Date: Tue, 12 Mar 2024 23:40:56 -0400 Subject: [PATCH 3/3] Update CHANGELOG for 5.4.7.0 release. --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 945a0ecc15..f194b20dad 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/) and this project adheres to [Semantic Versioning](https://semver.org/). +## [5.4.7.0], 2024-03-13, leisure + +### Added + - net, consensus: Ban nodes 5.4.5.0 and below #2751 (@jamescowens) + +### Changed + +### Removed + +### Fixed + - util: Adjust Fraction class addition overload overflow tests #2748 (@jamescowens) + ## [5.4.6.0], 2024-03-02, leisure, "Miss Piggy" ### Added