Skip to content

Commit

Permalink
5.4.7.0, 2024-03-13, leisure
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
jamescowens committed Mar 13, 2024
2 parents 325a127 + a84055b commit 2f4877b
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 8 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
32 changes: 26 additions & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>::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);
Expand All @@ -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;

Expand Down

0 comments on commit 2f4877b

Please sign in to comment.