2013-05-07 15:16:25 +02:00
// Copyright (c) 2010 Satoshi Nakamoto
2016-02-02 16:28:56 +01:00
// Copyright (c) 2009-2014 The Bitcoin Core developers
2021-04-20 21:33:02 +02:00
// Copyright (c) 2014-2021 The Dash Core developers
2014-10-25 11:24:16 +02:00
// Distributed under the MIT software license, see the accompanying
2013-05-07 15:16:25 +02:00
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
2020-03-19 23:46:56 +01:00
# include <chainparams.h>
2013-04-13 07:13:08 +02:00
2018-09-06 15:54:55 +02:00
# include <chainparamsseeds.h>
# include <consensus/merkle.h>
2021-10-09 18:58:13 +02:00
# include <llmq/params.h>
2020-03-19 23:46:56 +01:00
# include <tinyformat.h>
2022-01-10 19:36:18 +01:00
# include <util/ranges.h>
2021-06-27 08:33:13 +02:00
# include <util/system.h>
# include <util/strencodings.h>
2021-09-03 00:36:11 +02:00
# include <versionbitsinfo.h>
2013-05-07 15:16:25 +02:00
2020-03-19 23:46:56 +01:00
# include <arith_uint256.h>
2017-12-20 12:45:01 +01:00
2014-08-28 22:56:53 +02:00
# include <assert.h>
2013-05-07 15:16:25 +02:00
2021-09-03 00:36:11 +02:00
# include <boost/algorithm/string/classification.hpp>
# include <boost/algorithm/string/split.hpp>
2015-07-29 21:13:36 +02:00
static CBlock CreateGenesisBlock ( const char * pszTimestamp , const CScript & genesisOutputScript , uint32_t nTime , uint32_t nNonce , uint32_t nBits , int32_t nVersion , const CAmount & genesisReward )
2015-07-03 14:29:57 +02:00
{
CMutableTransaction txNew ;
txNew . nVersion = 1 ;
txNew . vin . resize ( 1 ) ;
txNew . vout . resize ( 1 ) ;
2015-06-05 22:01:44 +02:00
txNew . vin [ 0 ] . scriptSig = CScript ( ) < < 486604799 < < CScriptNum ( 4 ) < < std : : vector < unsigned char > ( ( const unsigned char * ) pszTimestamp , ( const unsigned char * ) pszTimestamp + strlen ( pszTimestamp ) ) ;
2015-07-03 14:29:57 +02:00
txNew . vout [ 0 ] . nValue = genesisReward ;
txNew . vout [ 0 ] . scriptPubKey = genesisOutputScript ;
CBlock genesis ;
genesis . nTime = nTime ;
genesis . nBits = nBits ;
genesis . nNonce = nNonce ;
genesis . nVersion = nVersion ;
2016-11-21 10:51:32 +01:00
genesis . vtx . push_back ( MakeTransactionRef ( std : : move ( txNew ) ) ) ;
2015-07-03 14:29:57 +02:00
genesis . hashPrevBlock . SetNull ( ) ;
2015-11-17 17:35:44 +01:00
genesis . hashMerkleRoot = BlockMerkleRoot ( genesis ) ;
2015-07-03 14:29:57 +02:00
return genesis ;
}
2022-02-28 17:43:00 +01:00
static CBlock CreateDevNetGenesisBlock ( const uint256 & prevBlockHash , const std : : string & devNetName , uint32_t nTime , uint32_t nNonce , uint32_t nBits , const CAmount & genesisReward )
2017-12-20 12:45:01 +01:00
{
assert ( ! devNetName . empty ( ) ) ;
CMutableTransaction txNew ;
2018-05-13 22:56:21 +02:00
txNew . nVersion = 1 ;
2017-12-20 12:45:01 +01:00
txNew . vin . resize ( 1 ) ;
txNew . vout . resize ( 1 ) ;
2018-01-20 06:59:38 +01:00
// put height (BIP34) and devnet name into coinbase
2022-02-28 17:43:00 +01:00
txNew . vin [ 0 ] . scriptSig = CScript ( ) < < 1 < < std : : vector < unsigned char > ( devNetName . begin ( ) , devNetName . end ( ) ) ;
2017-12-20 12:45:01 +01:00
txNew . vout [ 0 ] . nValue = genesisReward ;
txNew . vout [ 0 ] . scriptPubKey = CScript ( ) < < OP_RETURN ;
CBlock genesis ;
genesis . nTime = nTime ;
genesis . nBits = nBits ;
genesis . nNonce = nNonce ;
2018-05-13 22:56:21 +02:00
genesis . nVersion = 4 ;
2018-01-16 08:30:52 +01:00
genesis . vtx . push_back ( MakeTransactionRef ( std : : move ( txNew ) ) ) ;
2017-12-20 12:45:01 +01:00
genesis . hashPrevBlock = prevBlockHash ;
genesis . hashMerkleRoot = BlockMerkleRoot ( genesis ) ;
return genesis ;
}
2014-10-25 11:24:16 +02:00
/**
2015-07-03 14:29:57 +02:00
* Build the genesis block . Note that the output of its generation
* transaction cannot be spent since it did not originally exist in the
* database .
*
2016-02-02 16:28:56 +01:00
* CBlock ( hash = 00000ff d590b14 , ver = 1 , hashPrevBlock = 00000000000000 , hashMerkleRoot = e0028e , nTime = 1390095618 , nBits = 1e0 ffff0 , nNonce = 28917698 , vtx = 1 )
* CTransaction ( hash = e0028e , ver = 1 , vin . size = 1 , vout . size = 1 , nLockTime = 0 )
* CTxIn ( COutPoint ( 000000 , - 1 ) , coinbase 04ff ff001d01044c5957697265642030392f4a616e2f3230313420546865204772616e64204578706572696d656e7420476f6573204c6976653a204f76657273746f636b2e636f6d204973204e6f7720416363657074696e6720426974636f696e73 )
* CTxOut ( nValue = 50.00000000 , scriptPubKey = 0xA9037BAC7050C479B121CF )
* vMerkleTree : e0028e
2014-10-25 11:24:16 +02:00
*/
2015-07-29 21:13:36 +02:00
static CBlock CreateGenesisBlock ( uint32_t nTime , uint32_t nNonce , uint32_t nBits , int32_t nVersion , const CAmount & genesisReward )
2013-05-07 15:16:25 +02:00
{
2016-02-02 16:28:56 +01:00
const char * pszTimestamp = " Wired 09/Jan/2014 The Grand Experiment Goes Live: Overstock.com Is Now Accepting Bitcoins " ;
const CScript genesisOutputScript = CScript ( ) < < ParseHex ( " 040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9 " ) < < OP_CHECKSIG ;
2015-07-03 14:29:57 +02:00
return CreateGenesisBlock ( pszTimestamp , genesisOutputScript , nTime , nNonce , nBits , nVersion , genesisReward ) ;
2014-07-24 13:52:57 +02:00
}
2013-05-07 15:16:25 +02:00
2022-02-28 17:43:00 +01:00
static CBlock FindDevNetGenesisBlock ( const CBlock & prevBlock , const CAmount & reward )
2017-12-20 12:45:01 +01:00
{
2020-04-29 12:16:37 +02:00
std : : string devNetName = gArgs . GetDevNetName ( ) ;
2017-12-20 12:45:01 +01:00
assert ( ! devNetName . empty ( ) ) ;
2022-02-28 17:43:00 +01:00
CBlock block = CreateDevNetGenesisBlock ( prevBlock . GetHash ( ) , devNetName , prevBlock . nTime + 1 , 0 , prevBlock . nBits , reward ) ;
2017-12-20 12:45:01 +01:00
arith_uint256 bnTarget ;
bnTarget . SetCompact ( block . nBits ) ;
for ( uint32_t nNonce = 0 ; nNonce < UINT32_MAX ; nNonce + + ) {
block . nNonce = nNonce ;
uint256 hash = block . GetHash ( ) ;
if ( UintToArith256 ( hash ) < = bnTarget )
return block ;
}
// This is very unlikely to happen as we start the devnet with a very low difficulty. In many cases even the first
// iteration of the above loop will give a result already
error ( " FindDevNetGenesisBlock: could not find devnet genesis block for %s " , devNetName ) ;
assert ( false ) ;
}
2021-10-15 12:28:19 +02:00
void CChainParams : : AddLLMQ ( Consensus : : LLMQType llmqType )
{
2022-01-10 19:36:18 +01:00
assert ( ! HasLLMQ ( llmqType ) ) ;
2021-10-15 12:28:19 +02:00
for ( const auto & llmq_param : Consensus : : available_llmqs ) {
if ( llmq_param . type = = llmqType ) {
2022-01-10 19:36:18 +01:00
consensus . llmqs . push_back ( llmq_param ) ;
2021-10-15 12:28:19 +02:00
return ;
}
}
error ( " CChainParams::%s: unknown LLMQ type %d " , __func__ , static_cast < uint8_t > ( llmqType ) ) ;
assert ( false ) ;
}
2022-01-10 19:36:18 +01:00
const Consensus : : LLMQParams & CChainParams : : GetLLMQ ( Consensus : : LLMQType llmqType ) const
{
for ( const auto & llmq_param : consensus . llmqs ) {
if ( llmq_param . type = = llmqType ) {
return llmq_param ;
}
}
error ( " CChainParams::%s: unknown LLMQ type %d " , __func__ , static_cast < uint8_t > ( llmqType ) ) ;
assert ( false ) ;
}
bool CChainParams : : HasLLMQ ( Consensus : : LLMQType llmqType ) const
{
for ( const auto & llmq_param : consensus . llmqs ) {
if ( llmq_param . type = = llmqType ) {
return true ;
}
}
return false ;
}
2014-10-25 11:24:16 +02:00
/**
* Main network
*/
2013-05-07 15:16:25 +02:00
class CMainParams : public CChainParams {
public :
CMainParams ( ) {
2014-06-11 12:23:49 +02:00
strNetworkID = " main " ;
2016-05-09 21:36:10 +02:00
consensus . nSubsidyHalvingInterval = 210240 ; // Note: actual number of blocks per calendar year with DGW v3 is ~200700 (for example 449750 - 249050)
2016-02-17 17:29:36 +01:00
consensus . nMasternodePaymentsStartBlock = 100000 ; // not true, but it's ok as long as it's less then nMasternodePaymentsIncreaseBlock
2016-05-09 21:36:10 +02:00
consensus . nMasternodePaymentsIncreaseBlock = 158000 ; // actual historical value
consensus . nMasternodePaymentsIncreasePeriod = 576 * 30 ; // 17280 - actual historical value
2018-03-10 13:35:09 +01:00
consensus . nInstantSendConfirmationsRequired = 6 ;
2016-06-29 20:20:18 +02:00
consensus . nInstantSendKeepLock = 24 ;
2016-05-09 21:36:10 +02:00
consensus . nBudgetPaymentsStartBlock = 328008 ; // actual historical value
consensus . nBudgetPaymentsCycleBlocks = 16616 ; // ~(60*24*30)/2.6, actual number of blocks per month is 200700 / 12 = 16725
2016-02-17 17:29:36 +01:00
consensus . nBudgetPaymentsWindowBlocks = 100 ;
2017-02-03 18:41:23 +01:00
consensus . nSuperblockStartBlock = 614820 ; // The block at which 12.1 goes live (end of final 12.0 budget cycle)
2018-02-01 13:42:21 +01:00
consensus . nSuperblockStartHash = uint256S ( " 0000000000020cb27c7ef164d21003d5d20cdca2f54dd9a9ca6d45f4d47f8aa3 " ) ;
2016-09-11 20:01:26 +02:00
consensus . nSuperblockCycle = 16616 ; // ~(60*24*30)/2.6, actual number of blocks per month is 200700 / 12 = 16725
2016-08-28 21:15:48 +02:00
consensus . nGovernanceMinQuorum = 10 ;
2017-02-02 09:50:44 +01:00
consensus . nGovernanceFilterElements = 20000 ;
2016-05-19 21:03:17 +02:00
consensus . nMasternodeMinimumConfirmations = 15 ;
2018-01-20 15:49:54 +01:00
consensus . BIP34Height = 951 ;
consensus . BIP34Hash = uint256S ( " 0x000001f35e70f7c5705f64c6c5cc3dea9449e74d5b5c7cf74dad1bcca14a8012 " ) ;
consensus . BIP65Height = 619382 ; // 00000000000076d8fcea02ec0963de4abfd01e771fec0863f960c2c64fe6f357
consensus . BIP66Height = 245817 ; // 00000000000b1fa2dfa312863570e13fae9ca7b5566cb27e55422620b469aefa
2018-03-08 13:18:24 +01:00
consensus . DIP0001Height = 782208 ;
2019-04-25 17:39:04 +02:00
consensus . DIP0003Height = 1028160 ;
2019-04-03 11:15:41 +02:00
consensus . DIP0003EnforcementHeight = 1047200 ;
consensus . DIP0003EnforcementHash = uint256S ( " 000000000000002d1734087b4c5afc3133e4e1c3e1a89218f62bcd9bb3d17f81 " ) ;
2020-12-28 12:21:01 +01:00
consensus . DIP0008Height = 1088640 ; // 00000000000000112e41e4b3afda8b233b8cc07c532d2eac5de097b68358c43e
2022-03-14 22:40:01 +01:00
consensus . BRRHeight = 1374912 ; // 000000000000000c5a124f3eccfbe6e17876dca79cec9e63dfa70d269113c926
2021-12-12 15:48:21 +01:00
consensus . MinBIP9WarningHeight = 1090656 ; // dip8 activation height + miner confirmation window
2018-03-19 14:08:32 +01:00
consensus . powLimit = uint256S ( " 00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff " ) ; // ~uint256(0) >> 20
2016-02-02 16:28:56 +01:00
consensus . nPowTargetTimespan = 24 * 60 * 60 ; // Dash: 1 day
consensus . nPowTargetSpacing = 2.5 * 60 ; // Dash: 2.5 minutes
2015-02-11 11:58:11 +01:00
consensus . fPowAllowMinDifficultyBlocks = false ;
2015-10-19 14:25:29 +02:00
consensus . fPowNoRetargeting = false ;
2017-12-01 06:15:11 +01:00
consensus . nPowKGWHeight = 15200 ;
consensus . nPowDGWHeight = 34140 ;
2016-02-15 05:13:27 +01:00
consensus . nRuleChangeActivationThreshold = 1916 ; // 95% of 2016
consensus . nMinerConfirmationWindow = 2016 ; // nPowTargetTimespan / nPowTargetSpacing
2016-03-09 22:00:53 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_TESTDUMMY ] . bit = 28 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_TESTDUMMY ] . nStartTime = 1199145601 ; // January 1, 2008
consensus . vDeployments [ Consensus : : DEPLOYMENT_TESTDUMMY ] . nTimeout = 1230767999 ; // December 31, 2008
2016-02-20 23:37:13 +01:00
// Deployment of BIP68, BIP112, and BIP113.
consensus . vDeployments [ Consensus : : DEPLOYMENT_CSV ] . bit = 0 ;
2017-02-04 01:41:18 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_CSV ] . nStartTime = 1486252800 ; // Feb 5th, 2017
consensus . vDeployments [ Consensus : : DEPLOYMENT_CSV ] . nTimeout = 1517788800 ; // Feb 5th, 2018
2016-02-20 23:37:13 +01:00
2017-09-11 16:13:30 +02:00
// Deployment of DIP0001
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0001 ] . bit = 1 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0001 ] . nStartTime = 1508025600 ; // Oct 15th, 2017
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0001 ] . nTimeout = 1539561600 ; // Oct 15th, 2018
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0001 ] . nWindowSize = 4032 ;
2020-09-12 16:33:12 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0001 ] . nThresholdStart = 3226 ; // 80% of 4032
2017-09-11 16:13:30 +02:00
2018-01-30 20:18:51 +01:00
// Deployment of BIP147
consensus . vDeployments [ Consensus : : DEPLOYMENT_BIP147 ] . bit = 2 ;
2018-04-20 12:54:49 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_BIP147 ] . nStartTime = 1524477600 ; // Apr 23th, 2018
consensus . vDeployments [ Consensus : : DEPLOYMENT_BIP147 ] . nTimeout = 1556013600 ; // Apr 23th, 2019
2018-01-30 20:18:51 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_BIP147 ] . nWindowSize = 4032 ;
2020-09-12 16:33:12 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_BIP147 ] . nThresholdStart = 3226 ; // 80% of 4032
2018-01-30 20:18:51 +01:00
2018-12-28 14:03:17 +01:00
// Deployment of DIP0003
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0003 ] . bit = 3 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0003 ] . nStartTime = 1546300800 ; // Jan 1st, 2019
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0003 ] . nTimeout = 1577836800 ; // Jan 1st, 2020
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0003 ] . nWindowSize = 4032 ;
2020-09-12 16:33:12 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0003 ] . nThresholdStart = 3226 ; // 80% of 4032
2018-12-28 14:03:17 +01:00
2019-05-13 12:35:03 +02:00
// Deployment of DIP0008
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0008 ] . bit = 4 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0008 ] . nStartTime = 1557878400 ; // May 15th, 2019
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0008 ] . nTimeout = 1589500800 ; // May 15th, 2020
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0008 ] . nWindowSize = 4032 ;
2020-09-12 16:33:12 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0008 ] . nThresholdStart = 3226 ; // 80% of 4032
2019-05-13 12:35:03 +02:00
2020-09-10 18:23:11 +02:00
// Deployment of Block Reward Reallocation
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . bit = 5 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nStartTime = 1601510400 ; // Oct 1st, 2020
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nTimeout = 1633046400 ; // Oct 1st, 2021
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nWindowSize = 4032 ;
2020-09-12 16:33:12 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nThresholdStart = 3226 ; // 80% of 4032
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nThresholdMin = 2420 ; // 60% of 4032
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nFalloffCoeff = 5 ; // this corresponds to 10 periods
2020-09-10 18:23:11 +02:00
2021-05-07 18:36:30 +02:00
// Deployment of DIP0020, DIP0021 and LLMQ_100_67 quorums
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . bit = 6 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nStartTime = 1625097600 ; // July 1st, 2021
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nTimeout = 1656633600 ; // July 1st, 2022
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nWindowSize = 4032 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nThresholdStart = 3226 ; // 80% of 4032
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nThresholdMin = 2420 ; // 60% of 4032
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nFalloffCoeff = 5 ; // this corresponds to 10 periods
2020-11-17 20:28:14 +01:00
2022-04-16 16:46:04 +02:00
// Deployment of Quorum Rotation DIP and decreased proposal fee (Values to be determined)
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . bit = 7 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nStartTime = 999999999999ULL ; // TODO ENABLE BEFORE FINAL RELEASE
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nTimeout = 999999999999ULL ; // TODO ENABLE BEFORE FINAL RELEASE
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nWindowSize = 4032 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nThresholdStart = 3226 ; // 80% of 4032
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nThresholdMin = 2420 ; // 60% of 4032
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nFalloffCoeff = 5 ; // this corresponds to 10 periods
2021-11-01 16:31:48 +01:00
2017-08-23 16:21:08 +02:00
// The best chain should have at least this much work.
Bump chainparams for mainnet and testnet (#4087)
* Bump nMinimumChainWork and defaultAssumeValid for mainnet and testnet
* Bump DEPLOYMENT_V17 start and timeout
* Bump chaintxdata
mainnet:
{
"time": 1617874573,
"txcount": 34709765,
"window_final_block_hash": "000000000000000bd7dac80e97279c984a3266145c130ab76021f5bac6d80ff3",
"window_block_count": 17280,
"window_tx_count": 822851,
"window_interval": 2723924,
"txrate": 0.3020829509193355
}
testnet:
{
"time": 1617874832,
"txcount": 4926985,
"window_final_block_hash": "000000b0940bec06e3245dc787743b3a7f039068878aa1c7c6d5b44c443770bf",
"window_block_count": 17280,
"window_tx_count": 26190,
"window_interval": 2438451,
"txrate": 0.01074042496650538
}
2021-04-10 22:34:26 +02:00
consensus . nMinimumChainWork = uint256S ( " 0x00000000000000000000000000000000000000000000549cd3ccb81a55892330 " ) ; // 1450000
2017-08-23 16:21:08 +02:00
// By default assume that the signatures in ancestors of this block are valid.
Bump chainparams for mainnet and testnet (#4087)
* Bump nMinimumChainWork and defaultAssumeValid for mainnet and testnet
* Bump DEPLOYMENT_V17 start and timeout
* Bump chaintxdata
mainnet:
{
"time": 1617874573,
"txcount": 34709765,
"window_final_block_hash": "000000000000000bd7dac80e97279c984a3266145c130ab76021f5bac6d80ff3",
"window_block_count": 17280,
"window_tx_count": 822851,
"window_interval": 2723924,
"txrate": 0.3020829509193355
}
testnet:
{
"time": 1617874832,
"txcount": 4926985,
"window_final_block_hash": "000000b0940bec06e3245dc787743b3a7f039068878aa1c7c6d5b44c443770bf",
"window_block_count": 17280,
"window_tx_count": 26190,
"window_interval": 2438451,
"txrate": 0.01074042496650538
}
2021-04-10 22:34:26 +02:00
consensus . defaultAssumeValid = uint256S ( " 0x00000000000000105cfae44a995332d8ec256850ea33a1f7b700474e3dad82bc " ) ; // 1450000
2017-08-23 16:21:08 +02:00
2016-05-10 09:41:40 +02:00
/**
2014-10-25 11:24:16 +02:00
* The message start string is designed to be unlikely to occur in normal data .
* The characters are rarely used upper ASCII , not valid as UTF - 8 , and produce
2015-04-28 16:47:17 +02:00
* a large 32 - bit integer with any alignment .
2014-10-25 11:24:16 +02:00
*/
2014-11-28 10:56:02 +01:00
pchMessageStart [ 0 ] = 0xbf ;
pchMessageStart [ 1 ] = 0x0c ;
pchMessageStart [ 2 ] = 0x6b ;
pchMessageStart [ 3 ] = 0xbd ;
2014-11-27 18:09:11 +01:00
nDefaultPort = 9999 ;
Add block pruning functionality
This adds a -prune=N option to bitcoind, which if set to N>0 will enable block
file pruning. When pruning is enabled, block and undo files will be deleted to
try to keep total space used by those files to below the prune target (N, in
MB) specified by the user, subject to some constraints:
- The last 288 blocks on the main chain are always kept (MIN_BLOCKS_TO_KEEP),
- N must be at least 550MB (chosen as a value for the target that could
reasonably be met, with some assumptions about block sizes, orphan rates,
etc; see comment in main.h),
- No blocks are pruned until chainActive is at least 100,000 blocks long (on
mainnet; defined separately for mainnet, testnet, and regtest in chainparams
as nPruneAfterHeight).
This unsets NODE_NETWORK if pruning is enabled.
Also included is an RPC test for pruning (pruning.py).
Thanks to @rdponticelli for earlier work on this feature; this is based in
part off that work.
2015-02-23 20:27:44 +01:00
nPruneAfterHeight = 100000 ;
2019-01-12 01:33:11 +01:00
m_assumed_blockchain_size = 35 ;
m_assumed_chain_state_size = 1 ;
2013-05-07 15:16:25 +02:00
2016-02-02 16:28:56 +01:00
genesis = CreateGenesisBlock ( 1390095618 , 28917698 , 0x1e0ffff0 , 1 , 50 * COIN ) ;
2015-02-11 11:58:11 +01:00
consensus . hashGenesisBlock = genesis . GetHash ( ) ;
2016-02-02 16:28:56 +01:00
assert ( consensus . hashGenesisBlock = = uint256S ( " 0x00000ffd590b1485b3caadc19b22e6379c733355108f107a430458cdf3407ab6 " ) ) ;
assert ( genesis . hashMerkleRoot = = uint256S ( " 0xe0028eb9648db56b1ac77cf090b99048a8007e2bb64b68f092c03c7f56a662c7 " ) ) ;
2018-01-24 13:01:14 +01:00
// Note that of those which support the service bits prefix, most only support a subset of
// possible options.
2018-02-02 11:35:42 +01:00
// This is fine at runtime as we'll fall back to using them as a oneshot if they don't support the
2018-01-24 13:01:14 +01:00
// service bits we want, but we should get them updated to support all service bits wanted by any
// release ASAP to avoid it where possible.
vSeeds . emplace_back ( " dnsseed.dash.org " ) ;
2013-05-07 15:16:25 +02:00
2016-02-02 16:28:56 +01:00
// Dash addresses start with 'X'
base58Prefixes [ PUBKEY_ADDRESS ] = std : : vector < unsigned char > ( 1 , 76 ) ;
// Dash script addresses start with '7'
base58Prefixes [ SCRIPT_ADDRESS ] = std : : vector < unsigned char > ( 1 , 16 ) ;
// Dash private keys start with '7' or 'X'
base58Prefixes [ SECRET_KEY ] = std : : vector < unsigned char > ( 1 , 204 ) ;
2016-08-02 00:00:24 +02:00
// Dash BIP32 pubkeys start with 'xpub' (Bitcoin defaults)
2017-06-08 19:35:28 +02:00
base58Prefixes [ EXT_PUBLIC_KEY ] = { 0x04 , 0x88 , 0xB2 , 0x1E } ;
2016-08-02 00:00:24 +02:00
// Dash BIP32 prvkeys start with 'xprv' (Bitcoin defaults)
2017-06-08 19:35:28 +02:00
base58Prefixes [ EXT_SECRET_KEY ] = { 0x04 , 0x88 , 0xAD , 0xE4 } ;
2017-05-29 13:51:40 +02:00
2016-02-02 16:28:56 +01:00
// Dash BIP44 coin type is '5'
2017-05-29 13:51:40 +02:00
nExtCoinType = 5 ;
2016-09-12 19:40:46 +02:00
2015-01-24 05:40:50 +01:00
vFixedSeeds = std : : vector < SeedSpec6 > ( pnSeed6_main , pnSeed6_main + ARRAYLEN ( pnSeed6_main ) ) ;
2013-05-07 15:16:25 +02:00
2018-11-23 15:42:09 +01:00
// long living quorum params
2021-10-15 12:28:19 +02:00
AddLLMQ ( Consensus : : LLMQType : : LLMQ_50_60 ) ;
2022-04-16 16:46:04 +02:00
AddLLMQ ( Consensus : : LLMQType : : LLMQ_60_75 ) ;
2021-10-15 12:28:19 +02:00
AddLLMQ ( Consensus : : LLMQType : : LLMQ_400_60 ) ;
AddLLMQ ( Consensus : : LLMQType : : LLMQ_400_85 ) ;
AddLLMQ ( Consensus : : LLMQType : : LLMQ_100_67 ) ;
consensus . llmqTypeChainLocks = Consensus : : LLMQType : : LLMQ_400_60 ;
consensus . llmqTypeInstantSend = Consensus : : LLMQType : : LLMQ_50_60 ;
2022-04-16 16:46:04 +02:00
consensus . llmqTypeDIP0024InstantSend = Consensus : : LLMQType : : LLMQ_60_75 ;
2021-10-15 12:28:19 +02:00
consensus . llmqTypePlatform = Consensus : : LLMQType : : LLMQ_100_67 ;
2021-12-11 21:00:27 +01:00
consensus . llmqTypeMnhf = Consensus : : LLMQType : : LLMQ_400_85 ;
2018-11-23 15:42:09 +01:00
2015-03-13 17:25:34 +01:00
fDefaultConsistencyChecks = false ;
2014-06-04 12:51:29 +02:00
fRequireStandard = true ;
2018-07-12 11:04:42 +02:00
fRequireRoutableExternalIP = true ;
2019-07-16 22:07:14 +02:00
m_is_test_chain = false ;
2017-12-20 12:45:01 +01:00
fAllowMultipleAddressesFromGroup = false ;
2018-03-08 13:16:52 +01:00
fAllowMultiplePorts = false ;
2020-03-21 12:21:09 +01:00
nLLMQConnectionRetryTimeout = 60 ;
2022-01-09 18:03:26 +01:00
m_is_mockable_chain = false ;
2015-04-03 00:51:08 +02:00
2019-01-07 11:21:10 +01:00
nPoolMinParticipants = 3 ;
2020-12-09 21:00:08 +01:00
nPoolMaxParticipants = 20 ;
2016-09-27 09:50:04 +02:00
nFulfilledRequestExpireTime = 60 * 60 ; // fulfilled requests expire in 1 hour
2018-03-02 14:15:04 +01:00
2018-09-30 19:01:33 +02:00
vSporkAddresses = { " Xgtyuk76vhuFW2iT7UAiHgNdWXCf3J34wh " } ;
nMinSporkKeys = 1 ;
2018-10-26 18:42:52 +02:00
fBIP9CheckMasternodesUpgraded = true ;
2013-05-07 15:16:25 +02:00
2017-12-13 13:32:00 +01:00
checkpointData = {
2017-06-08 19:35:28 +02:00
{
{ 1500 , uint256S ( " 0x000000aaf0300f59f49bc3e970bad15c11f961fe2347accffff19d96ec9778e3 " ) } ,
{ 4991 , uint256S ( " 0x000000003b01809551952460744d5dbb8fcbd6cbae3c220267bf7fa43f837367 " ) } ,
{ 9918 , uint256S ( " 0x00000000213e229f332c0ffbe34defdaa9e74de87f2d8d1f01af8d121c3c170b " ) } ,
{ 16912 , uint256S ( " 0x00000000075c0d10371d55a60634da70f197548dbbfa4123e12abfcbc5738af9 " ) } ,
{ 23912 , uint256S ( " 0x0000000000335eac6703f3b1732ec8b2f89c3ba3a7889e5767b090556bb9a276 " ) } ,
{ 35457 , uint256S ( " 0x0000000000b0ae211be59b048df14820475ad0dd53b9ff83b010f71a77342d9f " ) } ,
{ 45479 , uint256S ( " 0x000000000063d411655d590590e16960f15ceea4257122ac430c6fbe39fbf02d " ) } ,
{ 55895 , uint256S ( " 0x0000000000ae4c53a43639a4ca027282f69da9c67ba951768a20415b6439a2d7 " ) } ,
{ 68899 , uint256S ( " 0x0000000000194ab4d3d9eeb1f2f792f21bb39ff767cb547fe977640f969d77b7 " ) } ,
{ 74619 , uint256S ( " 0x000000000011d28f38f05d01650a502cc3f4d0e793fbc26e2a2ca71f07dc3842 " ) } ,
{ 75095 , uint256S ( " 0x0000000000193d12f6ad352a9996ee58ef8bdc4946818a5fec5ce99c11b87f0d " ) } ,
{ 88805 , uint256S ( " 0x00000000001392f1652e9bf45cd8bc79dc60fe935277cd11538565b4a94fa85f " ) } ,
{ 107996 , uint256S ( " 0x00000000000a23840ac16115407488267aa3da2b9bc843e301185b7d17e4dc40 " ) } ,
{ 137993 , uint256S ( " 0x00000000000cf69ce152b1bffdeddc59188d7a80879210d6e5c9503011929c3c " ) } ,
{ 167996 , uint256S ( " 0x000000000009486020a80f7f2cc065342b0c2fb59af5e090cd813dba68ab0fed " ) } ,
{ 207992 , uint256S ( " 0x00000000000d85c22be098f74576ef00b7aa00c05777e966aff68a270f1e01a5 " ) } ,
{ 312645 , uint256S ( " 0x0000000000059dcb71ad35a9e40526c44e7aae6c99169a9e7017b7d84b1c2daf " ) } ,
{ 407452 , uint256S ( " 0x000000000003c6a87e73623b9d70af7cd908ae22fee466063e4ffc20be1d2dbc " ) } ,
{ 523412 , uint256S ( " 0x000000000000e54f036576a10597e0e42cc22a5159ce572f999c33975e121d4d " ) } ,
{ 523930 , uint256S ( " 0x0000000000000bccdb11c2b1cfb0ecab452abf267d89b7f46eaf2d54ce6e652c " ) } ,
{ 750000 , uint256S ( " 0x00000000000000b4181bbbdddbae464ce11fede5d0292fb63fdede1e7c8ab21c " ) } ,
{ 888900 , uint256S ( " 0x0000000000000026c29d576073ab51ebd1d3c938de02e9a44c7ee9e16f82db28 " ) } ,
{ 967800 , uint256S ( " 0x0000000000000024e26c7df7e46d673724d223cf4ca2b2adc21297cc095600f4 " ) } ,
{ 1067570 , uint256S ( " 0x000000000000001e09926bcf5fa4513d23e870a34f74e38200db99eb3f5b7a70 " ) } ,
2019-11-21 21:52:35 +01:00
{ 1167570 , uint256S ( " 0x000000000000000fb7b1e9b81700283dff0f7d87cf458e5edfdae00c669de661 " ) } ,
2020-11-04 14:40:50 +01:00
{ 1364585 , uint256S ( " 0x00000000000000022f355c52417fca9b73306958f7c0832b3a7bce006ca369ef " ) } ,
Bump chainparams for mainnet and testnet (#4087)
* Bump nMinimumChainWork and defaultAssumeValid for mainnet and testnet
* Bump DEPLOYMENT_V17 start and timeout
* Bump chaintxdata
mainnet:
{
"time": 1617874573,
"txcount": 34709765,
"window_final_block_hash": "000000000000000bd7dac80e97279c984a3266145c130ab76021f5bac6d80ff3",
"window_block_count": 17280,
"window_tx_count": 822851,
"window_interval": 2723924,
"txrate": 0.3020829509193355
}
testnet:
{
"time": 1617874832,
"txcount": 4926985,
"window_final_block_hash": "000000b0940bec06e3245dc787743b3a7f039068878aa1c7c6d5b44c443770bf",
"window_block_count": 17280,
"window_tx_count": 26190,
"window_interval": 2438451,
"txrate": 0.01074042496650538
}
2021-04-10 22:34:26 +02:00
{ 1450000 , uint256S ( " 0x00000000000000105cfae44a995332d8ec256850ea33a1f7b700474e3dad82bc " ) } ,
2017-06-08 19:35:28 +02:00
}
2017-01-12 12:12:56 +01:00
} ;
chainTxData = ChainTxData {
Bump chainparams for mainnet and testnet (#4087)
* Bump nMinimumChainWork and defaultAssumeValid for mainnet and testnet
* Bump DEPLOYMENT_V17 start and timeout
* Bump chaintxdata
mainnet:
{
"time": 1617874573,
"txcount": 34709765,
"window_final_block_hash": "000000000000000bd7dac80e97279c984a3266145c130ab76021f5bac6d80ff3",
"window_block_count": 17280,
"window_tx_count": 822851,
"window_interval": 2723924,
"txrate": 0.3020829509193355
}
testnet:
{
"time": 1617874832,
"txcount": 4926985,
"window_final_block_hash": "000000b0940bec06e3245dc787743b3a7f039068878aa1c7c6d5b44c443770bf",
"window_block_count": 17280,
"window_tx_count": 26190,
"window_interval": 2438451,
"txrate": 0.01074042496650538
}
2021-04-10 22:34:26 +02:00
1617874573 , // * UNIX timestamp of last known number of transactions (Block 1450962)
34709765 , // * total number of transactions between genesis and that timestamp
2018-05-03 12:38:00 +02:00
// (the tx=... number in the ChainStateFlushed debug.log lines)
2020-09-28 18:53:41 +02:00
0.3 // * estimated number of transactions per second after that timestamp
2015-04-24 00:30:55 +02:00
} ;
2013-05-07 15:16:25 +02:00
}
} ;
2014-10-25 11:24:16 +02:00
/**
* Testnet ( v3 )
*/
2015-07-03 14:30:18 +02:00
class CTestNetParams : public CChainParams {
2013-05-07 15:16:25 +02:00
public :
CTestNetParams ( ) {
2014-06-11 12:23:49 +02:00
strNetworkID = " test " ;
2016-02-15 14:09:43 +01:00
consensus . nSubsidyHalvingInterval = 210240 ;
2017-10-04 22:13:32 +02:00
consensus . nMasternodePaymentsStartBlock = 4010 ; // not true, but it's ok as long as it's less then nMasternodePaymentsIncreaseBlock
consensus . nMasternodePaymentsIncreaseBlock = 4030 ;
2017-10-01 23:02:01 +02:00
consensus . nMasternodePaymentsIncreasePeriod = 10 ;
2018-03-10 13:35:09 +01:00
consensus . nInstantSendConfirmationsRequired = 2 ;
2016-06-29 20:20:18 +02:00
consensus . nInstantSendKeepLock = 6 ;
2017-10-04 22:13:32 +02:00
consensus . nBudgetPaymentsStartBlock = 4100 ;
2016-02-17 17:29:36 +01:00
consensus . nBudgetPaymentsCycleBlocks = 50 ;
consensus . nBudgetPaymentsWindowBlocks = 10 ;
2017-10-04 22:13:32 +02:00
consensus . nSuperblockStartBlock = 4200 ; // NOTE: Should satisfy nSuperblockStartBlock > nBudgetPeymentsStartBlock
2018-12-13 20:30:19 +01:00
consensus . nSuperblockStartHash = uint256 ( ) ; // do not check this on testnet
2016-08-22 03:41:40 +02:00
consensus . nSuperblockCycle = 24 ; // Superblocks can be issued hourly on testnet
2016-08-28 21:15:48 +02:00
consensus . nGovernanceMinQuorum = 1 ;
2017-02-02 09:50:44 +01:00
consensus . nGovernanceFilterElements = 500 ;
2016-05-19 21:03:17 +02:00
consensus . nMasternodeMinimumConfirmations = 1 ;
2018-01-20 12:19:33 +01:00
consensus . BIP34Height = 76 ;
consensus . BIP34Hash = uint256S ( " 0x000008ebb1db2598e897d17275285767717c6acfeac4c73def49fbea1ddcbcb6 " ) ;
consensus . BIP65Height = 2431 ; // 0000039cf01242c7f921dcb4806a5994bc003b48c1973ae0c89b67809c2bb2ab
consensus . BIP66Height = 2075 ; // 0000002acdd29a14583540cb72e1c5cc83783560e38fa7081495d474fe1671f7
2018-03-08 13:18:24 +01:00
consensus . DIP0001Height = 5500 ;
2019-04-25 17:39:04 +02:00
consensus . DIP0003Height = 7000 ;
2019-01-29 15:54:38 +01:00
consensus . DIP0003EnforcementHeight = 7300 ;
consensus . DIP0003EnforcementHash = uint256S ( " 00000055ebc0e974ba3a3fb785c5ad4365a39637d4df168169ee80d313612f8f " ) ;
2020-12-28 12:21:01 +01:00
consensus . DIP0008Height = 78800 ; // 000000000e9329d964d80e7dab2e704b43b6bd2b91fea1e9315d38932e55fb55
2022-03-14 22:40:01 +01:00
consensus . BRRHeight = 387500 ; // 0000001537dbfd09dea69f61c1f8b2afa27c8dc91c934e144797761c9f10367b
2021-12-12 15:48:21 +01:00
consensus . MinBIP9WarningHeight = 80816 ; // dip8 activation height + miner confirmation window
2018-03-19 14:08:32 +01:00
consensus . powLimit = uint256S ( " 00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff " ) ; // ~uint256(0) >> 20
2016-02-02 16:28:56 +01:00
consensus . nPowTargetTimespan = 24 * 60 * 60 ; // Dash: 1 day
consensus . nPowTargetSpacing = 2.5 * 60 ; // Dash: 2.5 minutes
2015-02-11 11:58:11 +01:00
consensus . fPowAllowMinDifficultyBlocks = true ;
2015-10-19 14:25:29 +02:00
consensus . fPowNoRetargeting = false ;
2018-12-13 13:57:08 +01:00
consensus . nPowKGWHeight = 4002 ; // nPowKGWHeight >= nPowDGWHeight means "no KGW"
2020-08-30 16:22:21 +02:00
consensus . nPowDGWHeight = 4002 ; // TODO: make sure to drop all spork6 related code on next testnet reset
2016-02-15 05:13:27 +01:00
consensus . nRuleChangeActivationThreshold = 1512 ; // 75% for testchains
consensus . nMinerConfirmationWindow = 2016 ; // nPowTargetTimespan / nPowTargetSpacing
2016-03-09 22:00:53 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_TESTDUMMY ] . bit = 28 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_TESTDUMMY ] . nStartTime = 1199145601 ; // January 1, 2008
consensus . vDeployments [ Consensus : : DEPLOYMENT_TESTDUMMY ] . nTimeout = 1230767999 ; // December 31, 2008
2016-02-20 23:37:13 +01:00
// Deployment of BIP68, BIP112, and BIP113.
consensus . vDeployments [ Consensus : : DEPLOYMENT_CSV ] . bit = 0 ;
2018-12-13 14:03:02 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_CSV ] . nStartTime = 1544655600 ; // Dec 13th, 2018
2020-12-31 15:43:43 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_CSV ] . nTimeout = 999999999999ULL ;
2016-03-08 07:33:23 +01:00
2017-09-11 16:13:30 +02:00
// Deployment of DIP0001
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0001 ] . bit = 1 ;
2018-12-13 14:03:02 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0001 ] . nStartTime = 1544655600 ; // Dec 13th, 2018
2020-12-31 15:43:43 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0001 ] . nTimeout = 999999999999ULL ;
2017-09-11 16:13:30 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0001 ] . nWindowSize = 100 ;
2020-09-12 16:33:12 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0001 ] . nThresholdStart = 50 ; // 50% of 100
2017-09-11 16:13:30 +02:00
2018-01-30 20:18:51 +01:00
// Deployment of BIP147
consensus . vDeployments [ Consensus : : DEPLOYMENT_BIP147 ] . bit = 2 ;
2018-12-13 14:03:02 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_BIP147 ] . nStartTime = 1544655600 ; // Dec 13th, 2018
2020-12-31 15:43:43 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_BIP147 ] . nTimeout = 999999999999ULL ;
2018-01-30 20:18:51 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_BIP147 ] . nWindowSize = 100 ;
2020-09-12 16:33:12 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_BIP147 ] . nThresholdStart = 50 ; // 50% of 100
2018-01-30 20:18:51 +01:00
2018-10-26 18:42:52 +02:00
// Deployment of DIP0003
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0003 ] . bit = 3 ;
2018-12-13 14:03:30 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0003 ] . nStartTime = 1544655600 ; // Dec 13th, 2018
2020-12-31 15:43:43 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0003 ] . nTimeout = 999999999999ULL ;
2018-10-26 18:42:52 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0003 ] . nWindowSize = 100 ;
2020-09-12 16:33:12 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0003 ] . nThresholdStart = 50 ; // 50% of 100
2018-09-26 16:17:47 +02:00
2019-03-22 11:51:50 +01:00
// Deployment of DIP0008
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0008 ] . bit = 4 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0008 ] . nStartTime = 1553126400 ; // Mar 21st, 2019
2020-12-31 15:43:43 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0008 ] . nTimeout = 999999999999ULL ;
2019-03-22 11:51:50 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0008 ] . nWindowSize = 100 ;
2020-09-12 16:33:12 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0008 ] . nThresholdStart = 50 ; // 50% of 100
2019-03-22 11:51:50 +01:00
2020-09-10 18:23:11 +02:00
// Deployment of Block Reward Reallocation
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . bit = 5 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nStartTime = 1598918400 ; // Sep 1st, 2020
2020-12-31 15:43:43 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nTimeout = 999999999999ULL ;
2020-09-10 18:23:11 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nWindowSize = 100 ;
2020-09-12 16:33:12 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nThresholdStart = 80 ; // 80% of 100
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nThresholdMin = 60 ; // 60% of 100
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nFalloffCoeff = 5 ; // this corresponds to 10 periods
2020-09-10 18:23:11 +02:00
2021-05-07 18:36:30 +02:00
// Deployment of DIP0020, DIP0021 and LLMQ_100_67 quorums
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . bit = 6 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nStartTime = 1606780800 ; // December 1st, 2020
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nTimeout = 1638316800 ; // December 1st, 2021
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nWindowSize = 100 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nThresholdStart = 80 ; // 80% of 100
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nThresholdMin = 60 ; // 60% of 100
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nFalloffCoeff = 5 ; // this corresponds to 10 periods
2020-11-17 20:28:14 +01:00
2022-04-16 16:46:04 +02:00
// Deployment of Quorum Rotation DIP and decreased proposal fee
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . bit = 7 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nStartTime = 1649980800 ; // Friday, April 15, 2022 0:00:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nTimeout = 999999999999ULL ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nWindowSize = 4032 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nThresholdStart = 3226 ; // 80% of 4032
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nThresholdMin = 2420 ; // 60% of 4032
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nFalloffCoeff = 5 ; // this corresponds to 10 periods
2021-11-01 16:31:48 +01:00
2017-08-23 16:21:08 +02:00
// The best chain should have at least this much work.
Bump chainparams for mainnet and testnet (#4087)
* Bump nMinimumChainWork and defaultAssumeValid for mainnet and testnet
* Bump DEPLOYMENT_V17 start and timeout
* Bump chaintxdata
mainnet:
{
"time": 1617874573,
"txcount": 34709765,
"window_final_block_hash": "000000000000000bd7dac80e97279c984a3266145c130ab76021f5bac6d80ff3",
"window_block_count": 17280,
"window_tx_count": 822851,
"window_interval": 2723924,
"txrate": 0.3020829509193355
}
testnet:
{
"time": 1617874832,
"txcount": 4926985,
"window_final_block_hash": "000000b0940bec06e3245dc787743b3a7f039068878aa1c7c6d5b44c443770bf",
"window_block_count": 17280,
"window_tx_count": 26190,
"window_interval": 2438451,
"txrate": 0.01074042496650538
}
2021-04-10 22:34:26 +02:00
consensus . nMinimumChainWork = uint256S ( " 0x000000000000000000000000000000000000000000000000022f14ac5d56b5ef " ) ; // 470000
2017-08-23 16:21:08 +02:00
// By default assume that the signatures in ancestors of this block are valid.
Bump chainparams for mainnet and testnet (#4087)
* Bump nMinimumChainWork and defaultAssumeValid for mainnet and testnet
* Bump DEPLOYMENT_V17 start and timeout
* Bump chaintxdata
mainnet:
{
"time": 1617874573,
"txcount": 34709765,
"window_final_block_hash": "000000000000000bd7dac80e97279c984a3266145c130ab76021f5bac6d80ff3",
"window_block_count": 17280,
"window_tx_count": 822851,
"window_interval": 2723924,
"txrate": 0.3020829509193355
}
testnet:
{
"time": 1617874832,
"txcount": 4926985,
"window_final_block_hash": "000000b0940bec06e3245dc787743b3a7f039068878aa1c7c6d5b44c443770bf",
"window_block_count": 17280,
"window_tx_count": 26190,
"window_interval": 2438451,
"txrate": 0.01074042496650538
}
2021-04-10 22:34:26 +02:00
consensus . defaultAssumeValid = uint256S ( " 0x0000009303aeadf8cf3812f5c869691dbd4cb118ad20e9bf553be434bafe6a52 " ) ; // 470000
2017-08-23 16:21:08 +02:00
2016-02-02 16:28:56 +01:00
pchMessageStart [ 0 ] = 0xce ;
pchMessageStart [ 1 ] = 0xe2 ;
pchMessageStart [ 2 ] = 0xca ;
pchMessageStart [ 3 ] = 0xff ;
nDefaultPort = 19999 ;
Add block pruning functionality
This adds a -prune=N option to bitcoind, which if set to N>0 will enable block
file pruning. When pruning is enabled, block and undo files will be deleted to
try to keep total space used by those files to below the prune target (N, in
MB) specified by the user, subject to some constraints:
- The last 288 blocks on the main chain are always kept (MIN_BLOCKS_TO_KEEP),
- N must be at least 550MB (chosen as a value for the target that could
reasonably be met, with some assumptions about block sizes, orphan rates,
etc; see comment in main.h),
- No blocks are pruned until chainActive is at least 100,000 blocks long (on
mainnet; defined separately for mainnet, testnet, and regtest in chainparams
as nPruneAfterHeight).
This unsets NODE_NETWORK if pruning is enabled.
Also included is an RPC test for pruning (pruning.py).
Thanks to @rdponticelli for earlier work on this feature; this is based in
part off that work.
2015-02-23 20:27:44 +01:00
nPruneAfterHeight = 1000 ;
2019-01-12 01:33:11 +01:00
m_assumed_blockchain_size = 3 ;
m_assumed_chain_state_size = 1 ;
2014-11-28 10:56:02 +01:00
2016-12-14 14:33:46 +01:00
genesis = CreateGenesisBlock ( 1390666206UL , 3861367235UL , 0x1e0ffff0 , 1 , 50 * COIN ) ;
2015-02-11 11:58:11 +01:00
consensus . hashGenesisBlock = genesis . GetHash ( ) ;
2016-02-02 16:28:56 +01:00
assert ( consensus . hashGenesisBlock = = uint256S ( " 0x00000bafbc94add76cb75e2ec92894837288a481e5c005f6563d91623bf8bc2c " ) ) ;
assert ( genesis . hashMerkleRoot = = uint256S ( " 0xe0028eb9648db56b1ac77cf090b99048a8007e2bb64b68f092c03c7f56a662c7 " ) ) ;
2013-05-07 15:16:25 +02:00
vFixedSeeds . clear ( ) ;
2018-09-28 09:55:11 +02:00
vFixedSeeds = std : : vector < SeedSpec6 > ( pnSeed6_test , pnSeed6_test + ARRAYLEN ( pnSeed6_test ) ) ;
2013-05-07 15:16:25 +02:00
vSeeds . clear ( ) ;
2016-06-08 17:33:21 +02:00
// nodes with support for servicebits filtering should be at the top
2018-01-24 13:01:14 +01:00
vSeeds . emplace_back ( " testnet-seed.dashdot.io " ) ; // Just a static list of stable node(s), only supports x9
2013-05-07 15:16:25 +02:00
2016-08-02 00:00:24 +02:00
// Testnet Dash addresses start with 'y'
2016-05-09 20:28:29 +02:00
base58Prefixes [ PUBKEY_ADDRESS ] = std : : vector < unsigned char > ( 1 , 140 ) ;
2016-08-02 00:00:24 +02:00
// Testnet Dash script addresses start with '8' or '9'
2016-02-02 16:28:56 +01:00
base58Prefixes [ SCRIPT_ADDRESS ] = std : : vector < unsigned char > ( 1 , 19 ) ;
// Testnet private keys start with '9' or 'c' (Bitcoin defaults)
2014-11-24 23:25:58 +01:00
base58Prefixes [ SECRET_KEY ] = std : : vector < unsigned char > ( 1 , 239 ) ;
2016-08-02 00:00:24 +02:00
// Testnet Dash BIP32 pubkeys start with 'tpub' (Bitcoin defaults)
2017-06-08 19:35:28 +02:00
base58Prefixes [ EXT_PUBLIC_KEY ] = { 0x04 , 0x35 , 0x87 , 0xCF } ;
2016-08-02 00:00:24 +02:00
// Testnet Dash BIP32 prvkeys start with 'tprv' (Bitcoin defaults)
2017-06-08 19:35:28 +02:00
base58Prefixes [ EXT_SECRET_KEY ] = { 0x04 , 0x35 , 0x83 , 0x94 } ;
2017-05-29 13:51:40 +02:00
2016-08-02 00:00:24 +02:00
// Testnet Dash BIP44 coin type is '1' (All coin's testnet default)
2017-05-29 13:51:40 +02:00
nExtCoinType = 1 ;
2016-09-12 19:40:46 +02:00
2018-11-23 15:42:09 +01:00
// long living quorum params
2021-10-15 12:28:19 +02:00
AddLLMQ ( Consensus : : LLMQType : : LLMQ_50_60 ) ;
2022-04-16 16:46:04 +02:00
AddLLMQ ( Consensus : : LLMQType : : LLMQ_60_75 ) ;
2021-10-15 12:28:19 +02:00
AddLLMQ ( Consensus : : LLMQType : : LLMQ_400_60 ) ;
AddLLMQ ( Consensus : : LLMQType : : LLMQ_400_85 ) ;
AddLLMQ ( Consensus : : LLMQType : : LLMQ_100_67 ) ;
consensus . llmqTypeChainLocks = Consensus : : LLMQType : : LLMQ_50_60 ;
consensus . llmqTypeInstantSend = Consensus : : LLMQType : : LLMQ_50_60 ;
2022-04-16 16:46:04 +02:00
consensus . llmqTypeDIP0024InstantSend = Consensus : : LLMQType : : LLMQ_60_75 ;
2021-10-15 12:28:19 +02:00
consensus . llmqTypePlatform = Consensus : : LLMQType : : LLMQ_100_67 ;
2021-12-11 21:00:27 +01:00
consensus . llmqTypeMnhf = Consensus : : LLMQType : : LLMQ_50_60 ;
2018-11-23 15:42:09 +01:00
2015-03-13 17:25:34 +01:00
fDefaultConsistencyChecks = false ;
2014-06-04 12:51:29 +02:00
fRequireStandard = false ;
2018-07-12 11:04:42 +02:00
fRequireRoutableExternalIP = true ;
2019-07-16 22:07:14 +02:00
m_is_test_chain = true ;
2017-12-20 12:45:01 +01:00
fAllowMultipleAddressesFromGroup = false ;
2019-03-30 15:55:34 +01:00
fAllowMultiplePorts = true ;
2020-03-21 12:21:09 +01:00
nLLMQConnectionRetryTimeout = 60 ;
2022-01-09 18:03:26 +01:00
m_is_mockable_chain = false ;
2015-04-03 00:51:08 +02:00
2020-12-09 21:00:08 +01:00
nPoolMinParticipants = 2 ;
nPoolMaxParticipants = 20 ;
2016-09-27 09:50:04 +02:00
nFulfilledRequestExpireTime = 5 * 60 ; // fulfilled requests expire in 5 minutes
2018-03-02 14:15:04 +01:00
2018-09-30 19:01:33 +02:00
vSporkAddresses = { " yjPtiKh2uwk3bDutTEA2q9mCtXyiZRWn55 " } ;
nMinSporkKeys = 1 ;
2018-10-26 18:42:52 +02:00
fBIP9CheckMasternodesUpgraded = true ;
2016-09-27 09:50:04 +02:00
2017-12-13 13:32:00 +01:00
checkpointData = {
2019-07-05 07:30:29 +02:00
{
{ 261 , uint256S ( " 0x00000c26026d0815a7e2ce4fa270775f61403c040647ff2c3091f99e894a4618 " ) } ,
{ 1999 , uint256S ( " 0x00000052e538d27fa53693efe6fb6892a0c1d26c0235f599171c48a3cce553b1 " ) } ,
{ 2999 , uint256S ( " 0x0000024bc3f4f4cb30d29827c13d921ad77d2c6072e586c7f60d83c2722cdcc5 " ) } ,
{ 96090 , uint256S ( " 0x00000000033df4b94d17ab43e999caaf6c4735095cc77703685da81254d09bba " ) } ,
2019-11-21 21:52:35 +01:00
{ 200000 , uint256S ( " 0x000000001015eb5ef86a8fe2b3074d947bc972c5befe32b28dd5ce915dc0d029 " ) } ,
2020-11-04 14:40:50 +01:00
{ 395750 , uint256S ( " 0x000008b78b6aef3fd05ab78db8b76c02163e885305545144420cb08704dce538 " ) } ,
Bump chainparams for mainnet and testnet (#4087)
* Bump nMinimumChainWork and defaultAssumeValid for mainnet and testnet
* Bump DEPLOYMENT_V17 start and timeout
* Bump chaintxdata
mainnet:
{
"time": 1617874573,
"txcount": 34709765,
"window_final_block_hash": "000000000000000bd7dac80e97279c984a3266145c130ab76021f5bac6d80ff3",
"window_block_count": 17280,
"window_tx_count": 822851,
"window_interval": 2723924,
"txrate": 0.3020829509193355
}
testnet:
{
"time": 1617874832,
"txcount": 4926985,
"window_final_block_hash": "000000b0940bec06e3245dc787743b3a7f039068878aa1c7c6d5b44c443770bf",
"window_block_count": 17280,
"window_tx_count": 26190,
"window_interval": 2438451,
"txrate": 0.01074042496650538
}
2021-04-10 22:34:26 +02:00
{ 470000 , uint256S ( " 0x0000009303aeadf8cf3812f5c869691dbd4cb118ad20e9bf553be434bafe6a52 " ) } ,
2019-07-05 07:30:29 +02:00
}
2017-01-12 12:12:56 +01:00
} ;
2017-10-01 23:02:01 +02:00
2018-11-10 10:54:01 +01:00
chainTxData = ChainTxData {
Bump chainparams for mainnet and testnet (#4087)
* Bump nMinimumChainWork and defaultAssumeValid for mainnet and testnet
* Bump DEPLOYMENT_V17 start and timeout
* Bump chaintxdata
mainnet:
{
"time": 1617874573,
"txcount": 34709765,
"window_final_block_hash": "000000000000000bd7dac80e97279c984a3266145c130ab76021f5bac6d80ff3",
"window_block_count": 17280,
"window_tx_count": 822851,
"window_interval": 2723924,
"txrate": 0.3020829509193355
}
testnet:
{
"time": 1617874832,
"txcount": 4926985,
"window_final_block_hash": "000000b0940bec06e3245dc787743b3a7f039068878aa1c7c6d5b44c443770bf",
"window_block_count": 17280,
"window_tx_count": 26190,
"window_interval": 2438451,
"txrate": 0.01074042496650538
}
2021-04-10 22:34:26 +02:00
1617874832 , // * UNIX timestamp of last known number of transactions (Block 477483)
4926985 , // * total number of transactions between genesis and that timestamp
2018-05-03 12:38:00 +02:00
// (the tx=... number in the ChainStateFlushed debug.log lines)
Bump chainparams for mainnet and testnet (#4087)
* Bump nMinimumChainWork and defaultAssumeValid for mainnet and testnet
* Bump DEPLOYMENT_V17 start and timeout
* Bump chaintxdata
mainnet:
{
"time": 1617874573,
"txcount": 34709765,
"window_final_block_hash": "000000000000000bd7dac80e97279c984a3266145c130ab76021f5bac6d80ff3",
"window_block_count": 17280,
"window_tx_count": 822851,
"window_interval": 2723924,
"txrate": 0.3020829509193355
}
testnet:
{
"time": 1617874832,
"txcount": 4926985,
"window_final_block_hash": "000000b0940bec06e3245dc787743b3a7f039068878aa1c7c6d5b44c443770bf",
"window_block_count": 17280,
"window_tx_count": 26190,
"window_interval": 2438451,
"txrate": 0.01074042496650538
}
2021-04-10 22:34:26 +02:00
0.01 // * estimated number of transactions per second after that timestamp
2015-04-24 00:30:55 +02:00
} ;
2013-05-07 15:16:25 +02:00
}
} ;
2017-12-20 12:45:01 +01:00
/**
* Devnet
*/
class CDevNetParams : public CChainParams {
public :
2021-09-03 00:36:11 +02:00
explicit CDevNetParams ( const ArgsManager & args ) {
2020-06-24 10:03:53 +02:00
strNetworkID = " devnet " ;
2017-12-20 12:45:01 +01:00
consensus . nSubsidyHalvingInterval = 210240 ;
consensus . nMasternodePaymentsStartBlock = 4010 ; // not true, but it's ok as long as it's less then nMasternodePaymentsIncreaseBlock
consensus . nMasternodePaymentsIncreaseBlock = 4030 ;
consensus . nMasternodePaymentsIncreasePeriod = 10 ;
2018-03-10 13:35:09 +01:00
consensus . nInstantSendConfirmationsRequired = 2 ;
2017-12-20 12:45:01 +01:00
consensus . nInstantSendKeepLock = 6 ;
consensus . nBudgetPaymentsStartBlock = 4100 ;
consensus . nBudgetPaymentsCycleBlocks = 50 ;
consensus . nBudgetPaymentsWindowBlocks = 10 ;
consensus . nSuperblockStartBlock = 4200 ; // NOTE: Should satisfy nSuperblockStartBlock > nBudgetPeymentsStartBlock
2018-02-01 13:42:21 +01:00
consensus . nSuperblockStartHash = uint256 ( ) ; // do not check this on devnet
2017-12-20 12:45:01 +01:00
consensus . nSuperblockCycle = 24 ; // Superblocks can be issued hourly on devnet
consensus . nGovernanceMinQuorum = 1 ;
consensus . nGovernanceFilterElements = 500 ;
consensus . nMasternodeMinimumConfirmations = 1 ;
2018-05-13 22:56:51 +02:00
consensus . BIP34Height = 1 ; // BIP34 activated immediately on devnet
consensus . BIP65Height = 1 ; // BIP65 activated immediately on devnet
consensus . BIP66Height = 1 ; // BIP66 activated immediately on devnet
2018-03-08 13:18:24 +01:00
consensus . DIP0001Height = 2 ; // DIP0001 activated immediately on devnet
2019-04-25 17:39:04 +02:00
consensus . DIP0003Height = 2 ; // DIP0003 activated immediately on devnet
2019-01-29 15:54:38 +01:00
consensus . DIP0003EnforcementHeight = 2 ; // DIP0003 activated immediately on devnet
consensus . DIP0003EnforcementHash = uint256 ( ) ;
2020-12-28 12:21:01 +01:00
consensus . DIP0008Height = 2 ; // DIP0008 activated immediately on devnet
2022-03-14 22:40:01 +01:00
consensus . BRRHeight = 300 ;
2021-12-12 15:48:21 +01:00
consensus . MinBIP9WarningHeight = 2018 ; // dip8 activation height + miner confirmation window
2018-03-19 14:08:32 +01:00
consensus . powLimit = uint256S ( " 7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff " ) ; // ~uint256(0) >> 1
2017-12-20 12:45:01 +01:00
consensus . nPowTargetTimespan = 24 * 60 * 60 ; // Dash: 1 day
consensus . nPowTargetSpacing = 2.5 * 60 ; // Dash: 2.5 minutes
consensus . fPowAllowMinDifficultyBlocks = true ;
consensus . fPowNoRetargeting = false ;
2022-02-28 17:43:00 +01:00
consensus . nPowKGWHeight = 4001 ; // nPowKGWHeight >= nPowDGWHeight means "no KGW"
consensus . nPowDGWHeight = 4001 ;
2017-12-20 12:45:01 +01:00
consensus . nRuleChangeActivationThreshold = 1512 ; // 75% for testchains
consensus . nMinerConfirmationWindow = 2016 ; // nPowTargetTimespan / nPowTargetSpacing
consensus . vDeployments [ Consensus : : DEPLOYMENT_TESTDUMMY ] . bit = 28 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_TESTDUMMY ] . nStartTime = 1199145601 ; // January 1, 2008
consensus . vDeployments [ Consensus : : DEPLOYMENT_TESTDUMMY ] . nTimeout = 1230767999 ; // December 31, 2008
// Deployment of BIP68, BIP112, and BIP113.
consensus . vDeployments [ Consensus : : DEPLOYMENT_CSV ] . bit = 0 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_CSV ] . nStartTime = 1506556800 ; // September 28th, 2017
2020-12-31 15:43:43 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_CSV ] . nTimeout = 999999999999ULL ;
2017-12-20 12:45:01 +01:00
// Deployment of DIP0001
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0001 ] . bit = 1 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0001 ] . nStartTime = 1505692800 ; // Sep 18th, 2017
2020-12-31 15:43:43 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0001 ] . nTimeout = 999999999999ULL ;
2017-12-20 12:45:01 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0001 ] . nWindowSize = 100 ;
2020-09-12 16:33:12 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0001 ] . nThresholdStart = 50 ; // 50% of 100
2017-12-20 12:45:01 +01:00
2018-01-30 20:18:51 +01:00
// Deployment of BIP147
consensus . vDeployments [ Consensus : : DEPLOYMENT_BIP147 ] . bit = 2 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_BIP147 ] . nStartTime = 1517792400 ; // Feb 5th, 2018
2020-12-31 15:43:43 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_BIP147 ] . nTimeout = 999999999999ULL ;
2018-01-30 20:18:51 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_BIP147 ] . nWindowSize = 100 ;
2020-09-12 16:33:12 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_BIP147 ] . nThresholdStart = 50 ; // 50% of 100
2018-01-30 20:18:51 +01:00
2018-02-14 21:31:42 +01:00
// Deployment of DIP0003
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0003 ] . bit = 3 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0003 ] . nStartTime = 1535752800 ; // Sep 1st, 2018
2020-12-31 15:43:43 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0003 ] . nTimeout = 999999999999ULL ;
2018-02-14 21:31:42 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0003 ] . nWindowSize = 100 ;
2020-09-12 16:33:12 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0003 ] . nThresholdStart = 50 ; // 50% of 100
2018-02-14 21:31:42 +01:00
2019-03-22 11:51:50 +01:00
// Deployment of DIP0008
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0008 ] . bit = 4 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0008 ] . nStartTime = 1553126400 ; // Mar 21st, 2019
2020-12-31 15:43:43 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0008 ] . nTimeout = 999999999999ULL ;
2019-03-22 11:51:50 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0008 ] . nWindowSize = 100 ;
2020-09-12 16:33:12 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0008 ] . nThresholdStart = 50 ; // 50% of 100
2019-03-22 11:51:50 +01:00
2020-09-10 18:23:11 +02:00
// Deployment of Block Reward Reallocation
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . bit = 5 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nStartTime = 1598918400 ; // Sep 1st, 2020
2020-12-31 15:43:43 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nTimeout = 999999999999ULL ;
2020-09-10 18:23:11 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nWindowSize = 100 ;
2020-09-12 16:33:12 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nThresholdStart = 80 ; // 80% of 100
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nThresholdMin = 60 ; // 60% of 100
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nFalloffCoeff = 5 ; // this corresponds to 10 periods
2020-09-10 18:23:11 +02:00
2021-05-07 18:36:30 +02:00
// Deployment of DIP0020, DIP0021 and LLMQ_100_67 quorums
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . bit = 6 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nStartTime = 1604188800 ; // November 1st, 2020
2021-07-29 11:59:21 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nTimeout = 999999999999ULL ;
2021-05-07 18:36:30 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nWindowSize = 100 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nThresholdStart = 80 ; // 80% of 100
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nThresholdMin = 60 ; // 60% of 100
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nFalloffCoeff = 5 ; // this corresponds to 10 periods
2020-11-17 20:28:14 +01:00
2022-04-16 16:46:04 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . bit = 7 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nStartTime = 1625097600 ; // July 1st, 2021
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nTimeout = 999999999999ULL ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nWindowSize = 100 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nThresholdStart = 80 ; // 80% of 100
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nThresholdMin = 60 ; // 60% of 100
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nFalloffCoeff = 5 ; // this corresponds to 10 periods
2021-11-01 16:31:48 +01:00
2017-12-20 12:45:01 +01:00
// The best chain should have at least this much work.
consensus . nMinimumChainWork = uint256S ( " 0x000000000000000000000000000000000000000000000000000000000000000 " ) ;
// By default assume that the signatures in ancestors of this block are valid.
consensus . defaultAssumeValid = uint256S ( " 0x000000000000000000000000000000000000000000000000000000000000000 " ) ;
2018-04-20 12:52:31 +02:00
pchMessageStart [ 0 ] = 0xe2 ;
pchMessageStart [ 1 ] = 0xca ;
pchMessageStart [ 2 ] = 0xff ;
pchMessageStart [ 3 ] = 0xce ;
2019-08-28 09:52:00 +02:00
nDefaultPort = 19799 ;
2017-12-20 12:45:01 +01:00
nPruneAfterHeight = 1000 ;
2019-01-12 01:33:11 +01:00
m_assumed_blockchain_size = 0 ;
m_assumed_chain_state_size = 0 ;
2017-12-20 12:45:01 +01:00
2021-09-03 00:36:11 +02:00
UpdateDevnetSubsidyAndDiffParametersFromArgs ( args ) ;
2017-12-20 12:45:01 +01:00
genesis = CreateGenesisBlock ( 1417713337 , 1096447 , 0x207fffff , 1 , 50 * COIN ) ;
consensus . hashGenesisBlock = genesis . GetHash ( ) ;
assert ( consensus . hashGenesisBlock = = uint256S ( " 0x000008ca1832a4baf228eb1553c03d3a2c8e02399550dd6ea8d65cec3ef23d2e " ) ) ;
assert ( genesis . hashMerkleRoot = = uint256S ( " 0xe0028eb9648db56b1ac77cf090b99048a8007e2bb64b68f092c03c7f56a662c7 " ) ) ;
2022-02-28 17:43:00 +01:00
devnetGenesis = FindDevNetGenesisBlock ( genesis , 50 * COIN ) ;
2021-09-03 00:36:11 +02:00
consensus . hashDevnetGenesisBlock = devnetGenesis . GetHash ( ) ;
2017-12-20 12:45:01 +01:00
vFixedSeeds . clear ( ) ;
vSeeds . clear ( ) ;
//vSeeds.push_back(CDNSSeedData("dashevo.org", "devnet-seed.dashevo.org"));
// Testnet Dash addresses start with 'y'
base58Prefixes [ PUBKEY_ADDRESS ] = std : : vector < unsigned char > ( 1 , 140 ) ;
// Testnet Dash script addresses start with '8' or '9'
base58Prefixes [ SCRIPT_ADDRESS ] = std : : vector < unsigned char > ( 1 , 19 ) ;
// Testnet private keys start with '9' or 'c' (Bitcoin defaults)
base58Prefixes [ SECRET_KEY ] = std : : vector < unsigned char > ( 1 , 239 ) ;
// Testnet Dash BIP32 pubkeys start with 'tpub' (Bitcoin defaults)
2019-07-05 07:30:29 +02:00
base58Prefixes [ EXT_PUBLIC_KEY ] = { 0x04 , 0x35 , 0x87 , 0xCF } ;
2017-12-20 12:45:01 +01:00
// Testnet Dash BIP32 prvkeys start with 'tprv' (Bitcoin defaults)
2019-07-05 07:30:29 +02:00
base58Prefixes [ EXT_SECRET_KEY ] = { 0x04 , 0x35 , 0x83 , 0x94 } ;
2017-12-20 12:45:01 +01:00
// Testnet Dash BIP44 coin type is '1' (All coin's testnet default)
nExtCoinType = 1 ;
2018-11-23 15:42:09 +01:00
// long living quorum params
2021-10-15 12:28:19 +02:00
AddLLMQ ( Consensus : : LLMQType : : LLMQ_50_60 ) ;
2022-04-16 16:46:04 +02:00
AddLLMQ ( Consensus : : LLMQType : : LLMQ_60_75 ) ;
2021-10-15 12:28:19 +02:00
AddLLMQ ( Consensus : : LLMQType : : LLMQ_400_60 ) ;
AddLLMQ ( Consensus : : LLMQType : : LLMQ_400_85 ) ;
AddLLMQ ( Consensus : : LLMQType : : LLMQ_100_67 ) ;
2022-01-10 19:36:18 +01:00
AddLLMQ ( Consensus : : LLMQType : : LLMQ_DEVNET ) ;
2021-10-15 12:28:19 +02:00
consensus . llmqTypeChainLocks = Consensus : : LLMQType : : LLMQ_50_60 ;
consensus . llmqTypeInstantSend = Consensus : : LLMQType : : LLMQ_50_60 ;
2022-04-16 16:46:04 +02:00
consensus . llmqTypeDIP0024InstantSend = Consensus : : LLMQType : : LLMQ_60_75 ;
2021-10-15 12:28:19 +02:00
consensus . llmqTypePlatform = Consensus : : LLMQType : : LLMQ_100_67 ;
2021-12-11 21:00:27 +01:00
consensus . llmqTypeMnhf = Consensus : : LLMQType : : LLMQ_50_60 ;
2018-11-23 15:42:09 +01:00
2021-09-03 00:36:11 +02:00
UpdateDevnetLLMQChainLocksFromArgs ( args ) ;
UpdateDevnetLLMQInstantSendFromArgs ( args ) ;
2022-04-16 16:46:04 +02:00
UpdateDevnetLLMQInstantSendDIP0024FromArgs ( args ) ;
2021-09-03 00:36:11 +02:00
UpdateLLMQDevnetParametersFromArgs ( args ) ;
2022-04-05 23:50:13 +02:00
UpdateDevnetPowTargetSpacingFromArgs ( args ) ;
2021-09-03 00:36:11 +02:00
2017-12-20 12:45:01 +01:00
fDefaultConsistencyChecks = false ;
fRequireStandard = false ;
2020-03-31 07:16:35 +02:00
fRequireRoutableExternalIP = true ;
2019-07-16 22:07:14 +02:00
m_is_test_chain = true ;
2017-12-20 12:45:01 +01:00
fAllowMultipleAddressesFromGroup = true ;
2018-07-07 23:19:33 +02:00
fAllowMultiplePorts = true ;
2020-03-21 12:21:09 +01:00
nLLMQConnectionRetryTimeout = 60 ;
2022-01-09 18:03:26 +01:00
m_is_mockable_chain = false ;
2017-12-20 12:45:01 +01:00
2020-12-09 21:00:08 +01:00
nPoolMinParticipants = 2 ;
nPoolMaxParticipants = 20 ;
2017-12-20 12:45:01 +01:00
nFulfilledRequestExpireTime = 5 * 60 ; // fulfilled requests expire in 5 minutes
2018-03-02 14:15:04 +01:00
2018-09-30 19:01:33 +02:00
vSporkAddresses = { " yjPtiKh2uwk3bDutTEA2q9mCtXyiZRWn55 " } ;
nMinSporkKeys = 1 ;
2018-10-26 18:42:52 +02:00
// devnets are started with no blocks and no MN, so we can't check for upgraded MN (as there are none)
fBIP9CheckMasternodesUpgraded = false ;
2017-12-20 12:45:01 +01:00
checkpointData = ( CCheckpointData ) {
2017-06-08 19:35:28 +02:00
{
{ 0 , uint256S ( " 0x000008ca1832a4baf228eb1553c03d3a2c8e02399550dd6ea8d65cec3ef23d2e " ) } ,
{ 1 , devnetGenesis . GetHash ( ) } ,
}
2017-12-20 12:45:01 +01:00
} ;
2018-01-19 10:20:55 +01:00
chainTxData = ChainTxData {
2018-01-22 08:05:44 +01:00
devnetGenesis . GetBlockTime ( ) , // * UNIX timestamp of devnet genesis block
2 , // * we only have 2 coinbase transactions when a devnet is started up
0.01 // * estimated number of transactions per second
2018-01-19 10:20:55 +01:00
} ;
2017-12-20 12:45:01 +01:00
}
2021-09-03 00:36:11 +02:00
/**
* Allows modifying the subsidy and difficulty devnet parameters .
*/
void UpdateDevnetSubsidyAndDiffParameters ( int nMinimumDifficultyBlocks , int nHighSubsidyBlocks , int nHighSubsidyFactor )
{
consensus . nMinimumDifficultyBlocks = nMinimumDifficultyBlocks ;
consensus . nHighSubsidyBlocks = nHighSubsidyBlocks ;
consensus . nHighSubsidyFactor = nHighSubsidyFactor ;
}
void UpdateDevnetSubsidyAndDiffParametersFromArgs ( const ArgsManager & args ) ;
/**
* Allows modifying the LLMQ type for ChainLocks .
*/
void UpdateDevnetLLMQChainLocks ( Consensus : : LLMQType llmqType )
{
consensus . llmqTypeChainLocks = llmqType ;
}
void UpdateDevnetLLMQChainLocksFromArgs ( const ArgsManager & args ) ;
/**
* Allows modifying the LLMQ type for InstantSend .
*/
void UpdateDevnetLLMQInstantSend ( Consensus : : LLMQType llmqType )
{
consensus . llmqTypeInstantSend = llmqType ;
}
2022-04-05 23:50:13 +02:00
2022-04-16 16:46:04 +02:00
/**
* Allows modifying the LLMQ type for InstantSend ( DIP0024 ) .
*/
void UpdateDevnetLLMQDIP0024InstantSend ( Consensus : : LLMQType llmqType )
{
consensus . llmqTypeDIP0024InstantSend = llmqType ;
}
2022-04-05 23:50:13 +02:00
/**
* Allows modifying PowTargetSpacing
*/
void UpdateDevnetPowTargetSpacing ( int64_t nPowTargetSpacing )
{
consensus . nPowTargetSpacing = nPowTargetSpacing ;
}
2021-09-03 00:36:11 +02:00
/**
* Allows modifying parameters of the devnet LLMQ
*/
void UpdateLLMQDevnetParameters ( int size , int threshold )
{
2022-01-10 19:36:18 +01:00
auto params = ranges : : find_if ( consensus . llmqs , [ ] ( const auto & llmq ) { return llmq . type = = Consensus : : LLMQType : : LLMQ_DEVNET ; } ) ;
assert ( params ! = consensus . llmqs . end ( ) ) ;
params - > size = size ;
params - > minSize = threshold ;
params - > threshold = threshold ;
params - > dkgBadVotesThreshold = threshold ;
2021-09-03 00:36:11 +02:00
}
void UpdateLLMQDevnetParametersFromArgs ( const ArgsManager & args ) ;
2022-04-05 23:50:13 +02:00
void UpdateDevnetLLMQInstantSendFromArgs ( const ArgsManager & args ) ;
2022-04-16 16:46:04 +02:00
void UpdateDevnetLLMQInstantSendDIP0024FromArgs ( const ArgsManager & args ) ;
2022-04-05 23:50:13 +02:00
void UpdateDevnetPowTargetSpacingFromArgs ( const ArgsManager & args ) ;
2017-12-20 12:45:01 +01:00
} ;
2014-10-25 11:24:16 +02:00
/**
* Regression test
*/
2015-07-03 14:30:18 +02:00
class CRegTestParams : public CChainParams {
2013-05-07 15:16:25 +02:00
public :
2021-09-03 00:36:11 +02:00
explicit CRegTestParams ( const ArgsManager & args ) {
2014-06-11 12:23:49 +02:00
strNetworkID = " regtest " ;
2015-02-11 11:58:11 +01:00
consensus . nSubsidyHalvingInterval = 150 ;
2016-03-06 16:07:30 +01:00
consensus . nMasternodePaymentsStartBlock = 240 ;
consensus . nMasternodePaymentsIncreaseBlock = 350 ;
consensus . nMasternodePaymentsIncreasePeriod = 10 ;
2018-03-10 13:35:09 +01:00
consensus . nInstantSendConfirmationsRequired = 2 ;
2016-06-29 20:20:18 +02:00
consensus . nInstantSendKeepLock = 6 ;
2016-02-17 17:29:36 +01:00
consensus . nBudgetPaymentsStartBlock = 1000 ;
consensus . nBudgetPaymentsCycleBlocks = 50 ;
2016-08-22 03:41:40 +02:00
consensus . nBudgetPaymentsWindowBlocks = 10 ;
consensus . nSuperblockStartBlock = 1500 ;
2018-02-01 13:42:21 +01:00
consensus . nSuperblockStartHash = uint256 ( ) ; // do not check this on regtest
2016-08-22 03:41:40 +02:00
consensus . nSuperblockCycle = 10 ;
2016-08-28 21:15:48 +02:00
consensus . nGovernanceMinQuorum = 1 ;
2017-02-02 09:50:44 +01:00
consensus . nGovernanceFilterElements = 100 ;
2016-05-19 21:03:17 +02:00
consensus . nMasternodeMinimumConfirmations = 1 ;
2019-01-08 15:37:33 +01:00
consensus . BIP34Height = 500 ; // BIP34 activated on regtest (Used in functional tests)
2015-11-02 22:41:55 +01:00
consensus . BIP34Hash = uint256 ( ) ;
2019-01-08 15:37:33 +01:00
consensus . BIP65Height = 1351 ; // BIP65 activated on regtest (Used in functional tests)
consensus . BIP66Height = 1251 ; // BIP66 activated on regtest (Used in functional tests)
2018-03-08 13:18:24 +01:00
consensus . DIP0001Height = 2000 ;
2019-04-25 17:39:04 +02:00
consensus . DIP0003Height = 432 ;
2019-01-29 15:54:38 +01:00
consensus . DIP0003EnforcementHeight = 500 ;
consensus . DIP0003EnforcementHash = uint256 ( ) ;
2020-12-28 12:21:01 +01:00
consensus . DIP0008Height = 432 ;
2022-03-14 22:40:01 +01:00
consensus . BRRHeight = 2500 ; // see block_reward_reallocation_tests
2021-12-12 16:02:48 +01:00
consensus . MinBIP9WarningHeight = 0 ;
2018-03-19 14:08:32 +01:00
consensus . powLimit = uint256S ( " 7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff " ) ; // ~uint256(0) >> 1
2016-02-02 16:28:56 +01:00
consensus . nPowTargetTimespan = 24 * 60 * 60 ; // Dash: 1 day
consensus . nPowTargetSpacing = 2.5 * 60 ; // Dash: 2.5 minutes
2015-07-03 14:30:18 +02:00
consensus . fPowAllowMinDifficultyBlocks = true ;
2015-10-19 14:25:29 +02:00
consensus . fPowNoRetargeting = true ;
2017-12-01 06:15:11 +01:00
consensus . nPowKGWHeight = 15200 ; // same as mainnet
consensus . nPowDGWHeight = 34140 ; // same as mainnet
2016-02-15 05:13:27 +01:00
consensus . nRuleChangeActivationThreshold = 108 ; // 75% for testchains
consensus . nMinerConfirmationWindow = 144 ; // Faster than normal for regtest (144 instead of 2016)
2016-03-09 22:00:53 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_TESTDUMMY ] . bit = 28 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_TESTDUMMY ] . nStartTime = 0 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_TESTDUMMY ] . nTimeout = 999999999999ULL ;
2016-02-20 23:37:13 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_CSV ] . bit = 0 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_CSV ] . nStartTime = 0 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_CSV ] . nTimeout = 999999999999ULL ;
2017-09-11 16:13:30 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0001 ] . bit = 1 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0001 ] . nStartTime = 0 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0001 ] . nTimeout = 999999999999ULL ;
2018-01-30 20:18:51 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_BIP147 ] . bit = 2 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_BIP147 ] . nStartTime = 0 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_BIP147 ] . nTimeout = 999999999999ULL ;
2018-02-14 21:31:42 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0003 ] . bit = 3 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0003 ] . nStartTime = 0 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0003 ] . nTimeout = 999999999999ULL ;
2019-03-22 11:51:50 +01:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0008 ] . bit = 4 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0008 ] . nStartTime = 0 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0008 ] . nTimeout = 999999999999ULL ;
2020-09-10 18:23:11 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . bit = 5 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nStartTime = 0 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nTimeout = 999999999999ULL ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nWindowSize = 500 ;
2020-09-12 16:33:12 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nThresholdStart = 400 ; // 80%
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nThresholdMin = 300 ; // 60%
consensus . vDeployments [ Consensus : : DEPLOYMENT_REALLOC ] . nFalloffCoeff = 5 ;
2021-05-07 18:36:30 +02:00
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . bit = 6 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nStartTime = 0 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nTimeout = 999999999999ULL ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nWindowSize = 100 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nThresholdStart = 80 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nThresholdMin = 60 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0020 ] . nFalloffCoeff = 5 ;
2022-04-16 16:46:04 +02:00
// Deployment of Quorum Rotation DIP and decreased proposal fee
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . bit = 7 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nStartTime = 0 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nTimeout = 999999999999ULL ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nWindowSize = 300 ;
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nThresholdStart = 240 ; // 80% of 300
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nThresholdMin = 180 ; // 60% of 300
consensus . vDeployments [ Consensus : : DEPLOYMENT_DIP0024 ] . nFalloffCoeff = 5 ; // this corresponds to 10 periods
2015-07-29 21:13:36 +02:00
2017-08-23 16:21:08 +02:00
// The best chain should have at least this much work.
consensus . nMinimumChainWork = uint256S ( " 0x00 " ) ;
// By default assume that the signatures in ancestors of this block are valid.
consensus . defaultAssumeValid = uint256S ( " 0x00 " ) ;
2014-11-28 10:56:02 +01:00
pchMessageStart [ 0 ] = 0xfc ;
pchMessageStart [ 1 ] = 0xc1 ;
pchMessageStart [ 2 ] = 0xb7 ;
pchMessageStart [ 3 ] = 0xdc ;
2019-08-28 09:52:00 +02:00
nDefaultPort = 19899 ;
Add block pruning functionality
This adds a -prune=N option to bitcoind, which if set to N>0 will enable block
file pruning. When pruning is enabled, block and undo files will be deleted to
try to keep total space used by those files to below the prune target (N, in
MB) specified by the user, subject to some constraints:
- The last 288 blocks on the main chain are always kept (MIN_BLOCKS_TO_KEEP),
- N must be at least 550MB (chosen as a value for the target that could
reasonably be met, with some assumptions about block sizes, orphan rates,
etc; see comment in main.h),
- No blocks are pruned until chainActive is at least 100,000 blocks long (on
mainnet; defined separately for mainnet, testnet, and regtest in chainparams
as nPruneAfterHeight).
This unsets NODE_NETWORK if pruning is enabled.
Also included is an RPC test for pruning (pruning.py).
Thanks to @rdponticelli for earlier work on this feature; this is based in
part off that work.
2015-02-23 20:27:44 +01:00
nPruneAfterHeight = 1000 ;
2019-01-12 01:33:11 +01:00
m_assumed_blockchain_size = 0 ;
m_assumed_chain_state_size = 0 ;
2013-05-07 15:16:25 +02:00
2021-09-03 00:36:11 +02:00
UpdateVersionBitsParametersFromArgs ( args ) ;
UpdateDIP3ParametersFromArgs ( args ) ;
UpdateDIP8ParametersFromArgs ( args ) ;
UpdateBudgetParametersFromArgs ( args ) ;
2016-02-02 16:28:56 +01:00
genesis = CreateGenesisBlock ( 1417713337 , 1096447 , 0x207fffff , 1 , 50 * COIN ) ;
2015-07-29 21:13:36 +02:00
consensus . hashGenesisBlock = genesis . GetHash ( ) ;
2016-02-02 16:28:56 +01:00
assert ( consensus . hashGenesisBlock = = uint256S ( " 0x000008ca1832a4baf228eb1553c03d3a2c8e02399550dd6ea8d65cec3ef23d2e " ) ) ;
assert ( genesis . hashMerkleRoot = = uint256S ( " 0xe0028eb9648db56b1ac77cf090b99048a8007e2bb64b68f092c03c7f56a662c7 " ) ) ;
2013-05-07 15:16:25 +02:00
2016-04-05 17:49:42 +02:00
vFixedSeeds . clear ( ) ; //!< Regtest mode doesn't have any fixed seeds.
vSeeds . clear ( ) ; //!< Regtest mode doesn't have any DNS seeds.
2013-05-07 15:16:25 +02:00
2015-03-13 17:25:34 +01:00
fDefaultConsistencyChecks = true ;
2019-07-16 22:07:14 +02:00
fRequireStandard = true ;
2018-07-12 11:04:42 +02:00
fRequireRoutableExternalIP = false ;
2019-07-16 22:07:14 +02:00
m_is_test_chain = true ;
2017-12-20 12:45:01 +01:00
fAllowMultipleAddressesFromGroup = true ;
2018-03-08 13:16:52 +01:00
fAllowMultiplePorts = true ;
2020-03-31 07:06:41 +02:00
nLLMQConnectionRetryTimeout = 1 ; // must be lower then the LLMQ signing session timeout so that tests have control over failing behavior
2022-01-09 18:03:26 +01:00
m_is_mockable_chain = true ;
2014-08-31 21:32:23 +02:00
2016-09-27 09:50:04 +02:00
nFulfilledRequestExpireTime = 5 * 60 ; // fulfilled requests expire in 5 minutes
2020-01-31 11:56:45 +01:00
nPoolMinParticipants = 2 ;
2020-12-09 21:00:08 +01:00
nPoolMaxParticipants = 20 ;
2016-09-27 09:50:04 +02:00
2018-03-02 14:15:04 +01:00
// privKey: cP4EKFyJsHT39LDqgdcB43Y3YXjNyjb5Fuas1GQSeAtjnZWmZEQK
2018-09-30 19:01:33 +02:00
vSporkAddresses = { " yj949n1UH6fDhw6HtVE5VMj2iSTaSWBMcW " } ;
nMinSporkKeys = 1 ;
2018-10-26 18:42:52 +02:00
// regtest usually has no masternodes in most tests, so don't check for upgraged MNs
fBIP9CheckMasternodesUpgraded = false ;
2018-03-02 14:15:04 +01:00
2017-12-13 13:32:00 +01:00
checkpointData = {
2017-06-08 19:35:28 +02:00
{
{ 0 , uint256S ( " 0x000008ca1832a4baf228eb1553c03d3a2c8e02399550dd6ea8d65cec3ef23d2e " ) } ,
}
2017-01-12 12:12:56 +01:00
} ;
chainTxData = ChainTxData {
2015-04-24 00:30:55 +02:00
0 ,
0 ,
0
} ;
2017-01-12 12:12:56 +01:00
2016-08-02 00:00:24 +02:00
// Regtest Dash addresses start with 'y'
2016-05-09 20:28:29 +02:00
base58Prefixes [ PUBKEY_ADDRESS ] = std : : vector < unsigned char > ( 1 , 140 ) ;
2016-08-02 00:00:24 +02:00
// Regtest Dash script addresses start with '8' or '9'
2016-02-02 16:28:56 +01:00
base58Prefixes [ SCRIPT_ADDRESS ] = std : : vector < unsigned char > ( 1 , 19 ) ;
// Regtest private keys start with '9' or 'c' (Bitcoin defaults)
2015-07-03 14:30:18 +02:00
base58Prefixes [ SECRET_KEY ] = std : : vector < unsigned char > ( 1 , 239 ) ;
2016-08-02 00:00:24 +02:00
// Regtest Dash BIP32 pubkeys start with 'tpub' (Bitcoin defaults)
2017-06-08 19:35:28 +02:00
base58Prefixes [ EXT_PUBLIC_KEY ] = { 0x04 , 0x35 , 0x87 , 0xCF } ;
2016-08-02 00:00:24 +02:00
// Regtest Dash BIP32 prvkeys start with 'tprv' (Bitcoin defaults)
2017-06-08 19:35:28 +02:00
base58Prefixes [ EXT_SECRET_KEY ] = { 0x04 , 0x35 , 0x83 , 0x94 } ;
2017-05-29 13:51:40 +02:00
2016-08-02 00:00:24 +02:00
// Regtest Dash BIP44 coin type is '1' (All coin's testnet default)
2017-05-29 13:51:40 +02:00
nExtCoinType = 1 ;
2018-11-23 15:42:09 +01:00
// long living quorum params
2021-10-15 12:28:19 +02:00
AddLLMQ ( Consensus : : LLMQType : : LLMQ_TEST ) ;
2022-04-16 16:46:04 +02:00
AddLLMQ ( Consensus : : LLMQType : : LLMQ_TEST_INSTANTSEND ) ;
2021-10-15 12:28:19 +02:00
AddLLMQ ( Consensus : : LLMQType : : LLMQ_TEST_V17 ) ;
2022-04-16 16:46:04 +02:00
AddLLMQ ( Consensus : : LLMQType : : LLMQ_TEST_DIP0024 ) ;
2021-10-15 12:28:19 +02:00
consensus . llmqTypeChainLocks = Consensus : : LLMQType : : LLMQ_TEST ;
2022-04-16 16:46:04 +02:00
consensus . llmqTypeInstantSend = Consensus : : LLMQType : : LLMQ_TEST_INSTANTSEND ;
consensus . llmqTypeDIP0024InstantSend = Consensus : : LLMQType : : LLMQ_TEST_DIP0024 ;
2021-10-15 12:28:19 +02:00
consensus . llmqTypePlatform = Consensus : : LLMQType : : LLMQ_TEST ;
2021-12-11 21:00:27 +01:00
consensus . llmqTypeMnhf = Consensus : : LLMQType : : LLMQ_TEST ;
2021-09-03 00:36:11 +02:00
2022-04-16 16:46:04 +02:00
UpdateLLMQTestParametersFromArgs ( args , Consensus : : LLMQType : : LLMQ_TEST ) ;
UpdateLLMQTestParametersFromArgs ( args , Consensus : : LLMQType : : LLMQ_TEST_INSTANTSEND ) ;
2018-11-23 15:42:09 +01:00
}
2014-09-04 21:23:42 +02:00
2021-09-03 00:36:11 +02:00
/**
* Allows modifying the Version Bits regtest parameters .
*/
void UpdateVersionBitsParameters ( Consensus : : DeploymentPos d , int64_t nStartTime , int64_t nTimeout , int64_t nWindowSize , int64_t nThresholdStart , int64_t nThresholdMin , int64_t nFalloffCoeff )
{
consensus . vDeployments [ d ] . nStartTime = nStartTime ;
consensus . vDeployments [ d ] . nTimeout = nTimeout ;
if ( nWindowSize ! = - 1 ) {
consensus . vDeployments [ d ] . nWindowSize = nWindowSize ;
}
if ( nThresholdStart ! = - 1 ) {
consensus . vDeployments [ d ] . nThresholdStart = nThresholdStart ;
}
if ( nThresholdMin ! = - 1 ) {
consensus . vDeployments [ d ] . nThresholdMin = nThresholdMin ;
}
if ( nFalloffCoeff ! = - 1 ) {
consensus . vDeployments [ d ] . nFalloffCoeff = nFalloffCoeff ;
}
}
void UpdateVersionBitsParametersFromArgs ( const ArgsManager & args ) ;
/**
* Allows modifying the DIP3 activation and enforcement height
*/
void UpdateDIP3Parameters ( int nActivationHeight , int nEnforcementHeight )
{
consensus . DIP0003Height = nActivationHeight ;
consensus . DIP0003EnforcementHeight = nEnforcementHeight ;
}
void UpdateDIP3ParametersFromArgs ( const ArgsManager & args ) ;
/**
* Allows modifying the DIP8 activation height
*/
void UpdateDIP8Parameters ( int nActivationHeight )
{
consensus . DIP0008Height = nActivationHeight ;
}
void UpdateDIP8ParametersFromArgs ( const ArgsManager & args ) ;
/**
* Allows modifying the budget regtest parameters .
*/
void UpdateBudgetParameters ( int nMasternodePaymentsStartBlock , int nBudgetPaymentsStartBlock , int nSuperblockStartBlock )
{
consensus . nMasternodePaymentsStartBlock = nMasternodePaymentsStartBlock ;
consensus . nBudgetPaymentsStartBlock = nBudgetPaymentsStartBlock ;
consensus . nSuperblockStartBlock = nSuperblockStartBlock ;
}
void UpdateBudgetParametersFromArgs ( const ArgsManager & args ) ;
/**
* Allows modifying parameters of the test LLMQ
*/
2022-04-16 16:46:04 +02:00
void UpdateLLMQTestParameters ( int size , int threshold , const Consensus : : LLMQType llmqType )
2021-09-03 00:36:11 +02:00
{
2022-04-16 16:46:04 +02:00
auto params = ranges : : find_if ( consensus . llmqs , [ llmqType ] ( const auto & llmq ) { return llmq . type = = llmqType ; } ) ;
2022-01-10 19:36:18 +01:00
assert ( params ! = consensus . llmqs . end ( ) ) ;
params - > size = size ;
params - > minSize = threshold ;
params - > threshold = threshold ;
params - > dkgBadVotesThreshold = threshold ;
2021-09-03 00:36:11 +02:00
}
2022-04-16 16:46:04 +02:00
void UpdateLLMQTestParametersFromArgs ( const ArgsManager & args , const Consensus : : LLMQType llmqType ) ;
2021-09-03 00:36:11 +02:00
} ;
2013-05-07 15:16:25 +02:00
2021-09-03 00:36:11 +02:00
void CRegTestParams : : UpdateVersionBitsParametersFromArgs ( const ArgsManager & args )
{
if ( ! args . IsArgSet ( " -vbparams " ) ) return ;
for ( const std : : string & strDeployment : args . GetArgs ( " -vbparams " ) ) {
std : : vector < std : : string > vDeploymentParams ;
boost : : split ( vDeploymentParams , strDeployment , boost : : is_any_of ( " : " ) ) ;
if ( vDeploymentParams . size ( ) ! = 3 & & vDeploymentParams . size ( ) ! = 5 & & vDeploymentParams . size ( ) ! = 7 ) {
throw std : : runtime_error ( " Version bits parameters malformed, expecting "
" <deployment>:<start>:<end> or "
" <deployment>:<start>:<end>:<window>:<threshold> or "
" <deployment>:<start>:<end>:<window>:<thresholdstart>:<thresholdmin>:<falloffcoeff> " ) ;
}
int64_t nStartTime , nTimeout , nWindowSize = - 1 , nThresholdStart = - 1 , nThresholdMin = - 1 , nFalloffCoeff = - 1 ;
if ( ! ParseInt64 ( vDeploymentParams [ 1 ] , & nStartTime ) ) {
throw std : : runtime_error ( strprintf ( " Invalid nStartTime (%s) " , vDeploymentParams [ 1 ] ) ) ;
}
if ( ! ParseInt64 ( vDeploymentParams [ 2 ] , & nTimeout ) ) {
throw std : : runtime_error ( strprintf ( " Invalid nTimeout (%s) " , vDeploymentParams [ 2 ] ) ) ;
}
if ( vDeploymentParams . size ( ) > = 5 ) {
if ( ! ParseInt64 ( vDeploymentParams [ 3 ] , & nWindowSize ) ) {
throw std : : runtime_error ( strprintf ( " Invalid nWindowSize (%s) " , vDeploymentParams [ 3 ] ) ) ;
}
if ( ! ParseInt64 ( vDeploymentParams [ 4 ] , & nThresholdStart ) ) {
throw std : : runtime_error ( strprintf ( " Invalid nThresholdStart (%s) " , vDeploymentParams [ 4 ] ) ) ;
}
}
if ( vDeploymentParams . size ( ) = = 7 ) {
if ( ! ParseInt64 ( vDeploymentParams [ 5 ] , & nThresholdMin ) ) {
throw std : : runtime_error ( strprintf ( " Invalid nThresholdMin (%s) " , vDeploymentParams [ 5 ] ) ) ;
}
if ( ! ParseInt64 ( vDeploymentParams [ 6 ] , & nFalloffCoeff ) ) {
throw std : : runtime_error ( strprintf ( " Invalid nFalloffCoeff (%s) " , vDeploymentParams [ 6 ] ) ) ;
}
}
bool found = false ;
for ( int j = 0 ; j < ( int ) Consensus : : MAX_VERSION_BITS_DEPLOYMENTS ; + + j ) {
if ( vDeploymentParams [ 0 ] = = VersionBitsDeploymentInfo [ j ] . name ) {
UpdateVersionBitsParameters ( Consensus : : DeploymentPos ( j ) , nStartTime , nTimeout , nWindowSize , nThresholdStart , nThresholdMin , nFalloffCoeff ) ;
found = true ;
LogPrintf ( " Setting version bits activation parameters for %s to start=%ld, timeout=%ld, window=%ld, thresholdstart=%ld, thresholdmin=%ld, falloffcoeff=%ld \n " ,
vDeploymentParams [ 0 ] , nStartTime , nTimeout , nWindowSize , nThresholdStart , nThresholdMin , nFalloffCoeff ) ;
break ;
}
}
if ( ! found ) {
throw std : : runtime_error ( strprintf ( " Invalid deployment (%s) " , vDeploymentParams [ 0 ] ) ) ;
}
}
2013-05-07 15:16:25 +02:00
}
2021-09-03 00:36:11 +02:00
void CRegTestParams : : UpdateDIP3ParametersFromArgs ( const ArgsManager & args )
2015-06-30 21:39:49 +02:00
{
2021-09-03 00:36:11 +02:00
if ( ! args . IsArgSet ( " -dip3params " ) ) return ;
std : : string strParams = args . GetArg ( " -dip3params " , " " ) ;
std : : vector < std : : string > vParams ;
boost : : split ( vParams , strParams , boost : : is_any_of ( " : " ) ) ;
if ( vParams . size ( ) ! = 2 ) {
throw std : : runtime_error ( " DIP3 parameters malformed, expecting <activation>:<enforcement> " ) ;
}
int nDIP3ActivationHeight , nDIP3EnforcementHeight ;
if ( ! ParseInt32 ( vParams [ 0 ] , & nDIP3ActivationHeight ) ) {
throw std : : runtime_error ( strprintf ( " Invalid activation height (%s) " , vParams [ 0 ] ) ) ;
}
if ( ! ParseInt32 ( vParams [ 1 ] , & nDIP3EnforcementHeight ) ) {
throw std : : runtime_error ( strprintf ( " Invalid enforcement height (%s) " , vParams [ 1 ] ) ) ;
}
LogPrintf ( " Setting DIP3 parameters to activation=%ld, enforcement=%ld \n " , nDIP3ActivationHeight , nDIP3EnforcementHeight ) ;
UpdateDIP3Parameters ( nDIP3ActivationHeight , nDIP3EnforcementHeight ) ;
2013-05-07 15:16:25 +02:00
}
2021-09-03 00:36:11 +02:00
void CRegTestParams : : UpdateDIP8ParametersFromArgs ( const ArgsManager & args )
2015-06-30 21:39:49 +02:00
{
2021-09-03 00:36:11 +02:00
if ( ! args . IsArgSet ( " -dip8params " ) ) return ;
std : : string strParams = args . GetArg ( " -dip8params " , " " ) ;
std : : vector < std : : string > vParams ;
boost : : split ( vParams , strParams , boost : : is_any_of ( " : " ) ) ;
if ( vParams . size ( ) ! = 1 ) {
throw std : : runtime_error ( " DIP8 parameters malformed, expecting <activation> " ) ;
}
int nDIP8ActivationHeight ;
if ( ! ParseInt32 ( vParams [ 0 ] , & nDIP8ActivationHeight ) ) {
throw std : : runtime_error ( strprintf ( " Invalid activation height (%s) " , vParams [ 0 ] ) ) ;
}
LogPrintf ( " Setting DIP8 parameters to activation=%ld \n " , nDIP8ActivationHeight ) ;
UpdateDIP8Parameters ( nDIP8ActivationHeight ) ;
2014-08-02 20:54:57 +02:00
}
2016-07-25 23:22:37 +02:00
2021-09-03 00:36:11 +02:00
void CRegTestParams : : UpdateBudgetParametersFromArgs ( const ArgsManager & args )
2019-01-23 17:36:51 +01:00
{
2021-09-03 00:36:11 +02:00
if ( ! args . IsArgSet ( " -budgetparams " ) ) return ;
std : : string strParams = args . GetArg ( " -budgetparams " , " " ) ;
std : : vector < std : : string > vParams ;
boost : : split ( vParams , strParams , boost : : is_any_of ( " : " ) ) ;
if ( vParams . size ( ) ! = 3 ) {
throw std : : runtime_error ( " Budget parameters malformed, expecting <masternode>:<budget>:<superblock> " ) ;
}
int nMasternodePaymentsStartBlock , nBudgetPaymentsStartBlock , nSuperblockStartBlock ;
if ( ! ParseInt32 ( vParams [ 0 ] , & nMasternodePaymentsStartBlock ) ) {
throw std : : runtime_error ( strprintf ( " Invalid masternode start height (%s) " , vParams [ 0 ] ) ) ;
}
if ( ! ParseInt32 ( vParams [ 1 ] , & nBudgetPaymentsStartBlock ) ) {
throw std : : runtime_error ( strprintf ( " Invalid budget start block (%s) " , vParams [ 1 ] ) ) ;
}
if ( ! ParseInt32 ( vParams [ 2 ] , & nSuperblockStartBlock ) ) {
throw std : : runtime_error ( strprintf ( " Invalid superblock start height (%s) " , vParams [ 2 ] ) ) ;
}
LogPrintf ( " Setting budget parameters to masternode=%ld, budget=%ld, superblock=%ld \n " , nMasternodePaymentsStartBlock , nBudgetPaymentsStartBlock , nSuperblockStartBlock ) ;
UpdateBudgetParameters ( nMasternodePaymentsStartBlock , nBudgetPaymentsStartBlock , nSuperblockStartBlock ) ;
2019-01-23 17:36:51 +01:00
}
2022-04-16 16:46:04 +02:00
void CRegTestParams : : UpdateLLMQTestParametersFromArgs ( const ArgsManager & args , const Consensus : : LLMQType llmqType )
2016-07-25 23:22:37 +02:00
{
2022-04-16 16:46:04 +02:00
assert ( llmqType = = Consensus : : LLMQType : : LLMQ_TEST | | llmqType = = Consensus : : LLMQType : : LLMQ_TEST_INSTANTSEND ) ;
2021-09-03 00:36:11 +02:00
2022-04-16 16:46:04 +02:00
std : : string cmd_param { " -llmqtestparams " } , llmq_name { " LLMQ_TEST " } ;
if ( llmqType = = Consensus : : LLMQType : : LLMQ_TEST_INSTANTSEND ) {
cmd_param = " -llmqtestinstantsendparams " ;
llmq_name = " LLMQ_TEST_INSTANTSEND " ;
}
if ( ! args . IsArgSet ( cmd_param ) ) return ;
std : : string strParams = args . GetArg ( cmd_param , " " ) ;
2021-09-03 00:36:11 +02:00
std : : vector < std : : string > vParams ;
boost : : split ( vParams , strParams , boost : : is_any_of ( " : " ) ) ;
if ( vParams . size ( ) ! = 2 ) {
2022-04-16 16:46:04 +02:00
throw std : : runtime_error ( strprintf ( " %s parameters malformed, expecting <size>:<threshold> " , llmq_name ) ) ;
2021-09-03 00:36:11 +02:00
}
int size , threshold ;
if ( ! ParseInt32 ( vParams [ 0 ] , & size ) ) {
2022-04-16 16:46:04 +02:00
throw std : : runtime_error ( strprintf ( " Invalid %s size (%s) " , llmq_name , vParams [ 0 ] ) ) ;
2021-09-03 00:36:11 +02:00
}
if ( ! ParseInt32 ( vParams [ 1 ] , & threshold ) ) {
2022-04-16 16:46:04 +02:00
throw std : : runtime_error ( strprintf ( " Invalid %s threshold (%s) " , llmq_name , vParams [ 1 ] ) ) ;
2021-09-03 00:36:11 +02:00
}
2022-04-16 16:46:04 +02:00
LogPrintf ( " Setting %s parameters to size=%ld, threshold=%ld \n " , llmq_name , size , threshold ) ;
UpdateLLMQTestParameters ( size , threshold , llmqType ) ;
2016-07-25 23:22:37 +02:00
}
2018-08-11 00:36:17 +02:00
2021-09-03 00:36:11 +02:00
void CDevNetParams : : UpdateDevnetSubsidyAndDiffParametersFromArgs ( const ArgsManager & args )
2020-12-28 12:21:01 +01:00
{
2021-09-03 00:36:11 +02:00
if ( ! args . IsArgSet ( " -minimumdifficultyblocks " ) & & ! args . IsArgSet ( " -highsubsidyblocks " ) & & ! args . IsArgSet ( " -highsubsidyfactor " ) ) return ;
int nMinimumDifficultyBlocks = gArgs . GetArg ( " -minimumdifficultyblocks " , consensus . nMinimumDifficultyBlocks ) ;
int nHighSubsidyBlocks = gArgs . GetArg ( " -highsubsidyblocks " , consensus . nHighSubsidyBlocks ) ;
int nHighSubsidyFactor = gArgs . GetArg ( " -highsubsidyfactor " , consensus . nHighSubsidyFactor ) ;
LogPrintf ( " Setting minimumdifficultyblocks=%ld, highsubsidyblocks=%ld, highsubsidyfactor=%ld \n " , nMinimumDifficultyBlocks , nHighSubsidyBlocks , nHighSubsidyFactor ) ;
UpdateDevnetSubsidyAndDiffParameters ( nMinimumDifficultyBlocks , nHighSubsidyBlocks , nHighSubsidyFactor ) ;
2020-12-28 12:21:01 +01:00
}
2021-09-03 00:36:11 +02:00
void CDevNetParams : : UpdateDevnetLLMQChainLocksFromArgs ( const ArgsManager & args )
2018-08-11 00:36:17 +02:00
{
2021-09-03 00:36:11 +02:00
if ( ! args . IsArgSet ( " -llmqchainlocks " ) ) return ;
2022-02-24 18:08:22 +01:00
std : : string strLLMQType = gArgs . GetArg ( " -llmqchainlocks " , std : : string ( GetLLMQ ( consensus . llmqTypeChainLocks ) . name ) ) ;
2021-10-15 12:28:19 +02:00
Consensus : : LLMQType llmqType = Consensus : : LLMQType : : LLMQ_NONE ;
2022-01-10 19:36:18 +01:00
for ( const auto & params : consensus . llmqs ) {
if ( params . name = = strLLMQType ) {
llmqType = params . type ;
2021-09-03 00:36:11 +02:00
}
}
2021-10-15 12:28:19 +02:00
if ( llmqType = = Consensus : : LLMQType : : LLMQ_NONE ) {
2021-09-03 00:36:11 +02:00
throw std : : runtime_error ( " Invalid LLMQ type specified for -llmqchainlocks. " ) ;
}
2021-10-15 12:28:19 +02:00
LogPrintf ( " Setting llmqchainlocks to size=%ld \n " , static_cast < uint8_t > ( llmqType ) ) ;
2021-09-03 00:36:11 +02:00
UpdateDevnetLLMQChainLocks ( llmqType ) ;
2018-08-11 00:36:17 +02:00
}
2018-10-25 09:16:38 +02:00
2021-09-03 00:36:11 +02:00
void CDevNetParams : : UpdateDevnetLLMQInstantSendFromArgs ( const ArgsManager & args )
2018-10-25 09:16:38 +02:00
{
2021-09-03 00:36:11 +02:00
if ( ! args . IsArgSet ( " -llmqinstantsend " ) ) return ;
2022-02-24 18:08:22 +01:00
std : : string strLLMQType = gArgs . GetArg ( " -llmqinstantsend " , std : : string ( GetLLMQ ( consensus . llmqTypeInstantSend ) . name ) ) ;
2021-10-15 12:28:19 +02:00
Consensus : : LLMQType llmqType = Consensus : : LLMQType : : LLMQ_NONE ;
2022-01-10 19:36:18 +01:00
for ( const auto & params : consensus . llmqs ) {
if ( params . name = = strLLMQType ) {
llmqType = params . type ;
2021-09-03 00:36:11 +02:00
}
}
2021-10-15 12:28:19 +02:00
if ( llmqType = = Consensus : : LLMQType : : LLMQ_NONE ) {
2021-09-03 00:36:11 +02:00
throw std : : runtime_error ( " Invalid LLMQ type specified for -llmqinstantsend. " ) ;
}
2021-10-15 12:28:19 +02:00
LogPrintf ( " Setting llmqinstantsend to size=%ld \n " , static_cast < uint8_t > ( llmqType ) ) ;
2021-09-03 00:36:11 +02:00
UpdateDevnetLLMQInstantSend ( llmqType ) ;
2018-10-25 09:16:38 +02:00
}
2019-02-05 15:46:05 +01:00
2022-04-16 16:46:04 +02:00
void CDevNetParams : : UpdateDevnetLLMQInstantSendDIP0024FromArgs ( const ArgsManager & args )
{
if ( ! args . IsArgSet ( " -llmqinstantsenddip0024 " ) ) return ;
std : : string strLLMQType = gArgs . GetArg ( " -llmqinstantsenddip0024 " , std : : string ( GetLLMQ ( consensus . llmqTypeDIP0024InstantSend ) . name ) ) ;
Consensus : : LLMQType llmqType = Consensus : : LLMQType : : LLMQ_NONE ;
for ( const auto & params : consensus . llmqs ) {
if ( params . name = = strLLMQType ) {
llmqType = params . type ;
}
}
if ( llmqType = = Consensus : : LLMQType : : LLMQ_NONE ) {
throw std : : runtime_error ( " Invalid LLMQ type specified for -llmqinstantsenddip0024. " ) ;
}
LogPrintf ( " Setting llmqinstantsenddip0024 to size=%ld \n " , static_cast < uint8_t > ( llmqType ) ) ;
UpdateDevnetLLMQDIP0024InstantSend ( llmqType ) ;
}
2022-04-05 23:50:13 +02:00
void CDevNetParams : : UpdateDevnetPowTargetSpacingFromArgs ( const ArgsManager & args )
{
if ( ! args . IsArgSet ( " -powtargetspacing " ) ) return ;
std : : string strPowTargetSpacing = gArgs . GetArg ( " -powtargetspacing " , " " ) ;
int64_t powTargetSpacing ;
if ( ! ParseInt64 ( strPowTargetSpacing , & powTargetSpacing ) ) {
throw std : : runtime_error ( strprintf ( " Invalid parsing of powTargetSpacing (%s) " , strPowTargetSpacing ) ) ;
}
if ( powTargetSpacing < 1 ) {
throw std : : runtime_error ( strprintf ( " Invalid value of powTargetSpacing (%s) " , strPowTargetSpacing ) ) ;
}
LogPrintf ( " Setting powTargetSpacing to %ld \n " , powTargetSpacing ) ;
UpdateDevnetPowTargetSpacing ( powTargetSpacing ) ;
}
2021-09-03 00:36:11 +02:00
void CDevNetParams : : UpdateLLMQDevnetParametersFromArgs ( const ArgsManager & args )
2019-02-05 15:46:05 +01:00
{
2021-09-03 00:36:11 +02:00
if ( ! args . IsArgSet ( " -llmqdevnetparams " ) ) return ;
std : : string strParams = args . GetArg ( " -llmqdevnetparams " , " " ) ;
std : : vector < std : : string > vParams ;
boost : : split ( vParams , strParams , boost : : is_any_of ( " : " ) ) ;
if ( vParams . size ( ) ! = 2 ) {
throw std : : runtime_error ( " LLMQ_DEVNET parameters malformed, expecting <size>:<threshold> " ) ;
}
int size , threshold ;
if ( ! ParseInt32 ( vParams [ 0 ] , & size ) ) {
throw std : : runtime_error ( strprintf ( " Invalid LLMQ_DEVNET size (%s) " , vParams [ 0 ] ) ) ;
}
if ( ! ParseInt32 ( vParams [ 1 ] , & threshold ) ) {
throw std : : runtime_error ( strprintf ( " Invalid LLMQ_DEVNET threshold (%s) " , vParams [ 1 ] ) ) ;
}
LogPrintf ( " Setting LLMQ_DEVNET parameters to size=%ld, threshold=%ld \n " , size , threshold ) ;
UpdateLLMQDevnetParameters ( size , threshold ) ;
2019-02-05 15:46:05 +01:00
}
2020-01-07 13:49:51 +01:00
2021-09-03 00:36:11 +02:00
static std : : unique_ptr < const CChainParams > globalChainParams ;
const CChainParams & Params ( ) {
assert ( globalChainParams ) ;
return * globalChainParams ;
2021-01-21 21:29:14 +01:00
}
2021-09-03 00:36:11 +02:00
std : : unique_ptr < const CChainParams > CreateChainParams ( const std : : string & chain )
2020-01-07 13:49:51 +01:00
{
2021-09-03 00:36:11 +02:00
if ( chain = = CBaseChainParams : : MAIN )
2021-10-11 19:11:42 +02:00
return std : : make_unique < CMainParams > ( ) ;
2021-09-03 00:36:11 +02:00
else if ( chain = = CBaseChainParams : : TESTNET )
2021-10-11 19:11:42 +02:00
return std : : make_unique < CTestNetParams > ( ) ;
2022-04-16 16:46:04 +02:00
else if ( chain = = CBaseChainParams : : DEVNET )
2021-10-11 19:11:42 +02:00
return std : : make_unique < CDevNetParams > ( gArgs ) ;
2022-04-16 16:46:04 +02:00
else if ( chain = = CBaseChainParams : : REGTEST )
2021-10-11 19:11:42 +02:00
return std : : make_unique < CRegTestParams > ( gArgs ) ;
2021-09-03 00:36:11 +02:00
throw std : : runtime_error ( strprintf ( " %s: Unknown chain %s. " , __func__ , chain ) ) ;
2020-01-07 13:49:51 +01:00
}
2020-02-25 17:06:10 +01:00
2021-09-03 00:36:11 +02:00
void SelectParams ( const std : : string & network )
2020-02-25 17:06:10 +01:00
{
2021-09-03 00:36:11 +02:00
SelectBaseParams ( network ) ;
globalChainParams = CreateChainParams ( network ) ;
2020-02-25 17:06:10 +01:00
}