From 3e5502b11c007bb46048b9e0ca94206b4287b5aa Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Sat, 4 Jun 2022 09:50:45 +0530 Subject: [PATCH 1/4] Move boost to 1.77 --- depends/packages/boost.mk | 4 ++-- src/masternodes/mn_checks.h | 3 +++ src/pos.cpp | 5 +++++ src/validation.cpp | 3 +-- src/version.h | 4 ++-- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index 0e31ff9ceb..662a4daaa0 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -10,8 +10,8 @@ package=boost # 77: fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854 # 78: 8681f175d4bdb26c52222665793eef08490d7758529330f98d3b29dd0735bccc -$(package)_version=1_75_0 -$(package)_sha256_hash=953db31e016db7bb207f11432bef7df100516eeb746843fa0486a222e3fd49cb +$(package)_version=1_77_0 +$(package)_sha256_hash=fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854 $(package)_version_dot=$(subst _,.,$($(package)_version)) $(package)_download_path=https://boostorg.jfrog.io/artifactory/main/release/$($(package)_version_dot)/source/ diff --git a/src/masternodes/mn_checks.h b/src/masternodes/mn_checks.h index a47b702d27..32b5e36cb9 100644 --- a/src/masternodes/mn_checks.h +++ b/src/masternodes/mn_checks.h @@ -100,8 +100,10 @@ enum class CustomTxType : uint8_t PaybackLoan = 'H', PaybackLoanV2 = 'k', AuctionBid = 'I', + // Marker TXs FutureSwapExecution = 'q', FutureSwapRefund = 'w', + TokenSplit = 'z', }; inline CustomTxType CustomTxCodeToType(uint8_t ch) { @@ -159,6 +161,7 @@ inline CustomTxType CustomTxCodeToType(uint8_t ch) { case CustomTxType::AuctionBid: case CustomTxType::FutureSwapExecution: case CustomTxType::FutureSwapRefund: + case CustomTxType::TokenSplit: case CustomTxType::Reject: case CustomTxType::None: return type; diff --git a/src/pos.cpp b/src/pos.cpp index 81cd0a856e..dddcaf8b18 100644 --- a/src/pos.cpp +++ b/src/pos.cpp @@ -140,6 +140,11 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, int64_t blockTim unsigned int nProofOfWorkLimit = UintToArith256(params.pos.diffLimit).GetCompact(); + // Lower difficulty fork for mock network testing + if (fMockNetwork) { + return nProofOfWorkLimit; + } + int nHeight{pindexLast->nHeight + 1}; bool newDifficultyAdjust{nHeight > params.EunosHeight}; diff --git a/src/validation.cpp b/src/validation.cpp index cba13ccdbf..414f9d9496 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -4360,8 +4360,7 @@ static Res VaultSplits(CCustomCSView& view, ATTRIBUTES& attributes, const DCT_ID auto oldTokenAmount = value.second; auto newTokenAmount = CTokenAmount{newTokenId, CalculateNewAmount(multiplier, oldTokenAmount.nValue)}; - value.second.nTokenId = newTokenAmount.nTokenId; - value.second.nValue = newTokenAmount.nValue; + value.second = newTokenAmount; view.StoreAuctionBid(key, value); diff --git a/src/version.h b/src/version.h index 3ab303d56c..fb84cea92d 100644 --- a/src/version.h +++ b/src/version.h @@ -9,7 +9,7 @@ * network protocol versioning */ -static const int PROTOCOL_VERSION = 70029; +static const int PROTOCOL_VERSION = 100000; //! initial proto version, to be increased after version/verack negotiation static const int INIT_PROTO_VERSION = 209; @@ -18,7 +18,7 @@ static const int INIT_PROTO_VERSION = 209; static const int GETHEADERS_VERSION = 31800; //! disconnect from peers older than this proto version -static const int MIN_PEER_PROTO_VERSION = 70023; +static const int MIN_PEER_PROTO_VERSION = 100000; //! nTime field added to CAddress, starting with this version; //! if possible, avoid requesting addresses nodes older than this From e70c9bf47de9ac6476301a8d20e525fcc20a6640 Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Sun, 5 Jun 2022 01:18:21 +0530 Subject: [PATCH 2/4] Revert irrelevant changes --- src/pos.cpp | 5 ----- src/version.h | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/pos.cpp b/src/pos.cpp index dddcaf8b18..81cd0a856e 100644 --- a/src/pos.cpp +++ b/src/pos.cpp @@ -140,11 +140,6 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, int64_t blockTim unsigned int nProofOfWorkLimit = UintToArith256(params.pos.diffLimit).GetCompact(); - // Lower difficulty fork for mock network testing - if (fMockNetwork) { - return nProofOfWorkLimit; - } - int nHeight{pindexLast->nHeight + 1}; bool newDifficultyAdjust{nHeight > params.EunosHeight}; diff --git a/src/version.h b/src/version.h index fb84cea92d..3ab303d56c 100644 --- a/src/version.h +++ b/src/version.h @@ -9,7 +9,7 @@ * network protocol versioning */ -static const int PROTOCOL_VERSION = 100000; +static const int PROTOCOL_VERSION = 70029; //! initial proto version, to be increased after version/verack negotiation static const int INIT_PROTO_VERSION = 209; @@ -18,7 +18,7 @@ static const int INIT_PROTO_VERSION = 209; static const int GETHEADERS_VERSION = 31800; //! disconnect from peers older than this proto version -static const int MIN_PEER_PROTO_VERSION = 100000; +static const int MIN_PEER_PROTO_VERSION = 70023; //! nTime field added to CAddress, starting with this version; //! if possible, avoid requesting addresses nodes older than this From 257076b8a976a2e9e83ca94e828b31d5835a9a0d Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Sun, 5 Jun 2022 01:20:39 +0530 Subject: [PATCH 3/4] Revert irrelevant changes --- src/masternodes/mn_checks.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/masternodes/mn_checks.h b/src/masternodes/mn_checks.h index 32b5e36cb9..2424220d65 100644 --- a/src/masternodes/mn_checks.h +++ b/src/masternodes/mn_checks.h @@ -103,7 +103,6 @@ enum class CustomTxType : uint8_t // Marker TXs FutureSwapExecution = 'q', FutureSwapRefund = 'w', - TokenSplit = 'z', }; inline CustomTxType CustomTxCodeToType(uint8_t ch) { @@ -161,7 +160,6 @@ inline CustomTxType CustomTxCodeToType(uint8_t ch) { case CustomTxType::AuctionBid: case CustomTxType::FutureSwapExecution: case CustomTxType::FutureSwapRefund: - case CustomTxType::TokenSplit: case CustomTxType::Reject: case CustomTxType::None: return type; From b751c1001fc36ef69b3062c0a31cb5e39e5f0fb2 Mon Sep 17 00:00:00 2001 From: Peter Bushnell Date: Sun, 5 Jun 2022 08:16:34 +0100 Subject: [PATCH 4/4] Sync blocks before checking value --- test/functional/feature_loan_vault.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/functional/feature_loan_vault.py b/test/functional/feature_loan_vault.py index 3a38dbfca6..2f826e5eac 100755 --- a/test/functional/feature_loan_vault.py +++ b/test/functional/feature_loan_vault.py @@ -608,6 +608,7 @@ def test_closevault(self): assert_equal(len(list_vault), 4) self.nodes[0].closevault(self.vaults[3], self.owner_addresses[1]) self.nodes[0].generate(1) + self.sync_blocks() list_vault = self.nodes[1].listvaults() assert_equal(len(list_vault), 3) try: