diff --git a/CHANGELOG.md b/CHANGELOG.md index f3d80ef760..51f7f2f5c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## v13.2.3 (2024-05-18) +- Create V2 transactions by default +- Disconnect from peers older than version 70015 +- Increased `DEFAULT_MIN_RELAY_TX_FEE` to 100000 + ## v13.2.2 (2024-01-24) - Set mainnet hard fork date to April 24, 2024 - Adjusted minimum fee calculations diff --git a/README.md b/README.md index 400f1e06b9..fbb15af4a3 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ https://blackcoinmore.org What is Blackcoin? ---------------- -Blackcoin is a decentralised digital currency with near-instant transaction speeds and negligible transaction fees built upon Proof of Stake 3.0 (PoSV3, BPoS) as +Blackcoin is a decentralised digital currency with near-instant transaction speeds and negligible transaction fees built upon Proof of Stake 3.1 (PoSV3, BPoS) as introduced by the Blackcoin development team. For more information about Blackcoin itself, see https://blackcoin.org. @@ -79,8 +79,5 @@ However, it may contain experimental features and should be used with caution. ### 13.2 The release branch for Blackcoin More 13.2.x. It is intended to contain stable and functional code that has been thoroughly tested and reviewed. -### 25.x -The release branch for Blackcoin More 25.x. Contains functional but experimental code. - ### 26.x The release branch for Blackcoin More 26.x. Contains functional but highly experimental code. diff --git a/configure.ac b/configure.ac index a40c4a6870..3c54fcbbf5 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ AC_PREREQ([2.69]) define(_CLIENT_VERSION_MAJOR, 13) define(_CLIENT_VERSION_MINOR, 2) -define(_CLIENT_VERSION_BUILD, 2) +define(_CLIENT_VERSION_BUILD, 3) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2024) define(_COPYRIGHT_HOLDERS,[The %s developers]) diff --git a/contrib/seeds/nodes_main.txt b/contrib/seeds/nodes_main.txt index ad46cd07a4..234ea6320a 100644 --- a/contrib/seeds/nodes_main.txt +++ b/contrib/seeds/nodes_main.txt @@ -36,6 +36,10 @@ [2a02:c207:2110:9259::1] [2a10:3781:525:1::210] [2a10:3781:525:1::201] +[2a10:3781:525:1::211] +[2a10:3781:525:1::212] +[2a10:3781:525:1::213] +[2a10:3781:525:1::215] [2a10:3781:525:6::10] [2a10:3781:525:6::11] [2602:fec3:2:10::9:91] diff --git a/contrib/seeds/nodes_test.txt b/contrib/seeds/nodes_test.txt index 8772f2a792..849dd7bb12 100644 --- a/contrib/seeds/nodes_test.txt +++ b/contrib/seeds/nodes_test.txt @@ -5,7 +5,6 @@ 167.86.117.144 167.86.117.143 45.137.91.173 -45.137.91.173 5.189.160.139 81.0.246.79 5.189.159.220 @@ -27,8 +26,12 @@ [2a02:c207:2110:9257::1] [2a02:c204:2110:9258::1] [2a02:c207:2110:9259::1] -[2a10:3781:525:1::210] [2a10:3781:525:1::201] +[2a10:3781:525:1::210] +[2a10:3781:525:1::211] +[2a10:3781:525:1::212] +[2a10:3781:525:1::213] +[2a10:3781:525:1::215] [2a10:3781:525:6::10] [2a10:3781:525:6::11] diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 30df2166f6..a65dae2fcc 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -117,7 +117,7 @@ class CMainParams : public CChainParams { consensus.nCoinbaseMaturity = 500; // The best chain should have at least this much work. - consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000416ebe78f593ec11fb2"); // block 4791500 + consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000042bc25fcf69bab7b312"); // block 4938940 /** * The message start string is designed to be unlikely to occur in normal data. @@ -164,9 +164,10 @@ class CMainParams : public CChainParams { (254348, uint256S("0x9bf8d9bd757d3ef23d5906d70567e5f0da93f1e0376588c8d421a95e2421838b")) // minor network split (319002, uint256S("0x0011494d03b2cdf1ecfc8b0818f1e0ef7ee1d9e9b3d1279c10d35456bc3899ef")) // hardfork (872456, uint256S("0xe4fd321ced1de06213d2e246b150b4bfd8c4aa0989965dce88f2a58668c64860")) // hardfork - (4232630, uint256S("0xae0c2a9bd13746e2887ca57bf1046b3c787a5ed1068fd1633a3575f08ee291fc")), // start devfund - 1668631296, // * UNIX timestamp of last checkpoint block - 13562393, // * total number of transactions between genesis and last checkpoint + (4232630, uint256S("0xae0c2a9bd13746e2887ca57bf1046b3c787a5ed1068fd1633a3575f08ee291fc")) // start devfund + (4908715, uint256S("0x6f8e37e21aa2fba3f8e2d6825cb825ca290e9367ed08b8c30943bc16efcba119")), // PoS v3.1 hardfork + 1713938480, // * UNIX timestamp of last checkpoint block + 15170003, // * total number of transactions between genesis and last checkpoint // (the tx=... number in the SetBestChain debug.log lines) 3500.0 // * estimated number of transactions per day after checkpoint }; @@ -220,7 +221,7 @@ class CTestNetParams : public CChainParams { nDefaultPort = 25714; // The best chain should have at least this much work. - consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000478d1e3e759bd0f7e2"); // block 1720482 + consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000004ef99ad4b35ad0930a"); // block 1866885 nPruneAfterHeight = 1000; @@ -249,10 +250,11 @@ class CTestNetParams : public CChainParams { checkpointData = (CCheckpointData) { boost::assign::map_list_of ( 90235, uint256S("0x567898e79184dc2f7dc3a661f794f28566e4b856d70180914f7371b1b3cc82d8")) //initial snapshot + (1320664, uint256S("0x64fa6a5414c6797629d34ef150c46486a5e1d49d2bceb87d6da14a501f838afd")) //PoS v3.1 hardfork (1415393, uint256S("0x5d5c42500cc6057533e249ba9eeb9b5e998aff30468c904bc267ec9bccbc8b39")), //start devfund 1685643568, - 70100, - 2.0 + 280130, + 3500.0 }; // A vector of p2sh addresses diff --git a/src/chainparamsseeds.h b/src/chainparamsseeds.h index 48f0bba5e6..9c7e5d561a 100644 --- a/src/chainparamsseeds.h +++ b/src/chainparamsseeds.h @@ -40,6 +40,10 @@ static SeedSpec6 pnSeed6_main[] = { {{0x2a,0x02,0xc2,0x07,0x21,0x10,0x92,0x59,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 15714}, {{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x10}, 15714}, {{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01}, 15714}, + {{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x11}, 15714}, + {{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x12}, 15714}, + {{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x13}, 15714}, + {{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x15}, 15714}, {{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10}, 15714}, {{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11}, 15714}, {{0x26,0x02,0xfe,0xc3,0x00,0x02,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x09,0x00,0x91}, 15714}, @@ -56,7 +60,6 @@ static SeedSpec6 pnSeed6_test[] = { {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa7,0x56,0x75,0x90}, 25714}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa7,0x56,0x75,0x8f}, 25714}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x89,0x5b,0xad}, 25714}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x89,0x5b,0xad}, 25714}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0xbd,0xa0,0x8b}, 25714}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x51,0x00,0xf6,0x4f}, 25714}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0xbd,0x9f,0xdc}, 25714}, @@ -76,7 +79,12 @@ static SeedSpec6 pnSeed6_test[] = { {{0x2a,0x02,0xc2,0x07,0x21,0x10,0x92,0x57,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 25714}, {{0x2a,0x02,0xc2,0x04,0x21,0x10,0x92,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 25714}, {{0x2a,0x02,0xc2,0x07,0x21,0x10,0x92,0x59,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 25714}, + {{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01}, 25714}, {{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x10}, 25714}, + {{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x11}, 25714}, + {{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x12}, 25714}, + {{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x13}, 25714}, + {{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x15}, 25714}, {{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01}, 25714}, {{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10}, 25714}, {{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11}, 25714}, diff --git a/src/clientversion.h b/src/clientversion.h index 3f9e1af37e..8f531e439f 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -16,7 +16,7 @@ //! These need to be macros, as clientversion.cpp's and bitcoin*-res.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 13 #define CLIENT_VERSION_MINOR 2 -#define CLIENT_VERSION_BUILD 2 +#define CLIENT_VERSION_BUILD 3 //! Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true diff --git a/src/main.cpp b/src/main.cpp index 033ecece56..198f0bff8d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1226,9 +1226,9 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C return state.DoS(0, false, REJECT_INVALID, "too many dust vouts"); } - // Blackcoin: in v2 transactions use GetAdjustedTime() as TxTime + // Blackcoin: in v2 transactions use GetAdjustedTime() as nTimeTx int64_t nTimeTx = (int64_t)tx.nTime; - if (!nTimeTx && tx.nVersion >= CTransaction::MAX_STANDARD_VERSION) + if (!nTimeTx && tx.nVersion >= 2) nTimeTx = GetAdjustedTime(); if (!CheckTransaction(tx, state)) @@ -1242,14 +1242,6 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C if (tx.IsCoinStake()) return state.DoS(100, false, REJECT_INVALID, "coinstake"); - // Don't relay version 2 transactions until CSV is active, and we can be - // sure that such transactions will be mined (unless we're on - // -testnet/-regtest). - const CChainParams& chainparams = Params(); - if (fRequireStandard && tx.nVersion >= CTransaction::MAX_STANDARD_VERSION && !chainparams.GetConsensus().IsProtocolV3_1(nTimeTx)) { - return state.DoS(0, false, REJECT_NONSTANDARD, "premature-version2-tx"); - } - // Rather not work on nonstandard transactions (unless -testnet/-regtest) string reason; if (fRequireStandard && !IsStandardTx(tx, reason)) @@ -1348,7 +1340,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C CAmount nFees = nValueIn-nValueOut; // Blackcoin: Minimum fee check - if (chainparams.GetConsensus().IsProtocolV3_1(nTimeTx) && nFees < GetMinFee(tx, nTimeTx)) + if (Params().GetConsensus().IsProtocolV3_1(nTimeTx) && nFees < GetMinFee(tx, nTimeTx)) return state.Invalid(false, REJECT_INSUFFICIENTFEE, "fee is below minimum"); // nModifiedFees includes any fee deltas from PrioritiseTransaction @@ -2007,9 +1999,9 @@ bool CheckTxInputs(const CTransaction& tx, CValidationState& state, const CCoins if (!inputs.HaveInputs(tx)) return state.Invalid(false, 0, "", "Inputs unavailable"); - // Blackcoin: in v2 transactions use GetAdjustedTime() as TxTime + // Blackcoin: in v2 transactions use GetAdjustedTime() as nTimeTx int64_t nTimeTx = tx.nTime; - if (!nTimeTx && tx.nVersion >= CTransaction::MAX_STANDARD_VERSION) + if (!nTimeTx && tx.nVersion >= 2) nTimeTx = GetAdjustedTime(); CAmount nValueIn = 0; @@ -5179,7 +5171,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, return false; } - if (pfrom->nVersion < (chainparams.GetConsensus().IsProtocolV3_1(GetAdjustedTime()) ? PROTOCOL_VERSION : MIN_PEER_PROTO_VERSION)) + if (pfrom->nVersion < MIN_PEER_PROTO_VERSION) { // disconnect from peers older than this proto version LogPrintf("peer=%d using obsolete version %i; disconnecting\n", pfrom->id, pfrom->nVersion); diff --git a/src/main.h b/src/main.h index 9648d9d733..46e93e1a75 100644 --- a/src/main.h +++ b/src/main.h @@ -56,7 +56,7 @@ static const unsigned int MIN_TX_FEE = 10000; /** Minimum fee per kB */ static const unsigned int TX_FEE_PER_KB = 100000; /** Default for -minrelaytxfee, minimum relay fee for transactions */ -static const unsigned int DEFAULT_MIN_RELAY_TX_FEE = 10000; +static const unsigned int DEFAULT_MIN_RELAY_TX_FEE = 100000; //! -maxtxfee default static const CAmount DEFAULT_TRANSACTION_MAXFEE = 1 * COIN; //! Discourage users to set fees higher than this amount (in satoshis) per kB diff --git a/src/miner.cpp b/src/miner.cpp index 86d7518f9a..d8f5e842a9 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -137,11 +137,7 @@ CBlockTemplate* BlockAssembler::CreateNewBlock(const CScript& scriptPubKeyIn, in pblock->nVersion = GetArg("-blockversion", pblock->nVersion); pblock->nTime = GetAdjustedTime(); - const int64_t nMedianTimePast = pindexPrev->GetPastTimeLimit(); - - nLockTimeCutoff = (STANDARD_LOCKTIME_VERIFY_FLAGS & LOCKTIME_MEDIAN_TIME_PAST) - ? nMedianTimePast - : pblock->GetBlockTime(); + nLockTimeCutoff = pindexPrev->GetPastTimeLimit(); addPriorityTxs(pblock->GetBlockTime(), fProofOfStake); addPackageTxs(); diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp index a76326aa59..3c25c2024b 100644 --- a/src/policy/policy.cpp +++ b/src/policy/policy.cpp @@ -64,7 +64,7 @@ int64_t FutureDrift(int64_t nTime) bool IsStandardTx(const CTransaction& tx, std::string& reason) { - if ((!Params().GetConsensus().IsProtocolV3_1(tx.nTime ? tx.nTime : GetAdjustedTime()) && (tx.nVersion > CTransaction::MAX_STANDARD_VERSION-1)) || tx.nVersion > CTransaction::MAX_STANDARD_VERSION || tx.nVersion < 1) { + if (tx.nVersion > CTransaction::MAX_STANDARD_VERSION || tx.nVersion < 1) { reason = "version"; return false; } diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index b8df154530..c890f7c0b4 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -248,7 +248,7 @@ class CTransaction public: // Default transaction version. - static const int32_t CURRENT_VERSION=1; + static const int32_t CURRENT_VERSION=2; // Changing the default transaction version requires a two step process: first // adapting relay policy by bumping MAX_STANDARD_VERSION, and then later date diff --git a/src/version.h b/src/version.h index 102450a5a3..ec9df0a8d7 100644 --- a/src/version.h +++ b/src/version.h @@ -22,7 +22,7 @@ static const int CANONICAL_BLOCK_SIG_VERSION = 60016; static const int CANONICAL_BLOCK_SIG_LOW_S_VERSION = 60018; //! disconnect from peers older than this proto version -static const int MIN_PEER_PROTO_VERSION = 70012; +static const int MIN_PEER_PROTO_VERSION = 70015; //! nTime field added to CAddress, starting with this version; //! if possible, avoid requesting addresses nodes older than this diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index f70ca0ebee..21e8c42495 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2621,7 +2621,7 @@ bool CWallet::CreateTransaction(const vector& vecSend, CWalletTx& wt std::vector vAvailableCoins; AvailableCoins(vAvailableCoins, true, coinControl); - nFeeRet = Params().GetConsensus().IsProtocolV3_1(txNew.nTime) ? MIN_TX_FEE : 0; + nFeeRet = MIN_TX_FEE; // Start with no fee and loop until there is enough fee while (true) { @@ -3711,7 +3711,7 @@ std::string CWallet::GetWalletHelpString(bool showDebug) strUsage += HelpMessageOpt("-salvagewallet", _("Attempt to recover private keys from a corrupt wallet on startup")); strUsage += HelpMessageOpt("-spendzeroconfchange", strprintf(_("Spend unconfirmed change when sending transactions (default: %u)"), DEFAULT_SPEND_ZEROCONF_CHANGE)); strUsage += HelpMessageOpt("-txconfirmtarget=", strprintf(_("If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)"), DEFAULT_TX_CONFIRM_TARGET)); - strUsage += HelpMessageOpt("-txversion=", _("Set default transaction version") + " " + _("(default: 1)")); + strUsage += HelpMessageOpt("-txversion=", _("Set default transaction version") + " " + _("(default: 2)")); strUsage += HelpMessageOpt("-usehd", _("Use hierarchical deterministic key generation (HD) after BIP32. Only has effect during wallet creation/first start") + " " + strprintf(_("(default: %u)"), DEFAULT_USE_HD_WALLET)); strUsage += HelpMessageOpt("-upgradewallet", _("Upgrade wallet to latest format on startup")); strUsage += HelpMessageOpt("-wallet=", _("Specify wallet file (within data directory)") + " " + strprintf(_("(default: %s)"), DEFAULT_WALLET_DAT));