dash/src/chainparams.cpp

1418 lines
72 KiB
C++
Raw Normal View History

// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2020 The Bitcoin Core developers
// Copyright (c) 2014-2024 The Dash Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
Backport 11651 (#3358) * scripted-diff: Replace #include "" with #include <> (ryanofsky) -BEGIN VERIFY SCRIPT- for f in \ src/*.cpp \ src/*.h \ src/bench/*.cpp \ src/bench/*.h \ src/compat/*.cpp \ src/compat/*.h \ src/consensus/*.cpp \ src/consensus/*.h \ src/crypto/*.cpp \ src/crypto/*.h \ src/crypto/ctaes/*.h \ src/policy/*.cpp \ src/policy/*.h \ src/primitives/*.cpp \ src/primitives/*.h \ src/qt/*.cpp \ src/qt/*.h \ src/qt/test/*.cpp \ src/qt/test/*.h \ src/rpc/*.cpp \ src/rpc/*.h \ src/script/*.cpp \ src/script/*.h \ src/support/*.cpp \ src/support/*.h \ src/support/allocators/*.h \ src/test/*.cpp \ src/test/*.h \ src/wallet/*.cpp \ src/wallet/*.h \ src/wallet/test/*.cpp \ src/wallet/test/*.h \ src/zmq/*.cpp \ src/zmq/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT- Signed-off-by: Pasta <pasta@dashboost.org> * scripted-diff: Replace #include "" with #include <> (Dash Specific) -BEGIN VERIFY SCRIPT- for f in \ src/bls/*.cpp \ src/bls/*.h \ src/evo/*.cpp \ src/evo/*.h \ src/governance/*.cpp \ src/governance/*.h \ src/llmq/*.cpp \ src/llmq/*.h \ src/masternode/*.cpp \ src/masternode/*.h \ src/privatesend/*.cpp \ src/privatesend/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT- Signed-off-by: Pasta <pasta@dashboost.org> * build: Remove -I for everything but project root Remove -I from build system for everything but the project root, and built-in dependencies. Signed-off-by: Pasta <pasta@dashboost.org> # Conflicts: # src/Makefile.test.include * qt: refactor: Use absolute include paths in .ui files * qt: refactor: Changes to make include paths absolute This makes all include paths in the GUI absolute. Many changes are involved as every single source file in src/qt/ assumes to be able to use relative includes. Signed-off-by: Pasta <pasta@dashboost.org> # Conflicts: # src/qt/dash.cpp # src/qt/optionsmodel.cpp # src/qt/test/rpcnestedtests.cpp * test: refactor: Use absolute include paths for test data files * Recommend #include<> syntax in developer notes * refactor: Include obj/build.h instead of build.h * END BACKPORT #11651 Remove trailing whitespace causing travis failure * fix backport 11651 Signed-off-by: Pasta <pasta@dashboost.org> * More of 11651 * fix blockchain.cpp Signed-off-by: pasta <pasta@dashboost.org> * Add missing "qt/" in includes * Add missing "test/" in includes * Fix trailing whitespaces Co-authored-by: Wladimir J. van der Laan <laanwj@gmail.com> Co-authored-by: Russell Yanofsky <russ@yanofsky.org> Co-authored-by: MeshCollider <dobsonsa68@gmail.com> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2020-03-19 23:46:56 +01:00
#include <chainparams.h>
#include <chainparamsseeds.h>
#include <consensus/merkle.h>
Merge bitcoin/bitcoin#19438: Introduce deploymentstatus e48826ad87b4f92261f7433e84f48dac9bd9e5c3 tests: remove ComputeBlockVersion shortcut from versionbits tests (Anthony Towns) c5f36725e877d8eb492383844f8ef7535466b366 [refactor] Move ComputeBlockVersion into VersionBitsCache (Anthony Towns) 4a69b4dbe0d7f504811b67c399da7e6d11e4f805 [move-only] Move ComputeBlockVersion from validation to versionbits (Anthony Towns) 0cfd6c6a8f929d5567ac41f95c21548f115efee5 [refactor] versionbits: make VersionBitsCache a full class (Anthony Towns) 8ee3e0bed5bf2cd3c7a68ca6ba6c65f7b9a72cca [refactor] rpc/blockchain.cpp: SoftForkPushBack (Anthony Towns) 92f48f360da5f425428b761219301f509826bec4 deploymentinfo: Add DeploymentName() (Anthony Towns) ea68b3a5729f5d240e968388c4f88acffeb27228 [move-only] Rename versionbitsinfo to deploymentinfo (Anthony Towns) c64b2c6a0f79369624ae96b2e3d579d50aae4de6 scripted-diff: rename versionbitscache (Anthony Towns) de55304f6e7a8b607e6b3fc7436de50910747b0c [refactor] Add versionbits deployments to deploymentstatus.h (Anthony Towns) 2b0d291da8f479739ff394dd92801da8c40b9f8e [refactor] Add deploymentstatus.h (Anthony Towns) eccd736f3dc231ac0306ca763c3b72cf8247230a versionbits: Use dedicated lock instead of cs_main (Anthony Towns) 36a4ba0aaaa9b35185d7178994e36bc02cca9887 versionbits: correct doxygen comments (Anthony Towns) Pull request description: Introduces helper functions to make it easy to bury future deployments, along the lines of the suggestion from [11398](https://github.com/bitcoin/bitcoin/pull/11398#issuecomment-335599326) "I would prefer it if a buried deployment wouldn't require all code paths that check the BIP9 status to require changing". This provides three functions: `DeploymentEnabled()` which tests if a deployment can ever be active, `DeploymentActiveAt()` which checks if a deployment should be enforced in the given block, and `DeploymentActiveAfter()` which checks if a deployment should be enforced in the block following the given block, and overloads all three to work both with buried deployments and versionbits deployments. This adds a dedicated lock for the versionbits cache, which is acquired internally by the versionbits functions, rather than relying on `cs_main`. It also moves moves versionbitscache into deploymentstatus to avoid a circular dependency with validation. ACKs for top commit: jnewbery: ACK e48826ad87b4f92261f7433e84f48dac9bd9e5c3 gruve-p: ACK https://github.com/bitcoin/bitcoin/pull/19438/commits/e48826ad87b4f92261f7433e84f48dac9bd9e5c3 MarcoFalke: re-ACK e48826ad87b4f92261f7433e84f48dac9bd9e5c3 🥈 Tree-SHA512: c846ba64436d36f8180046ad551d8b0d9e20509b9bc185aa2639055fc28803dd8ec2d6771ab337e80da0b40009ad959590d5772f84a0bf6199b65190d4155bed
2021-07-01 19:15:03 +02:00
#include <deploymentinfo.h>
#include <llmq/params.h>
#include <util/ranges.h>
merge bitcoin#14555: Move util files to directory (script modified to account for Dash backports, doesn't account for rebasing) ------------- BEGIN SCRIPT --------------- mkdir -p src/util git mv src/util.h src/util/system.h git mv src/util.cpp src/util/system.cpp git mv src/utilmemory.h src/util/memory.h git mv src/utilmoneystr.h src/util/moneystr.h git mv src/utilmoneystr.cpp src/util/moneystr.cpp git mv src/utilstrencodings.h src/util/strencodings.h git mv src/utilstrencodings.cpp src/util/strencodings.cpp git mv src/utiltime.h src/util/time.h git mv src/utiltime.cpp src/util/time.cpp git mv src/utilasmap.h src/util/asmap.h git mv src/utilasmap.cpp src/util/asmap.cpp git mv src/utilstring.h src/util/string.h git mv src/utilstring.cpp src/util/string.cpp gsed -i 's/<util\.h>/<util\/system\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') gsed -i 's/<utilmemory\.h>/<util\/memory\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') gsed -i 's/<utilmoneystr\.h>/<util\/moneystr\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') gsed -i 's/<utilstrencodings\.h>/<util\/strencodings\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') gsed -i 's/<utiltime\.h>/<util\/time\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') gsed -i 's/<utilasmap\.h>/<util\/asmap\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') gsed -i 's/<utilstring\.h>/<util\/string\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') gsed -i 's/BITCOIN_UTIL_H/BITCOIN_UTIL_SYSTEM_H/g' src/util/system.h gsed -i 's/BITCOIN_UTILMEMORY_H/BITCOIN_UTIL_MEMORY_H/g' src/util/memory.h gsed -i 's/BITCOIN_UTILMONEYSTR_H/BITCOIN_UTIL_MONEYSTR_H/g' src/util/moneystr.h gsed -i 's/BITCOIN_UTILSTRENCODINGS_H/BITCOIN_UTIL_STRENCODINGS_H/g' src/util/strencodings.h gsed -i 's/BITCOIN_UTILTIME_H/BITCOIN_UTIL_TIME_H/g' src/util/time.h gsed -i 's/BITCOIN_UTILASMAP_H/BITCOIN_UTIL_ASMAP_H/g' src/util/asmap.h gsed -i 's/BITCOIN_UTILSTRING_H/BITCOIN_UTIL_STRING_H/g' src/util/string.h gsed -i 's/ util\.\(h\|cpp\)/ util\/system\.\1/g' src/Makefile.am gsed -i 's/utilmemory\.\(h\|cpp\)/util\/memory\.\1/g' src/Makefile.am gsed -i 's/utilmoneystr\.\(h\|cpp\)/util\/moneystr\.\1/g' src/Makefile.am gsed -i 's/utilstrencodings\.\(h\|cpp\)/util\/strencodings\.\1/g' src/Makefile.am gsed -i 's/utiltime\.\(h\|cpp\)/util\/time\.\1/g' src/Makefile.am gsed -i 's/utilasmap\.\(h\|cpp\)/util\/asmap\.\1/g' src/Makefile.am gsed -i 's/utilstring\.\(h\|cpp\)/util\/string\.\1/g' src/Makefile.am gsed -i 's/-> util ->/-> util\/system ->/' test/lint/lint-circular-dependencies.sh gsed -i 's/src\/util\.cpp/src\/util\/system\.cpp/g' test/lint/lint-format-strings.py test/lint/lint-locale-dependence.sh gsed -i 's/src\/utilmoneystr\.cpp/src\/util\/moneystr\.cpp/g' test/lint/lint-locale-dependence.sh gsed -i 's/src\/utilstrencodings\.\(h\|cpp\)/src\/util\/strencodings\.\1/g' test/lint/lint-locale-dependence.sh ------------- END SCRIPT ---------------
2021-06-27 08:33:13 +02:00
#include <util/system.h>
#include <util/underlying.h>
#include <versionbits.h>
Backport 11651 (#3358) * scripted-diff: Replace #include "" with #include <> (ryanofsky) -BEGIN VERIFY SCRIPT- for f in \ src/*.cpp \ src/*.h \ src/bench/*.cpp \ src/bench/*.h \ src/compat/*.cpp \ src/compat/*.h \ src/consensus/*.cpp \ src/consensus/*.h \ src/crypto/*.cpp \ src/crypto/*.h \ src/crypto/ctaes/*.h \ src/policy/*.cpp \ src/policy/*.h \ src/primitives/*.cpp \ src/primitives/*.h \ src/qt/*.cpp \ src/qt/*.h \ src/qt/test/*.cpp \ src/qt/test/*.h \ src/rpc/*.cpp \ src/rpc/*.h \ src/script/*.cpp \ src/script/*.h \ src/support/*.cpp \ src/support/*.h \ src/support/allocators/*.h \ src/test/*.cpp \ src/test/*.h \ src/wallet/*.cpp \ src/wallet/*.h \ src/wallet/test/*.cpp \ src/wallet/test/*.h \ src/zmq/*.cpp \ src/zmq/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT- Signed-off-by: Pasta <pasta@dashboost.org> * scripted-diff: Replace #include "" with #include <> (Dash Specific) -BEGIN VERIFY SCRIPT- for f in \ src/bls/*.cpp \ src/bls/*.h \ src/evo/*.cpp \ src/evo/*.h \ src/governance/*.cpp \ src/governance/*.h \ src/llmq/*.cpp \ src/llmq/*.h \ src/masternode/*.cpp \ src/masternode/*.h \ src/privatesend/*.cpp \ src/privatesend/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT- Signed-off-by: Pasta <pasta@dashboost.org> * build: Remove -I for everything but project root Remove -I from build system for everything but the project root, and built-in dependencies. Signed-off-by: Pasta <pasta@dashboost.org> # Conflicts: # src/Makefile.test.include * qt: refactor: Use absolute include paths in .ui files * qt: refactor: Changes to make include paths absolute This makes all include paths in the GUI absolute. Many changes are involved as every single source file in src/qt/ assumes to be able to use relative includes. Signed-off-by: Pasta <pasta@dashboost.org> # Conflicts: # src/qt/dash.cpp # src/qt/optionsmodel.cpp # src/qt/test/rpcnestedtests.cpp * test: refactor: Use absolute include paths for test data files * Recommend #include<> syntax in developer notes * refactor: Include obj/build.h instead of build.h * END BACKPORT #11651 Remove trailing whitespace causing travis failure * fix backport 11651 Signed-off-by: Pasta <pasta@dashboost.org> * More of 11651 * fix blockchain.cpp Signed-off-by: pasta <pasta@dashboost.org> * Add missing "qt/" in includes * Add missing "test/" in includes * Fix trailing whitespaces Co-authored-by: Wladimir J. van der Laan <laanwj@gmail.com> Co-authored-by: Russell Yanofsky <russ@yanofsky.org> Co-authored-by: MeshCollider <dobsonsa68@gmail.com> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2020-03-19 23:46:56 +01:00
#include <arith_uint256.h>
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
2014-08-28 22:56:53 +02:00
#include <assert.h>
static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
{
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));
txNew.vout[0].nValue = genesisReward;
txNew.vout[0].scriptPubKey = genesisOutputScript;
CBlock genesis;
genesis.nTime = nTime;
genesis.nBits = nBits;
genesis.nNonce = nNonce;
genesis.nVersion = nVersion;
genesis.vtx.push_back(MakeTransactionRef(std::move(txNew)));
genesis.hashPrevBlock.SetNull();
genesis.hashMerkleRoot = BlockMerkleRoot(genesis);
return genesis;
}
static CBlock CreateDevNetGenesisBlock(const uint256 &prevBlockHash, const std::string& devNetName, uint32_t nTime, uint32_t nNonce, uint32_t nBits, const CAmount& genesisReward)
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
{
assert(!devNetName.empty());
CMutableTransaction txNew;
txNew.nVersion = 1;
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
txNew.vin.resize(1);
txNew.vout.resize(1);
// put height (BIP34) and devnet name into coinbase
txNew.vin[0].scriptSig = CScript() << 1 << std::vector<unsigned char>(devNetName.begin(), devNetName.end());
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
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;
genesis.nVersion = 4;
genesis.vtx.push_back(MakeTransactionRef(std::move(txNew)));
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
genesis.hashPrevBlock = prevBlockHash;
genesis.hashMerkleRoot = BlockMerkleRoot(genesis);
return genesis;
}
/**
* Build the genesis block. Note that the output of its generation
* transaction cannot be spent since it did not originally exist in the
* database.
*
* CBlock(hash=00000ffd590b14, ver=1, hashPrevBlock=00000000000000, hashMerkleRoot=e0028e, nTime=1390095618, nBits=1e0ffff0, nNonce=28917698, vtx=1)
* CTransaction(hash=e0028e, ver=1, vin.size=1, vout.size=1, nLockTime=0)
* CTxIn(COutPoint(000000, -1), coinbase 04ffff001d01044c5957697265642030392f4a616e2f3230313420546865204772616e64204578706572696d656e7420476f6573204c6976653a204f76657273746f636b2e636f6d204973204e6f7720416363657074696e6720426974636f696e73)
* CTxOut(nValue=50.00000000, scriptPubKey=0xA9037BAC7050C479B121CF)
* vMerkleTree: e0028e
*/
static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
{
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;
return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward);
}
static CBlock FindDevNetGenesisBlock(const CBlock &prevBlock, const CAmount& reward)
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
{
std::string devNetName = gArgs.GetDevNetName();
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
assert(!devNetName.empty());
CBlock block = CreateDevNetGenesisBlock(prevBlock.GetHash(), devNetName, prevBlock.nTime + 1, 0, prevBlock.nBits, reward);
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
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);
}
bool CChainParams::IsValidMNActivation(int nBit, int64_t timePast) const
{
assert(nBit < VERSIONBITS_NUM_BITS);
for (int index = 0; index < Consensus::MAX_VERSION_BITS_DEPLOYMENTS; ++index) {
if (consensus.vDeployments[index].bit == nBit) {
auto& deployment = consensus.vDeployments[index];
if (timePast > deployment.nTimeout || timePast < deployment.nStartTime) {
LogPrintf("%s: activation by bit=%d deployment='%s' is out of time range start=%lld timeout=%lld\n", __func__, nBit, VersionBitsDeploymentInfo[Consensus::DeploymentPos(index)].name, deployment.nStartTime, deployment.nTimeout);
continue;
}
if (!deployment.useEHF) {
LogPrintf("%s: trying to set MnEHF for non-masternode activation fork bit=%d\n", __func__, nBit);
return false;
}
LogPrintf("%s: set MnEHF for bit=%d is valid\n", __func__, nBit);
return true;
}
}
LogPrintf("%s: WARNING: unknown MnEHF fork bit=%d\n", __func__, nBit);
return true;
}
void CChainParams::AddLLMQ(Consensus::LLMQType llmqType)
{
assert(!GetLLMQ(llmqType).has_value());
for (const auto& llmq_param : Consensus::available_llmqs) {
if (llmq_param.type == llmqType) {
consensus.llmqs.push_back(llmq_param);
return;
}
}
error("CChainParams::%s: unknown LLMQ type %d", __func__, static_cast<uint8_t>(llmqType));
assert(false);
}
std::optional<Consensus::LLMQParams> CChainParams::GetLLMQ(Consensus::LLMQType llmqType) const
{
for (const auto& llmq_param : consensus.llmqs) {
if (llmq_param.type == llmqType) {
return std::make_optional(llmq_param);
}
}
return std::nullopt;
}
/**
* Main network on which people trade goods and services.
*/
class CMainParams : public CChainParams {
public:
CMainParams() {
strNetworkID = CBaseChainParams::MAIN;
consensus.nSubsidyHalvingInterval = 210240; // Note: actual number of blocks per calendar year with DGW v3 is ~200700 (for example 449750 - 249050)
consensus.BIP16Height = 0;
consensus.nMasternodePaymentsStartBlock = 100000; // not true, but it's ok as long as it's less then nMasternodePaymentsIncreaseBlock
consensus.nMasternodePaymentsIncreaseBlock = 158000; // actual historical value
consensus.nMasternodePaymentsIncreasePeriod = 576*30; // 17280 - actual historical value
consensus.nInstantSendConfirmationsRequired = 6;
consensus.nInstantSendKeepLock = 24;
consensus.nBudgetPaymentsStartBlock = 328008; // actual historical value
consensus.nBudgetPaymentsCycleBlocks = 16616; // ~(60*24*30)/2.6, actual number of blocks per month is 200700 / 12 = 16725
consensus.nBudgetPaymentsWindowBlocks = 100;
consensus.nSuperblockStartBlock = 614820; // The block at which 12.1 goes live (end of final 12.0 budget cycle)
consensus.nSuperblockStartHash = uint256S("0000000000020cb27c7ef164d21003d5d20cdca2f54dd9a9ca6d45f4d47f8aa3");
consensus.nSuperblockCycle = 16616; // ~(60*24*30)/2.6, actual number of blocks per month is 200700 / 12 = 16725
consensus.nSuperblockMaturityWindow = 1662; // ~(60*24*3)/2.6, ~3 days before actual Superblock is emitted
consensus.nGovernanceMinQuorum = 10;
consensus.nGovernanceFilterElements = 20000;
consensus.nMasternodeMinimumConfirmations = 15;
consensus.BIP34Height = 951;
consensus.BIP34Hash = uint256S("0x000001f35e70f7c5705f64c6c5cc3dea9449e74d5b5c7cf74dad1bcca14a8012");
consensus.BIP65Height = 619382; // 00000000000076d8fcea02ec0963de4abfd01e771fec0863f960c2c64fe6f357
consensus.BIP66Height = 245817; // 00000000000b1fa2dfa312863570e13fae9ca7b5566cb27e55422620b469aefa
consensus.BIP147Height = 939456; // 00000000000000117befca4fab5622514772f608852e5edd8df9c55464b6fe37
Merge #16060: Bury bip9 deployments e78aaf41f43d0e2ad78fa6d8dad61032c8ef73d0 [docs] Add release notes for burying bip 9 soft fork deployments (John Newbery) 8319e738f9f118025b332e4fa804d4c31e4113f4 [tests] Add coverage for the content of getblockchaininfo.softforks (James O'Beirne) 0328dcdcfcb56dc8918697716d7686be048ad0b3 [Consensus] Bury segwit deployment (John Newbery) 1c93b9b31c2ab7358f9d55f52dd46340397c906d [Consensus] Bury CSV deployment height (John Newbery) 3862e473f0cb71a762c0306b171b591341d58142 [rpc] Tidy up reporting of buried and ongoing softforks (John Newbery) Pull request description: This hardcodes CSV and segwit activation heights, similar to the BIP 90 buried deployments for BIPs 34, 65 and 66. CSV and segwit have been active for over 18 months. Hardcoding the activation height is a code simplification, makes it easier to understand segwit activation status, and reduces technical debt. This was originally attempted by jl2012 in #11398 and again by me in #12360. ACKs for top commit: ajtowns: ACK e78aaf41f43d0e2ad78fa6d8dad61032c8ef73d0 ; checked diff to previous acked commit, checked tests still work ariard: ACK e78aaf4, check diff, run the tests again and successfully activated csv/segwit heights on mainnet as expected. MarcoFalke: ACK e78aaf41f43d0e2ad78fa6d8dad61032c8ef73d0 (still didn't check if the mainnet block heights are correct, but the code looks good now) Tree-SHA512: 7e951829106e21a81725f7d3e236eddbb59349189740907bb47e33f5dbf95c43753ac1231f47ae7bee85c8c81b2146afcdfdc11deb1503947f23093a9c399912
2019-08-15 22:02:02 +02:00
consensus.CSVHeight = 622944; // 00000000000002e3d3a6224cfce80bae367fd3283d1e5a8ba50e5e60b2d2905d
consensus.DIP0001Height = 782208; // 000000000000000cbc9cb551e8ee1ac7aa223585cbdfb755d3683bafd93679e4
consensus.DIP0003Height = 1028160;
consensus.DIP0003EnforcementHeight = 1047200;
consensus.DIP0003EnforcementHash = uint256S("000000000000002d1734087b4c5afc3133e4e1c3e1a89218f62bcd9bb3d17f81");
consensus.DIP0008Height = 1088640; // 00000000000000112e41e4b3afda8b233b8cc07c532d2eac5de097b68358c43e
2022-03-14 22:40:01 +01:00
consensus.BRRHeight = 1374912; // 000000000000000c5a124f3eccfbe6e17876dca79cec9e63dfa70d269113c926
consensus.DIP0020Height = 1516032; // 000000000000000f64ed3bd9af1078177ac026f6aa2677aa4d8beeae43be56cc
consensus.DIP0024Height = 1737792; // 0000000000000001342be9c0b75ad40c276beaad91616423c4d9cb101b3db438
consensus.DIP0024QuorumsHeight = 1738698; // 000000000000001aa25181e4c466e593992c98f9eb21c69ee757b8bb0af50244
consensus.V19Height = 1899072; // 0000000000000015e32e73052d663626327004c81c5c22cb8b42c361015c0eae
consensus.MinBIP9WarningHeight = 1899072 + 2016; // V19 activation height + miner confirmation window
A pack of small fixes (#1992) * Make sure gobject collateral was mined `CGovernanceObject::IsCollateralValid()` would still fail for non-mined collateral later trying to check confirmations * Fix powLimit for mainnet/testnet That's a legacy thing, slightly rising it to match the actual bit-shifted value has no effect because real values are already lower. Also clarify values for all networks in comments. * Check for script addresses in CSuperblock::ParsePaymentSchedule() Sentinel should already be downvoting such triggers if they would exist, no need to store/relay them. * Do not process already known valid vote twice in CGovernanceObject::ProcessVote() This should be handled by `CGovernanceManager::ProcessVote()` but imo it's better to have this at the `CGovernanceObject::ProcessVote()` level as well. * Make sure CGovernanceObjectVoteFile::AddVote() never adds/updates already known votes The way `CGovernanceObjectVoteFile::AddVote()` is used (i.e. wrapped in `CGovernanceObjectVoteFile::HasVote()` condition) it's already the case. Hoever nothing would guarantee consistency if it would be used elsewhere without such wrapper, so it's better to have similar check inside. * Do not even try mnb recovery when -connect is set `CConnman::ThreadOpenMasternodeConnections()` thread won't even start when `-connect` is set, so no need to ask for recovery, there is nothing that is going to be able to process such request. * No need for SIGHASH_ANYONECANPAY in PS collateral signature Collateral is just a normal tx created and signed by each participant individually, there is no need for special sig types. * Release semMasternodeOutbound in CConnman::Interrupt() Re-align Dash code with Bitcoin.
2018-03-19 14:08:32 +01:00
consensus.powLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 20
consensus.nPowTargetTimespan = 24 * 60 * 60; // Dash: 1 day
consensus.nPowTargetSpacing = 2.5 * 60; // Dash: 2.5 minutes
consensus.fPowAllowMinDifficultyBlocks = false;
consensus.fPowNoRetargeting = false;
consensus.nPowKGWHeight = 15200;
consensus.nPowDGWHeight = 34140;
Merge #21377: Speedy trial support for versionbits ffe33dfbd4c3b11e3475b022b6c1dd077613de79 chainparams: drop versionbits threshold to 90% for mainnnet and signet (Anthony Towns) f054f6bcd2c2ce5fea84cf8681013f85a444e7ea versionbits: simplify state transitions (Anthony Towns) 55ac5f568a3b73d6f1ef4654617fb76e8bcbccdf versionbits: Add explicit NEVER_ACTIVE deployments (Anthony Towns) dd07e6da48040dc7eae46bc7941db48d98a669fd fuzz: test versionbits delayed activation (Anthony Towns) dd85d5411c1702c8ae259610fe55050ba212e21e tests: test versionbits delayed activation (Anthony Towns) 73d4a706393e6dbd6b6d6b6428f8d3233ac0a2d8 versionbits: Add support for delayed activation (Anthony Towns) 9e6b65f6fa205eee5c3b99343988adcb8d320460 tests: clean up versionbits test (Anthony Towns) 593274445004506c921d5d851361aefb3434d744 tests: test ComputeBlockVersion for all deployments (Anthony Towns) 63879f0a4760c0c0f784029849cb5d21ee088abb tests: pull ComputeBlockVersion test into its own function (Anthony Towns) Pull request description: BIP9-based implementation of "speedy trial" activation specification, see https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018583.html Edge cases are tested by fuzzing added in #21380. ACKs for top commit: instagibbs: tACK https://github.com/bitcoin/bitcoin/pull/21377/commits/ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jnewbery: utACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 MarcoFalke: review ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 💈 achow101: re-ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 gmaxwell: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 benthecarman: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 Sjors: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jonatack: Initial approach ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 after a first pass of review, building and testing each commit, mostly looking at the changes and diffs. Will do a more high-level review iteration. A few minor comments follow to pick/choose/ignore. ariard: Code Review ACK ffe33df Tree-SHA512: f79a7146b2450057ee92155cbbbcec12cd64334236d9239c6bd7d31b32eec145a9781c320f178da7b44ababdb8808b84d9d22a40e0851e229ba6d224e3be747c
2021-04-15 03:33:47 +02:00
consensus.nRuleChangeActivationThreshold = 1815; // 90% of 2016
consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
2016-03-09 22:00:53 +01:00
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
Merge #21377: Speedy trial support for versionbits ffe33dfbd4c3b11e3475b022b6c1dd077613de79 chainparams: drop versionbits threshold to 90% for mainnnet and signet (Anthony Towns) f054f6bcd2c2ce5fea84cf8681013f85a444e7ea versionbits: simplify state transitions (Anthony Towns) 55ac5f568a3b73d6f1ef4654617fb76e8bcbccdf versionbits: Add explicit NEVER_ACTIVE deployments (Anthony Towns) dd07e6da48040dc7eae46bc7941db48d98a669fd fuzz: test versionbits delayed activation (Anthony Towns) dd85d5411c1702c8ae259610fe55050ba212e21e tests: test versionbits delayed activation (Anthony Towns) 73d4a706393e6dbd6b6d6b6428f8d3233ac0a2d8 versionbits: Add support for delayed activation (Anthony Towns) 9e6b65f6fa205eee5c3b99343988adcb8d320460 tests: clean up versionbits test (Anthony Towns) 593274445004506c921d5d851361aefb3434d744 tests: test ComputeBlockVersion for all deployments (Anthony Towns) 63879f0a4760c0c0f784029849cb5d21ee088abb tests: pull ComputeBlockVersion test into its own function (Anthony Towns) Pull request description: BIP9-based implementation of "speedy trial" activation specification, see https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018583.html Edge cases are tested by fuzzing added in #21380. ACKs for top commit: instagibbs: tACK https://github.com/bitcoin/bitcoin/pull/21377/commits/ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jnewbery: utACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 MarcoFalke: review ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 💈 achow101: re-ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 gmaxwell: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 benthecarman: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 Sjors: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jonatack: Initial approach ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 after a first pass of review, building and testing each commit, mostly looking at the changes and diffs. Will do a more high-level review iteration. A few minor comments follow to pick/choose/ignore. ariard: Code Review ACK ffe33df Tree-SHA512: f79a7146b2450057ee92155cbbbcec12cd64334236d9239c6bd7d31b32eec145a9781c320f178da7b44ababdb8808b84d9d22a40e0851e229ba6d224e3be747c
2021-04-15 03:33:47 +02:00
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = Consensus::BIP9Deployment::NEVER_ACTIVE;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].min_activation_height = 0; // No activation delay
consensus.vDeployments[Consensus::DEPLOYMENT_V20].bit = 9;
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nStartTime = 1700006400; // November 15, 2023
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nTimeout = 1731628800; // November 15, 2024
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nWindowSize = 4032;
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nThresholdStart = 3226; // 80% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nThresholdMin = 2420; // 60% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nFalloffCoeff = 5; // this corresponds to 10 periods
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].bit = 10;
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nStartTime = 1704067200; // January 1, 2024
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nTimeout = 1767225600; // January 1, 2026
// NOTE: nWindowSize for MN_RR __MUST__ be greater than or equal to nSuperblockMaturityWindow for CSuperblock::GetPaymentsLimit() to work correctly
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nWindowSize = 4032;
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nThresholdStart = 3226; // 80% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nThresholdMin = 2420; // 60% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nFalloffCoeff = 5; // this corresponds to 10 periods
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].useEHF = true;
Backport "assumed valid blocks" feature from Bitcoin 0.13 (#1582) * IBD check uses minimumchain work instead of checkpoints. This introduces a 'minimum chain work' chainparam which is intended to be the known amount of work in the chain for the network at the time of software release. If you don't have this much work, you're not yet caught up. This is used instead of the count of blocks test from checkpoints. This criteria is trivial to keep updated as there is no element of subjectivity, trust, or position dependence to it. It is also a more reliable metric of sync status than a block count. * Remove GetTotalBlocksEstimate and checkpoint tests that test nothing. GetTotalBlocksEstimate is no longer used and it was the only thing the checkpoint tests were testing. Since checkpoints are on their way out it makes more sense to remove the test file than to cook up a new pointless test. # Conflicts: # src/Makefile.test.include # src/test/Checkpoints_tests.cpp * IsInitialBlockDownload no longer uses header-only timestamps. This avoids a corner case (mostly visible on testnet) where bogus headers can keep nodes in IsInitialBlockDownload. * Delay parallel block download until chain has sufficient work nMinimumChainWork is an anti-DoS threshold; wait until we have a proposed tip with more work than that before downloading blocks towards that tip. * Add timeout for headers sync At startup, we choose one peer to serve us the headers chain, until our best header is close to caught up. Disconnect this peer if more than 15 minutes + 1ms/expected_header passes and our best header is still more than 1 day away from current time. * Introduce assumevalid setting to skip presumed valid scripts. This disentangles the script validation skipping from checkpoints. A new option is introduced "assumevalid" which specifies a block whos ancestors we assume all have valid scriptsigs and so we do not check them when they are also burried under the best header by two weeks worth of work. Unlike checkpoints this has no influence on consensus unless you set it to a block with an invalid history. Because of this it can be easily be updated without risk of influencing the network consensus. This results in a massive IBD speedup. This approach was independently recommended by Peter Todd and Luke-Jr since POW based signature skipping (see PR#9180) does not have the verifiable properties of a specific hash and may create bad incentives. The downside is that, like checkpoints, the defaults bitrot and older releases will sync slower. On the plus side users can provide their own value here, and if they set it to something crazy all that will happen is more time will be spend validating signatures. Checkblocks and checklevel are also moved to the hidden debug options: Especially now that checkblocks has a low default there is little need to change these settings, and users frequently misunderstand them as influencing security or IBD speed. By hiding them we offset the space added by this new option. * Add consensusParams to FindNextBlocksToDownload * Adjust check in headers timeout logic to align with 144 blocks in Dash
2017-08-23 16:21:08 +02:00
// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000988117deadb0db9cd5b8"); // 2109672
Backport "assumed valid blocks" feature from Bitcoin 0.13 (#1582) * IBD check uses minimumchain work instead of checkpoints. This introduces a 'minimum chain work' chainparam which is intended to be the known amount of work in the chain for the network at the time of software release. If you don't have this much work, you're not yet caught up. This is used instead of the count of blocks test from checkpoints. This criteria is trivial to keep updated as there is no element of subjectivity, trust, or position dependence to it. It is also a more reliable metric of sync status than a block count. * Remove GetTotalBlocksEstimate and checkpoint tests that test nothing. GetTotalBlocksEstimate is no longer used and it was the only thing the checkpoint tests were testing. Since checkpoints are on their way out it makes more sense to remove the test file than to cook up a new pointless test. # Conflicts: # src/Makefile.test.include # src/test/Checkpoints_tests.cpp * IsInitialBlockDownload no longer uses header-only timestamps. This avoids a corner case (mostly visible on testnet) where bogus headers can keep nodes in IsInitialBlockDownload. * Delay parallel block download until chain has sufficient work nMinimumChainWork is an anti-DoS threshold; wait until we have a proposed tip with more work than that before downloading blocks towards that tip. * Add timeout for headers sync At startup, we choose one peer to serve us the headers chain, until our best header is close to caught up. Disconnect this peer if more than 15 minutes + 1ms/expected_header passes and our best header is still more than 1 day away from current time. * Introduce assumevalid setting to skip presumed valid scripts. This disentangles the script validation skipping from checkpoints. A new option is introduced "assumevalid" which specifies a block whos ancestors we assume all have valid scriptsigs and so we do not check them when they are also burried under the best header by two weeks worth of work. Unlike checkpoints this has no influence on consensus unless you set it to a block with an invalid history. Because of this it can be easily be updated without risk of influencing the network consensus. This results in a massive IBD speedup. This approach was independently recommended by Peter Todd and Luke-Jr since POW based signature skipping (see PR#9180) does not have the verifiable properties of a specific hash and may create bad incentives. The downside is that, like checkpoints, the defaults bitrot and older releases will sync slower. On the plus side users can provide their own value here, and if they set it to something crazy all that will happen is more time will be spend validating signatures. Checkblocks and checklevel are also moved to the hidden debug options: Especially now that checkblocks has a low default there is little need to change these settings, and users frequently misunderstand them as influencing security or IBD speed. By hiding them we offset the space added by this new option. * Add consensusParams to FindNextBlocksToDownload * Adjust check in headers timeout logic to align with 144 blocks in Dash
2017-08-23 16:21:08 +02:00
// By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("0x000000000000001889bd33ef019065e250d32bd46911f4003d3fdd8128b5358d"); // 2109672
Backport "assumed valid blocks" feature from Bitcoin 0.13 (#1582) * IBD check uses minimumchain work instead of checkpoints. This introduces a 'minimum chain work' chainparam which is intended to be the known amount of work in the chain for the network at the time of software release. If you don't have this much work, you're not yet caught up. This is used instead of the count of blocks test from checkpoints. This criteria is trivial to keep updated as there is no element of subjectivity, trust, or position dependence to it. It is also a more reliable metric of sync status than a block count. * Remove GetTotalBlocksEstimate and checkpoint tests that test nothing. GetTotalBlocksEstimate is no longer used and it was the only thing the checkpoint tests were testing. Since checkpoints are on their way out it makes more sense to remove the test file than to cook up a new pointless test. # Conflicts: # src/Makefile.test.include # src/test/Checkpoints_tests.cpp * IsInitialBlockDownload no longer uses header-only timestamps. This avoids a corner case (mostly visible on testnet) where bogus headers can keep nodes in IsInitialBlockDownload. * Delay parallel block download until chain has sufficient work nMinimumChainWork is an anti-DoS threshold; wait until we have a proposed tip with more work than that before downloading blocks towards that tip. * Add timeout for headers sync At startup, we choose one peer to serve us the headers chain, until our best header is close to caught up. Disconnect this peer if more than 15 minutes + 1ms/expected_header passes and our best header is still more than 1 day away from current time. * Introduce assumevalid setting to skip presumed valid scripts. This disentangles the script validation skipping from checkpoints. A new option is introduced "assumevalid" which specifies a block whos ancestors we assume all have valid scriptsigs and so we do not check them when they are also burried under the best header by two weeks worth of work. Unlike checkpoints this has no influence on consensus unless you set it to a block with an invalid history. Because of this it can be easily be updated without risk of influencing the network consensus. This results in a massive IBD speedup. This approach was independently recommended by Peter Todd and Luke-Jr since POW based signature skipping (see PR#9180) does not have the verifiable properties of a specific hash and may create bad incentives. The downside is that, like checkpoints, the defaults bitrot and older releases will sync slower. On the plus side users can provide their own value here, and if they set it to something crazy all that will happen is more time will be spend validating signatures. Checkblocks and checklevel are also moved to the hidden debug options: Especially now that checkblocks has a low default there is little need to change these settings, and users frequently misunderstand them as influencing security or IBD speed. By hiding them we offset the space added by this new option. * Add consensusParams to FindNextBlocksToDownload * Adjust check in headers timeout logic to align with 144 blocks in Dash
2017-08-23 16:21:08 +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.
*/
pchMessageStart[0] = 0xbf;
pchMessageStart[1] = 0x0c;
pchMessageStart[2] = 0x6b;
pchMessageStart[3] = 0xbd;
nDefaultPort = 9999;
nDefaultPlatformP2PPort = 26656;
nDefaultPlatformHTTPPort = 443;
nPruneAfterHeight = 100000;
m_assumed_blockchain_size = 45;
m_assumed_chain_state_size = 1;
genesis = CreateGenesisBlock(1390095618, 28917698, 0x1e0ffff0, 1, 50 * COIN);
consensus.hashGenesisBlock = genesis.GetHash();
assert(consensus.hashGenesisBlock == uint256S("0x00000ffd590b1485b3caadc19b22e6379c733355108f107a430458cdf3407ab6"));
assert(genesis.hashMerkleRoot == uint256S("0xe0028eb9648db56b1ac77cf090b99048a8007e2bb64b68f092c03c7f56a662c7"));
// Note that of those which support the service bits prefix, most only support a subset of
// possible options.
Merge #19316: [net] Cleanup logic around connection types 01e283068b9e6214f2d77a2f772a4244ebfe2274 [net] Remove unnecessary default args on CNode constructor (Amiti Uttarwar) bc5d65b3ca41eebb1738fdda4451d1466e77772e [refactor] Remove IsOutboundDisconnectionCandidate (Amiti Uttarwar) 2f2e13b6c2c8741ca9d825eaaef736ede484bc85 [net/refactor] Simplify multiple-connection checks (Amiti Uttarwar) 7f7b83deb2427599c129f4ff581d4d045461e459 [net/refactor] Rework ThreadOpenConnections logic (Amiti Uttarwar) 35839e963bf61d2da0d12f5b8cea74ac0e0fbd7b [net] Fix bug where AddrFetch connections would be counted as outbound full relay (Amiti Uttarwar) 4972c21b671ff73f13a1b5053338b6abbdb471b5 [net/refactor] Clarify logic for selecting connections in ThreadOpenConnections (Amiti Uttarwar) 60156f5fc40d56bb532278f16ce632c5a8b8035e [net/refactor] Remove fInbound flag from CNode (Amiti Uttarwar) 7b322df6296609570e368e5f326979279041c11f [net/refactor] Remove m_addr_fetch member var from CNode (Amiti Uttarwar) 14923422b08ac4b21b35c426bf0e1b9e7c97983b [net/refactor] Remove fFeeler flag from CNode (Amiti Uttarwar) 49efac5cae7333c6700d9b737d09fae0f3f4d7fa [net/refactor] Remove m_manual_connection flag from CNode (Amiti Uttarwar) d3698b5ee309cf0f0cdfb286d6b30a256d7deae5 [net/refactor] Add connection type as a member var to CNode (Amiti Uttarwar) 46578c03e92a55925308363ccdad04dcfc820d96 [doc] Describe different connection types (Amiti Uttarwar) 442abae2bac7bff85886143df01e14215532b974 [net/refactor] Add AddrFetch connections to ConnectionType enum (Amiti Uttarwar) af59feb05235ecb85ec9d75b09c66e71268c9889 [net/refactor] Extract m_addr_known logic from initializer list (Amiti Uttarwar) e1bc29812ddf1d946bc5acca406a7ed2dca064a6 [net/refactor] Add block relay only connections to ConnectionType enum (Amiti Uttarwar) 0e52a659a2de915fc3dce37fc8fac39be1c8b6fa [net/refactor] Add feeler connections to ConnectionType enum (Amiti Uttarwar) 1521c47438537e192230486dffcec0228a53878d [net/refactor] Add manual connections to ConnectionType enum (Amiti Uttarwar) 26304b4100201754fb32440bec3e3b78cd3f0e6d [net/refactor] Introduce an enum to distinguish type of connection (Amiti Uttarwar) 3f1b7140e95d0f8f958cb35f31c3d964c57e484d scripted-diff: Rename OneShot to AddrFetch (Amiti Uttarwar) Pull request description: **This is part 1 of #19315, which enables the ability to test `outbound` and `block-relay-only` connections from the functional tests.** Please see that PR for more information of overall functionality. **This PR simplifies how we manage different connection types.** It introduces an enum with the various types of connections so we can explicitly define the connection type. The existing system relies on a series of independent flags, then has asserts scattered around to ensure that conflicting flags are not enabled at the same time. I find this approach to be both brittle and confusing. While making these changes, I found a small bug due to the silent assumptions. This PR also proposes a rename from `OneShot` to `AddrFetch`. I find the name `OneShot` to be very confusing, especially when we also have `onetry` manual connections. Everyone I've talked to offline has agreed that the name is confusing, so I propose a potential alternative. I think this is a good opportunity for a rename since I'm creating an enum to explicitly define the connection types. (some context for the unfamiliar: `oneshot` or `addrfetch` connections are short-lived connections created on startup. They connect to the seed peers, send a `getaddr` to solicit addresses, then close the connection.) Overview of this PR: * rename `oneshot` to `addrfetch` * introduce `ConnectionType` enum * one by one, add different connection types to the enum * expose the `conn_type` on CNode, and use this to reduce reliance on flags (& asserts) * fix the bug in counting different type of connections * some additional cleanup to simplify logic and make expectations explicit/inclusive rather than implicit/exclusive. ACKs for top commit: jnewbery: utACK 01e283068b9e6214f2d77a2f772a4244ebfe2274 laanwj: Code review ACK 01e283068b9e6214f2d77a2f772a4244ebfe2274, the commits are pretty straightforward to follow, and I think this is a move in the right direction overall vasild: ACK 01e283068 sdaftuar: ACK 01e283068b9e6214f2d77a2f772a4244ebfe2274. fanquake: ACK 01e283068b9e6214f2d77a2f772a4244ebfe2274 - I don't have as much experience with the networking code but these changes look fairly straight forward, the new code seems more robust/understandable and the additional documentation is great. I'm glad that a followup branch is already underway. There might be some more review comments here later today, so keep an eye on the discussion, however I'm going to merge this now. jb55: wow this code was messy before... ACK 01e283068b9e6214f2d77a2f772a4244ebfe2274 Tree-SHA512: 7bb644a6ed5849913d777ebc2ff89133ca0fbef680355a9a344e07496a979e6f9ff21a958e8eea93dcd7d5c343682b0c7174b1a3de380a4247eaae73da436e15
2020-08-12 03:41:24 +02:00
// This is fine at runtime as we'll fall back to using them as an addrfetch if they don't support the
// 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");
// 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);
// Dash BIP32 pubkeys start with 'xpub' (Bitcoin defaults)
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E};
// Dash BIP32 prvkeys start with 'xprv' (Bitcoin defaults)
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4};
HD wallet (#1405) * HD wallet Minimal set of changes (no refactoring) backported from Bitcoin upstream to make HD wallets work in Dash 0.12.1.x+ * minimal bip44 (hardcoded account and change) * minimal bip39 Additional cmd-line options for new wallet: -mnemonic -mnemonicpassphrase * Do not recreate HD wallet on encryption Adjusted keypool.py test * Do not store any private keys for hd wallet besides the master one Derive all keys on the fly. Original idea/implementation - btc PR9298, backported and improved * actually use bip39 * pbkdf2 test * backport wallet-hd.py test * Allow specifying hd seed, add dumphdseed rpc, fix bugs - -hdseed cmd-line param to specify HD seed on wallet creation - dumphdseed rpc to dump HD seed - allow seed of any size - fix dumpwallet rpc bug (wasn't decrypting HD seed) - print HD seed and extended public masterkey on dumpwallet * top up keypool on HD wallet encryption * split HD chain: external/internal * add missing cs_wallet lock in init.cpp * fix `const char *` issues (use strings) * default mnemonic passphrase is an empty string in all cases * store mnemonic/mnemonicpassphrase replace dumphdseed with dumphdinfo * Add fCrypted flag to CHDChain * prepare internal structures for multiple HD accounts (plus some code cleanup) * use secure allocator for storing sensitive HD data * use secure strings for mnemonic(passphrase) * small fix in GenerateNewHDChain * use 24 words for mnemonic by default * make sure mnemonic passphrase provided by user does not exceed 256 symbols * more usage of secure allocators and memory_cleanse * code cleanup * rename: CSecureVector -> SecureVector * add missing include * fix warning in rpcdump.cpp * refactor mnemonic_check (also fix a bug) * move bip39 functions to CMnemonic * Few fixes for CMnemonic: - use `SecureVector` for data, bits, seed - `Check` should return bool * init vectors with desired size where possible
2017-05-29 13:51:40 +02:00
// Dash BIP44 coin type is '5'
HD wallet (#1405) * HD wallet Minimal set of changes (no refactoring) backported from Bitcoin upstream to make HD wallets work in Dash 0.12.1.x+ * minimal bip44 (hardcoded account and change) * minimal bip39 Additional cmd-line options for new wallet: -mnemonic -mnemonicpassphrase * Do not recreate HD wallet on encryption Adjusted keypool.py test * Do not store any private keys for hd wallet besides the master one Derive all keys on the fly. Original idea/implementation - btc PR9298, backported and improved * actually use bip39 * pbkdf2 test * backport wallet-hd.py test * Allow specifying hd seed, add dumphdseed rpc, fix bugs - -hdseed cmd-line param to specify HD seed on wallet creation - dumphdseed rpc to dump HD seed - allow seed of any size - fix dumpwallet rpc bug (wasn't decrypting HD seed) - print HD seed and extended public masterkey on dumpwallet * top up keypool on HD wallet encryption * split HD chain: external/internal * add missing cs_wallet lock in init.cpp * fix `const char *` issues (use strings) * default mnemonic passphrase is an empty string in all cases * store mnemonic/mnemonicpassphrase replace dumphdseed with dumphdinfo * Add fCrypted flag to CHDChain * prepare internal structures for multiple HD accounts (plus some code cleanup) * use secure allocator for storing sensitive HD data * use secure strings for mnemonic(passphrase) * small fix in GenerateNewHDChain * use 24 words for mnemonic by default * make sure mnemonic passphrase provided by user does not exceed 256 symbols * more usage of secure allocators and memory_cleanse * code cleanup * rename: CSecureVector -> SecureVector * add missing include * fix warning in rpcdump.cpp * refactor mnemonic_check (also fix a bug) * move bip39 functions to CMnemonic * Few fixes for CMnemonic: - use `SecureVector` for data, bits, seed - `Check` should return bool * init vectors with desired size where possible
2017-05-29 13:51:40 +02:00
nExtCoinType = 5;
vFixedSeeds = std::vector<uint8_t>(std::begin(chainparams_seed_main), std::end(chainparams_seed_main));
Implement and enforce DIP6 commitments (#2477) * Add LLMQ parameters to consensus params * Add DIP6 quorum commitment special TX * Implement CQuorumBlockProcessor which validates and handles commitments * Add quorum commitments to new blocks * Propagate QFCOMMITMENT messages to all nodes * Allow special transactions in blocks which have no inputs/outputs But only for TRANSACTION_QUORUM_COMMITMENT for now. * Add quorum commitments to self-crafted blocks in DIP3 tests * Add simple fork logic for current testnet This should avoid a fork on the current testnet. It only applies to the current chain which activated DIP3 at height 264000 and block 00000048e6e71d4bd90e7c456dcb94683ae832fcad13e1760d8283f7e89f332f. When we revert the chain to retest the DIP3 deployment, this fork logic can be removed again. * Use quorumVvecHash instead of quorumHash to make null commitments unique Implementation of https://github.com/dashpay/dips/pull/31 * Re-add quorum commitments after pruning mempool selected blocks * Refactor CQuorumBlockProcessor::ProcessBlock to have less nested if/else statements Also add BEGIN/END markers for temporary code. * Add comments/documentation to LLMQParams * Move code which determines if a commitment is required into IsCommitmentRequired This should make the code easier to read and also removes some duplication. The also changes the error types that are possible from 3 to 2 now. Instead of having "bad-qc-already-mined" and "bad-qc-not-mining-phase", there is only "bad-qc-not-allowed" now. * Use new parameter from consensus parames for the temporary fork
2018-11-23 15:42:09 +01:00
// long living quorum params
AddLLMQ(Consensus::LLMQType::LLMQ_50_60);
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
AddLLMQ(Consensus::LLMQType::LLMQ_60_75);
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;
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
consensus.llmqTypeDIP0024InstantSend = Consensus::LLMQType::LLMQ_60_75;
consensus.llmqTypePlatform = Consensus::LLMQType::LLMQ_100_67;
2021-12-11 21:00:27 +01:00
consensus.llmqTypeMnhf = Consensus::LLMQType::LLMQ_400_85;
Implement and enforce DIP6 commitments (#2477) * Add LLMQ parameters to consensus params * Add DIP6 quorum commitment special TX * Implement CQuorumBlockProcessor which validates and handles commitments * Add quorum commitments to new blocks * Propagate QFCOMMITMENT messages to all nodes * Allow special transactions in blocks which have no inputs/outputs But only for TRANSACTION_QUORUM_COMMITMENT for now. * Add quorum commitments to self-crafted blocks in DIP3 tests * Add simple fork logic for current testnet This should avoid a fork on the current testnet. It only applies to the current chain which activated DIP3 at height 264000 and block 00000048e6e71d4bd90e7c456dcb94683ae832fcad13e1760d8283f7e89f332f. When we revert the chain to retest the DIP3 deployment, this fork logic can be removed again. * Use quorumVvecHash instead of quorumHash to make null commitments unique Implementation of https://github.com/dashpay/dips/pull/31 * Re-add quorum commitments after pruning mempool selected blocks * Refactor CQuorumBlockProcessor::ProcessBlock to have less nested if/else statements Also add BEGIN/END markers for temporary code. * Add comments/documentation to LLMQParams * Move code which determines if a commitment is required into IsCommitmentRequired This should make the code easier to read and also removes some duplication. The also changes the error types that are possible from 3 to 2 now. Instead of having "bad-qc-already-mined" and "bad-qc-not-mining-phase", there is only "bad-qc-not-allowed" now. * Use new parameter from consensus parames for the temporary fork
2018-11-23 15:42:09 +01:00
fDefaultConsistencyChecks = false;
fRequireStandard = true;
fRequireRoutableExternalIP = true;
m_is_test_chain = false;
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
fAllowMultipleAddressesFromGroup = false;
fAllowMultiplePorts = false;
nLLMQConnectionRetryTimeout = 60;
m_is_mockable_chain = false;
2015-04-03 00:51:08 +02:00
nPoolMinParticipants = 3;
nPoolMaxParticipants = 20;
nFulfilledRequestExpireTime = 60*60; // fulfilled requests expire in 1 hour
vSporkAddresses = {"Xgtyuk76vhuFW2iT7UAiHgNdWXCf3J34wh"};
nMinSporkKeys = 1;
checkpointData = {
{
{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")},
{1167570, uint256S("0x000000000000000fb7b1e9b81700283dff0f7d87cf458e5edfdae00c669de661")},
{1364585, uint256S("0x00000000000000022f355c52417fca9b73306958f7c0832b3a7bce006ca369ef")},
{1450000, uint256S("0x00000000000000105cfae44a995332d8ec256850ea33a1f7b700474e3dad82bc")},
chore: update assumevalid for v18.2.0 (#5128) <!-- *** Please remove the following help text before submitting: *** Provide a general summary of your changes in the Title above Pull requests without a rationale and clear improvement may be closed immediately. Please provide clear motivation for your patch and explain how it improves Dash Core user experience or Dash Core developer experience significantly: * Any test improvements or new tests that improve coverage are always welcome. * All other changes should have accompanying unit tests (see `src/test/`) or functional tests (see `test/`). Contributors should note which tests cover modified code. If no tests exist for a region of modified code, new tests should accompany the change. * Bug fixes are most welcome when they come with steps to reproduce or an explanation of the potential issue as well as reasoning for the way the bug was fixed. * Features are welcome, but might be rejected due to design or scope issues. If a feature is based on a lot of dependencies, contributors should first consider building the system outside of Dash Core, if possible. --> ## Issue being fixed or feature implemented <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here. --> ## What was done? <!--- Describe your changes in detail --> ## How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> Hasn't been ## Breaking Changes <!--- Please describe any breaking changes your code introduces --> ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation **For repository code-owners and collaborators only** - [x] I have assigned this pull request to a milestone
2023-01-01 23:02:19 +01:00
{1796500, uint256S("0x000000000000001d531f36005159f19351bd49ca676398a561e55dcccb84eacd")},
{1850400, uint256S("0x00000000000000261bdbe99c01fcba992e577efa6cc41aae564b8ca9f112b2a3")},
{1889000, uint256S("0x00000000000000075300e852d5bf5380f905b2768241f8b442498442084807a7")},
2023-11-11 13:51:47 +01:00
{1969000, uint256S("0x000000000000000c8b7a3bdcd8b9f516462122314529c8342244c685a4c899bf")},
{2029000, uint256S("0x0000000000000020d5e38b6aef5bc8e430029444d7977b46f710c7d281ef1281")},
{2109672, uint256S("0x000000000000001889bd33ef019065e250d32bd46911f4003d3fdd8128b5358d")},
}
};
m_assumeutxo_data = MapAssumeutxo{
// TODO to be specified in a future patch.
};
// getchaintxstats 17280 000000000000001889bd33ef019065e250d32bd46911f4003d3fdd8128b5358d
chainTxData = ChainTxData{
1721769714, // * UNIX timestamp of last known number of transactions (Block 1969000)
53767892, // * total number of transactions between genesis and that timestamp
chore: update assumevalid for v18.2.0 (#5128) <!-- *** Please remove the following help text before submitting: *** Provide a general summary of your changes in the Title above Pull requests without a rationale and clear improvement may be closed immediately. Please provide clear motivation for your patch and explain how it improves Dash Core user experience or Dash Core developer experience significantly: * Any test improvements or new tests that improve coverage are always welcome. * All other changes should have accompanying unit tests (see `src/test/`) or functional tests (see `test/`). Contributors should note which tests cover modified code. If no tests exist for a region of modified code, new tests should accompany the change. * Bug fixes are most welcome when they come with steps to reproduce or an explanation of the potential issue as well as reasoning for the way the bug was fixed. * Features are welcome, but might be rejected due to design or scope issues. If a feature is based on a lot of dependencies, contributors should first consider building the system outside of Dash Core, if possible. --> ## Issue being fixed or feature implemented <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here. --> ## What was done? <!--- Describe your changes in detail --> ## How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> Hasn't been ## Breaking Changes <!--- Please describe any breaking changes your code introduces --> ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation **For repository code-owners and collaborators only** - [x] I have assigned this pull request to a milestone
2023-01-01 23:02:19 +01:00
// (the tx=... number in the ChainStateFlushed debug.log lines)
0.1580795981751139, // * estimated number of transactions per second after that timestamp
};
}
};
/**
* Testnet (v3): public test network which is reset from time to time.
*/
class CTestNetParams : public CChainParams {
public:
CTestNetParams() {
strNetworkID = CBaseChainParams::TESTNET;
consensus.nSubsidyHalvingInterval = 210240;
consensus.BIP16Height = 0;
consensus.nMasternodePaymentsStartBlock = 4010; // not true, but it's ok as long as it's less then nMasternodePaymentsIncreaseBlock
consensus.nMasternodePaymentsIncreaseBlock = 4030;
consensus.nMasternodePaymentsIncreasePeriod = 10;
consensus.nInstantSendConfirmationsRequired = 2;
consensus.nInstantSendKeepLock = 6;
consensus.nBudgetPaymentsStartBlock = 4100;
consensus.nBudgetPaymentsCycleBlocks = 50;
consensus.nBudgetPaymentsWindowBlocks = 10;
consensus.nSuperblockStartBlock = 4200; // NOTE: Should satisfy nSuperblockStartBlock > nBudgetPeymentsStartBlock
consensus.nSuperblockStartHash = uint256(); // do not check this on testnet
consensus.nSuperblockCycle = 24; // Superblocks can be issued hourly on testnet
consensus.nSuperblockMaturityWindow = 8;
consensus.nGovernanceMinQuorum = 1;
consensus.nGovernanceFilterElements = 500;
consensus.nMasternodeMinimumConfirmations = 1;
consensus.BIP34Height = 76;
consensus.BIP34Hash = uint256S("0x000008ebb1db2598e897d17275285767717c6acfeac4c73def49fbea1ddcbcb6");
consensus.BIP65Height = 2431; // 0000039cf01242c7f921dcb4806a5994bc003b48c1973ae0c89b67809c2bb2ab
consensus.BIP66Height = 2075; // 0000002acdd29a14583540cb72e1c5cc83783560e38fa7081495d474fe1671f7
consensus.BIP147Height = 4300; // 0000000040c1480d413c9203664253ab18da284130c329bf88fcfc84312bcbe0
Merge #16060: Bury bip9 deployments e78aaf41f43d0e2ad78fa6d8dad61032c8ef73d0 [docs] Add release notes for burying bip 9 soft fork deployments (John Newbery) 8319e738f9f118025b332e4fa804d4c31e4113f4 [tests] Add coverage for the content of getblockchaininfo.softforks (James O'Beirne) 0328dcdcfcb56dc8918697716d7686be048ad0b3 [Consensus] Bury segwit deployment (John Newbery) 1c93b9b31c2ab7358f9d55f52dd46340397c906d [Consensus] Bury CSV deployment height (John Newbery) 3862e473f0cb71a762c0306b171b591341d58142 [rpc] Tidy up reporting of buried and ongoing softforks (John Newbery) Pull request description: This hardcodes CSV and segwit activation heights, similar to the BIP 90 buried deployments for BIPs 34, 65 and 66. CSV and segwit have been active for over 18 months. Hardcoding the activation height is a code simplification, makes it easier to understand segwit activation status, and reduces technical debt. This was originally attempted by jl2012 in #11398 and again by me in #12360. ACKs for top commit: ajtowns: ACK e78aaf41f43d0e2ad78fa6d8dad61032c8ef73d0 ; checked diff to previous acked commit, checked tests still work ariard: ACK e78aaf4, check diff, run the tests again and successfully activated csv/segwit heights on mainnet as expected. MarcoFalke: ACK e78aaf41f43d0e2ad78fa6d8dad61032c8ef73d0 (still didn't check if the mainnet block heights are correct, but the code looks good now) Tree-SHA512: 7e951829106e21a81725f7d3e236eddbb59349189740907bb47e33f5dbf95c43753ac1231f47ae7bee85c8c81b2146afcdfdc11deb1503947f23093a9c399912
2019-08-15 22:02:02 +02:00
consensus.CSVHeight = 8064; // 00000005eb94d027e34649373669191188858a22c70f4a6d29105e559124cec7
consensus.DIP0001Height = 5500; // 00000001d60a01d8f1f39011cc6b26e3a1c97a24238cab856c2da71a4dd801a9
consensus.DIP0003Height = 7000;
consensus.DIP0003EnforcementHeight = 7300;
consensus.DIP0003EnforcementHash = uint256S("00000055ebc0e974ba3a3fb785c5ad4365a39637d4df168169ee80d313612f8f");
consensus.DIP0008Height = 78800; // 000000000e9329d964d80e7dab2e704b43b6bd2b91fea1e9315d38932e55fb55
2022-03-14 22:40:01 +01:00
consensus.BRRHeight = 387500; // 0000001537dbfd09dea69f61c1f8b2afa27c8dc91c934e144797761c9f10367b
consensus.DIP0020Height = 414100; // 000000cf961868662fbfbb5d1af6f1caa1809f6a4e390efe5f8cd3031adea668
consensus.DIP0024Height = 769700; // 0000008d84e4efd890ae95c70a7a6126a70a80e5c19e4cb264a5b3469aeef172
consensus.DIP0024QuorumsHeight = 770730; // 0000003c43b3ae7fffe61278ca5537a0e256ebf4d709d45f0ab040271074d51e
consensus.V19Height = 850100; // 000004728b8ff2a16b9d4eebb0fd61eeffadc9c7fe4b0ec0b5a739869401ab5b
consensus.MinBIP9WarningHeight = 850100 + 2016; // v19 activation height + miner confirmation window
A pack of small fixes (#1992) * Make sure gobject collateral was mined `CGovernanceObject::IsCollateralValid()` would still fail for non-mined collateral later trying to check confirmations * Fix powLimit for mainnet/testnet That's a legacy thing, slightly rising it to match the actual bit-shifted value has no effect because real values are already lower. Also clarify values for all networks in comments. * Check for script addresses in CSuperblock::ParsePaymentSchedule() Sentinel should already be downvoting such triggers if they would exist, no need to store/relay them. * Do not process already known valid vote twice in CGovernanceObject::ProcessVote() This should be handled by `CGovernanceManager::ProcessVote()` but imo it's better to have this at the `CGovernanceObject::ProcessVote()` level as well. * Make sure CGovernanceObjectVoteFile::AddVote() never adds/updates already known votes The way `CGovernanceObjectVoteFile::AddVote()` is used (i.e. wrapped in `CGovernanceObjectVoteFile::HasVote()` condition) it's already the case. Hoever nothing would guarantee consistency if it would be used elsewhere without such wrapper, so it's better to have similar check inside. * Do not even try mnb recovery when -connect is set `CConnman::ThreadOpenMasternodeConnections()` thread won't even start when `-connect` is set, so no need to ask for recovery, there is nothing that is going to be able to process such request. * No need for SIGHASH_ANYONECANPAY in PS collateral signature Collateral is just a normal tx created and signed by each participant individually, there is no need for special sig types. * Release semMasternodeOutbound in CConnman::Interrupt() Re-align Dash code with Bitcoin.
2018-03-19 14:08:32 +01:00
consensus.powLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 20
consensus.nPowTargetTimespan = 24 * 60 * 60; // Dash: 1 day
consensus.nPowTargetSpacing = 2.5 * 60; // Dash: 2.5 minutes
consensus.fPowAllowMinDifficultyBlocks = true;
consensus.fPowNoRetargeting = false;
consensus.nPowKGWHeight = 4002; // nPowKGWHeight >= nPowDGWHeight means "no KGW"
consensus.nPowDGWHeight = 4002; // TODO: make sure to drop all spork6 related code on next testnet reset
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;
Merge #21377: Speedy trial support for versionbits ffe33dfbd4c3b11e3475b022b6c1dd077613de79 chainparams: drop versionbits threshold to 90% for mainnnet and signet (Anthony Towns) f054f6bcd2c2ce5fea84cf8681013f85a444e7ea versionbits: simplify state transitions (Anthony Towns) 55ac5f568a3b73d6f1ef4654617fb76e8bcbccdf versionbits: Add explicit NEVER_ACTIVE deployments (Anthony Towns) dd07e6da48040dc7eae46bc7941db48d98a669fd fuzz: test versionbits delayed activation (Anthony Towns) dd85d5411c1702c8ae259610fe55050ba212e21e tests: test versionbits delayed activation (Anthony Towns) 73d4a706393e6dbd6b6d6b6428f8d3233ac0a2d8 versionbits: Add support for delayed activation (Anthony Towns) 9e6b65f6fa205eee5c3b99343988adcb8d320460 tests: clean up versionbits test (Anthony Towns) 593274445004506c921d5d851361aefb3434d744 tests: test ComputeBlockVersion for all deployments (Anthony Towns) 63879f0a4760c0c0f784029849cb5d21ee088abb tests: pull ComputeBlockVersion test into its own function (Anthony Towns) Pull request description: BIP9-based implementation of "speedy trial" activation specification, see https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018583.html Edge cases are tested by fuzzing added in #21380. ACKs for top commit: instagibbs: tACK https://github.com/bitcoin/bitcoin/pull/21377/commits/ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jnewbery: utACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 MarcoFalke: review ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 💈 achow101: re-ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 gmaxwell: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 benthecarman: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 Sjors: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jonatack: Initial approach ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 after a first pass of review, building and testing each commit, mostly looking at the changes and diffs. Will do a more high-level review iteration. A few minor comments follow to pick/choose/ignore. ariard: Code Review ACK ffe33df Tree-SHA512: f79a7146b2450057ee92155cbbbcec12cd64334236d9239c6bd7d31b32eec145a9781c320f178da7b44ababdb8808b84d9d22a40e0851e229ba6d224e3be747c
2021-04-15 03:33:47 +02:00
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = Consensus::BIP9Deployment::NEVER_ACTIVE;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].min_activation_height = 0; // No activation delay
consensus.vDeployments[Consensus::DEPLOYMENT_V20].bit = 9;
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nStartTime = 1693526400; // Friday, September 1, 2023 0:00:00
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nThresholdStart = 80; // 80% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nThresholdMin = 60; // 60% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nFalloffCoeff = 5; // this corresponds to 10 periods
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].bit = 10;
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nStartTime = 1693526400; // Friday, September 1, 2023 0:00:00
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nThresholdStart = 80; // 80% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nThresholdMin = 60; // 60% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nFalloffCoeff = 5; // this corresponds to 10 periods
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].useEHF = true;
Backport "assumed valid blocks" feature from Bitcoin 0.13 (#1582) * IBD check uses minimumchain work instead of checkpoints. This introduces a 'minimum chain work' chainparam which is intended to be the known amount of work in the chain for the network at the time of software release. If you don't have this much work, you're not yet caught up. This is used instead of the count of blocks test from checkpoints. This criteria is trivial to keep updated as there is no element of subjectivity, trust, or position dependence to it. It is also a more reliable metric of sync status than a block count. * Remove GetTotalBlocksEstimate and checkpoint tests that test nothing. GetTotalBlocksEstimate is no longer used and it was the only thing the checkpoint tests were testing. Since checkpoints are on their way out it makes more sense to remove the test file than to cook up a new pointless test. # Conflicts: # src/Makefile.test.include # src/test/Checkpoints_tests.cpp * IsInitialBlockDownload no longer uses header-only timestamps. This avoids a corner case (mostly visible on testnet) where bogus headers can keep nodes in IsInitialBlockDownload. * Delay parallel block download until chain has sufficient work nMinimumChainWork is an anti-DoS threshold; wait until we have a proposed tip with more work than that before downloading blocks towards that tip. * Add timeout for headers sync At startup, we choose one peer to serve us the headers chain, until our best header is close to caught up. Disconnect this peer if more than 15 minutes + 1ms/expected_header passes and our best header is still more than 1 day away from current time. * Introduce assumevalid setting to skip presumed valid scripts. This disentangles the script validation skipping from checkpoints. A new option is introduced "assumevalid" which specifies a block whos ancestors we assume all have valid scriptsigs and so we do not check them when they are also burried under the best header by two weeks worth of work. Unlike checkpoints this has no influence on consensus unless you set it to a block with an invalid history. Because of this it can be easily be updated without risk of influencing the network consensus. This results in a massive IBD speedup. This approach was independently recommended by Peter Todd and Luke-Jr since POW based signature skipping (see PR#9180) does not have the verifiable properties of a specific hash and may create bad incentives. The downside is that, like checkpoints, the defaults bitrot and older releases will sync slower. On the plus side users can provide their own value here, and if they set it to something crazy all that will happen is more time will be spend validating signatures. Checkblocks and checklevel are also moved to the hidden debug options: Especially now that checkblocks has a low default there is little need to change these settings, and users frequently misunderstand them as influencing security or IBD speed. By hiding them we offset the space added by this new option. * Add consensusParams to FindNextBlocksToDownload * Adjust check in headers timeout logic to align with 144 blocks in Dash
2017-08-23 16:21:08 +02:00
// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000000031779704a0f54b4"); // 1069875
Backport "assumed valid blocks" feature from Bitcoin 0.13 (#1582) * IBD check uses minimumchain work instead of checkpoints. This introduces a 'minimum chain work' chainparam which is intended to be the known amount of work in the chain for the network at the time of software release. If you don't have this much work, you're not yet caught up. This is used instead of the count of blocks test from checkpoints. This criteria is trivial to keep updated as there is no element of subjectivity, trust, or position dependence to it. It is also a more reliable metric of sync status than a block count. * Remove GetTotalBlocksEstimate and checkpoint tests that test nothing. GetTotalBlocksEstimate is no longer used and it was the only thing the checkpoint tests were testing. Since checkpoints are on their way out it makes more sense to remove the test file than to cook up a new pointless test. # Conflicts: # src/Makefile.test.include # src/test/Checkpoints_tests.cpp * IsInitialBlockDownload no longer uses header-only timestamps. This avoids a corner case (mostly visible on testnet) where bogus headers can keep nodes in IsInitialBlockDownload. * Delay parallel block download until chain has sufficient work nMinimumChainWork is an anti-DoS threshold; wait until we have a proposed tip with more work than that before downloading blocks towards that tip. * Add timeout for headers sync At startup, we choose one peer to serve us the headers chain, until our best header is close to caught up. Disconnect this peer if more than 15 minutes + 1ms/expected_header passes and our best header is still more than 1 day away from current time. * Introduce assumevalid setting to skip presumed valid scripts. This disentangles the script validation skipping from checkpoints. A new option is introduced "assumevalid" which specifies a block whos ancestors we assume all have valid scriptsigs and so we do not check them when they are also burried under the best header by two weeks worth of work. Unlike checkpoints this has no influence on consensus unless you set it to a block with an invalid history. Because of this it can be easily be updated without risk of influencing the network consensus. This results in a massive IBD speedup. This approach was independently recommended by Peter Todd and Luke-Jr since POW based signature skipping (see PR#9180) does not have the verifiable properties of a specific hash and may create bad incentives. The downside is that, like checkpoints, the defaults bitrot and older releases will sync slower. On the plus side users can provide their own value here, and if they set it to something crazy all that will happen is more time will be spend validating signatures. Checkblocks and checklevel are also moved to the hidden debug options: Especially now that checkblocks has a low default there is little need to change these settings, and users frequently misunderstand them as influencing security or IBD speed. By hiding them we offset the space added by this new option. * Add consensusParams to FindNextBlocksToDownload * Adjust check in headers timeout logic to align with 144 blocks in Dash
2017-08-23 16:21:08 +02:00
// By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("0x00000034bfeb926662ba547c0b8dd4ba8cbb6e0c581f4e7d1bddce8f9ca3a608"); // 1069875
Backport "assumed valid blocks" feature from Bitcoin 0.13 (#1582) * IBD check uses minimumchain work instead of checkpoints. This introduces a 'minimum chain work' chainparam which is intended to be the known amount of work in the chain for the network at the time of software release. If you don't have this much work, you're not yet caught up. This is used instead of the count of blocks test from checkpoints. This criteria is trivial to keep updated as there is no element of subjectivity, trust, or position dependence to it. It is also a more reliable metric of sync status than a block count. * Remove GetTotalBlocksEstimate and checkpoint tests that test nothing. GetTotalBlocksEstimate is no longer used and it was the only thing the checkpoint tests were testing. Since checkpoints are on their way out it makes more sense to remove the test file than to cook up a new pointless test. # Conflicts: # src/Makefile.test.include # src/test/Checkpoints_tests.cpp * IsInitialBlockDownload no longer uses header-only timestamps. This avoids a corner case (mostly visible on testnet) where bogus headers can keep nodes in IsInitialBlockDownload. * Delay parallel block download until chain has sufficient work nMinimumChainWork is an anti-DoS threshold; wait until we have a proposed tip with more work than that before downloading blocks towards that tip. * Add timeout for headers sync At startup, we choose one peer to serve us the headers chain, until our best header is close to caught up. Disconnect this peer if more than 15 minutes + 1ms/expected_header passes and our best header is still more than 1 day away from current time. * Introduce assumevalid setting to skip presumed valid scripts. This disentangles the script validation skipping from checkpoints. A new option is introduced "assumevalid" which specifies a block whos ancestors we assume all have valid scriptsigs and so we do not check them when they are also burried under the best header by two weeks worth of work. Unlike checkpoints this has no influence on consensus unless you set it to a block with an invalid history. Because of this it can be easily be updated without risk of influencing the network consensus. This results in a massive IBD speedup. This approach was independently recommended by Peter Todd and Luke-Jr since POW based signature skipping (see PR#9180) does not have the verifiable properties of a specific hash and may create bad incentives. The downside is that, like checkpoints, the defaults bitrot and older releases will sync slower. On the plus side users can provide their own value here, and if they set it to something crazy all that will happen is more time will be spend validating signatures. Checkblocks and checklevel are also moved to the hidden debug options: Especially now that checkblocks has a low default there is little need to change these settings, and users frequently misunderstand them as influencing security or IBD speed. By hiding them we offset the space added by this new option. * Add consensusParams to FindNextBlocksToDownload * Adjust check in headers timeout logic to align with 144 blocks in Dash
2017-08-23 16:21:08 +02:00
pchMessageStart[0] = 0xce;
pchMessageStart[1] = 0xe2;
pchMessageStart[2] = 0xca;
pchMessageStart[3] = 0xff;
nDefaultPort = 19999;
nDefaultPlatformP2PPort = 22000;
nDefaultPlatformHTTPPort = 22001;
nPruneAfterHeight = 1000;
m_assumed_blockchain_size = 4;
m_assumed_chain_state_size = 1;
2016-12-14 14:33:46 +01:00
genesis = CreateGenesisBlock(1390666206UL, 3861367235UL, 0x1e0ffff0, 1, 50 * COIN);
consensus.hashGenesisBlock = genesis.GetHash();
assert(consensus.hashGenesisBlock == uint256S("0x00000bafbc94add76cb75e2ec92894837288a481e5c005f6563d91623bf8bc2c"));
assert(genesis.hashMerkleRoot == uint256S("0xe0028eb9648db56b1ac77cf090b99048a8007e2bb64b68f092c03c7f56a662c7"));
vFixedSeeds.clear();
vFixedSeeds = std::vector<uint8_t>(std::begin(chainparams_seed_test), std::end(chainparams_seed_test));
vSeeds.clear();
// nodes with support for servicebits filtering should be at the top
vSeeds.emplace_back("testnet-seed.dashdot.io"); // Just a static list of stable node(s), only supports x9
// 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)
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF};
// Testnet Dash BIP32 prvkeys start with 'tprv' (Bitcoin defaults)
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94};
HD wallet (#1405) * HD wallet Minimal set of changes (no refactoring) backported from Bitcoin upstream to make HD wallets work in Dash 0.12.1.x+ * minimal bip44 (hardcoded account and change) * minimal bip39 Additional cmd-line options for new wallet: -mnemonic -mnemonicpassphrase * Do not recreate HD wallet on encryption Adjusted keypool.py test * Do not store any private keys for hd wallet besides the master one Derive all keys on the fly. Original idea/implementation - btc PR9298, backported and improved * actually use bip39 * pbkdf2 test * backport wallet-hd.py test * Allow specifying hd seed, add dumphdseed rpc, fix bugs - -hdseed cmd-line param to specify HD seed on wallet creation - dumphdseed rpc to dump HD seed - allow seed of any size - fix dumpwallet rpc bug (wasn't decrypting HD seed) - print HD seed and extended public masterkey on dumpwallet * top up keypool on HD wallet encryption * split HD chain: external/internal * add missing cs_wallet lock in init.cpp * fix `const char *` issues (use strings) * default mnemonic passphrase is an empty string in all cases * store mnemonic/mnemonicpassphrase replace dumphdseed with dumphdinfo * Add fCrypted flag to CHDChain * prepare internal structures for multiple HD accounts (plus some code cleanup) * use secure allocator for storing sensitive HD data * use secure strings for mnemonic(passphrase) * small fix in GenerateNewHDChain * use 24 words for mnemonic by default * make sure mnemonic passphrase provided by user does not exceed 256 symbols * more usage of secure allocators and memory_cleanse * code cleanup * rename: CSecureVector -> SecureVector * add missing include * fix warning in rpcdump.cpp * refactor mnemonic_check (also fix a bug) * move bip39 functions to CMnemonic * Few fixes for CMnemonic: - use `SecureVector` for data, bits, seed - `Check` should return bool * init vectors with desired size where possible
2017-05-29 13:51:40 +02:00
// Testnet Dash BIP44 coin type is '1' (All coin's testnet default)
HD wallet (#1405) * HD wallet Minimal set of changes (no refactoring) backported from Bitcoin upstream to make HD wallets work in Dash 0.12.1.x+ * minimal bip44 (hardcoded account and change) * minimal bip39 Additional cmd-line options for new wallet: -mnemonic -mnemonicpassphrase * Do not recreate HD wallet on encryption Adjusted keypool.py test * Do not store any private keys for hd wallet besides the master one Derive all keys on the fly. Original idea/implementation - btc PR9298, backported and improved * actually use bip39 * pbkdf2 test * backport wallet-hd.py test * Allow specifying hd seed, add dumphdseed rpc, fix bugs - -hdseed cmd-line param to specify HD seed on wallet creation - dumphdseed rpc to dump HD seed - allow seed of any size - fix dumpwallet rpc bug (wasn't decrypting HD seed) - print HD seed and extended public masterkey on dumpwallet * top up keypool on HD wallet encryption * split HD chain: external/internal * add missing cs_wallet lock in init.cpp * fix `const char *` issues (use strings) * default mnemonic passphrase is an empty string in all cases * store mnemonic/mnemonicpassphrase replace dumphdseed with dumphdinfo * Add fCrypted flag to CHDChain * prepare internal structures for multiple HD accounts (plus some code cleanup) * use secure allocator for storing sensitive HD data * use secure strings for mnemonic(passphrase) * small fix in GenerateNewHDChain * use 24 words for mnemonic by default * make sure mnemonic passphrase provided by user does not exceed 256 symbols * more usage of secure allocators and memory_cleanse * code cleanup * rename: CSecureVector -> SecureVector * add missing include * fix warning in rpcdump.cpp * refactor mnemonic_check (also fix a bug) * move bip39 functions to CMnemonic * Few fixes for CMnemonic: - use `SecureVector` for data, bits, seed - `Check` should return bool * init vectors with desired size where possible
2017-05-29 13:51:40 +02:00
nExtCoinType = 1;
Implement and enforce DIP6 commitments (#2477) * Add LLMQ parameters to consensus params * Add DIP6 quorum commitment special TX * Implement CQuorumBlockProcessor which validates and handles commitments * Add quorum commitments to new blocks * Propagate QFCOMMITMENT messages to all nodes * Allow special transactions in blocks which have no inputs/outputs But only for TRANSACTION_QUORUM_COMMITMENT for now. * Add quorum commitments to self-crafted blocks in DIP3 tests * Add simple fork logic for current testnet This should avoid a fork on the current testnet. It only applies to the current chain which activated DIP3 at height 264000 and block 00000048e6e71d4bd90e7c456dcb94683ae832fcad13e1760d8283f7e89f332f. When we revert the chain to retest the DIP3 deployment, this fork logic can be removed again. * Use quorumVvecHash instead of quorumHash to make null commitments unique Implementation of https://github.com/dashpay/dips/pull/31 * Re-add quorum commitments after pruning mempool selected blocks * Refactor CQuorumBlockProcessor::ProcessBlock to have less nested if/else statements Also add BEGIN/END markers for temporary code. * Add comments/documentation to LLMQParams * Move code which determines if a commitment is required into IsCommitmentRequired This should make the code easier to read and also removes some duplication. The also changes the error types that are possible from 3 to 2 now. Instead of having "bad-qc-already-mined" and "bad-qc-not-mining-phase", there is only "bad-qc-not-allowed" now. * Use new parameter from consensus parames for the temporary fork
2018-11-23 15:42:09 +01:00
// long living quorum params
AddLLMQ(Consensus::LLMQType::LLMQ_50_60);
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
AddLLMQ(Consensus::LLMQType::LLMQ_60_75);
AddLLMQ(Consensus::LLMQType::LLMQ_400_60);
AddLLMQ(Consensus::LLMQType::LLMQ_400_85);
AddLLMQ(Consensus::LLMQType::LLMQ_100_67);
AddLLMQ(Consensus::LLMQType::LLMQ_25_67);
consensus.llmqTypeChainLocks = Consensus::LLMQType::LLMQ_50_60;
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
consensus.llmqTypeDIP0024InstantSend = Consensus::LLMQType::LLMQ_60_75;
consensus.llmqTypePlatform = Consensus::LLMQType::LLMQ_25_67;
2021-12-11 21:00:27 +01:00
consensus.llmqTypeMnhf = Consensus::LLMQType::LLMQ_50_60;
Implement and enforce DIP6 commitments (#2477) * Add LLMQ parameters to consensus params * Add DIP6 quorum commitment special TX * Implement CQuorumBlockProcessor which validates and handles commitments * Add quorum commitments to new blocks * Propagate QFCOMMITMENT messages to all nodes * Allow special transactions in blocks which have no inputs/outputs But only for TRANSACTION_QUORUM_COMMITMENT for now. * Add quorum commitments to self-crafted blocks in DIP3 tests * Add simple fork logic for current testnet This should avoid a fork on the current testnet. It only applies to the current chain which activated DIP3 at height 264000 and block 00000048e6e71d4bd90e7c456dcb94683ae832fcad13e1760d8283f7e89f332f. When we revert the chain to retest the DIP3 deployment, this fork logic can be removed again. * Use quorumVvecHash instead of quorumHash to make null commitments unique Implementation of https://github.com/dashpay/dips/pull/31 * Re-add quorum commitments after pruning mempool selected blocks * Refactor CQuorumBlockProcessor::ProcessBlock to have less nested if/else statements Also add BEGIN/END markers for temporary code. * Add comments/documentation to LLMQParams * Move code which determines if a commitment is required into IsCommitmentRequired This should make the code easier to read and also removes some duplication. The also changes the error types that are possible from 3 to 2 now. Instead of having "bad-qc-already-mined" and "bad-qc-not-mining-phase", there is only "bad-qc-not-allowed" now. * Use new parameter from consensus parames for the temporary fork
2018-11-23 15:42:09 +01:00
fDefaultConsistencyChecks = false;
fRequireStandard = false;
fRequireRoutableExternalIP = true;
m_is_test_chain = true;
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
fAllowMultipleAddressesFromGroup = false;
fAllowMultiplePorts = true;
nLLMQConnectionRetryTimeout = 60;
m_is_mockable_chain = false;
2015-04-03 00:51:08 +02:00
nPoolMinParticipants = 2;
nPoolMaxParticipants = 20;
nFulfilledRequestExpireTime = 5*60; // fulfilled requests expire in 5 minutes
vSporkAddresses = {"yjPtiKh2uwk3bDutTEA2q9mCtXyiZRWn55"};
nMinSporkKeys = 1;
checkpointData = {
{
{255, uint256S("0x0000080b600e06f4c07880673f027210f9314575f5f875fafe51971e268b886a")},
{261, uint256S("0x00000c26026d0815a7e2ce4fa270775f61403c040647ff2c3091f99e894a4618")},
{1999, uint256S("0x00000052e538d27fa53693efe6fb6892a0c1d26c0235f599171c48a3cce553b1")},
{2999, uint256S("0x0000024bc3f4f4cb30d29827c13d921ad77d2c6072e586c7f60d83c2722cdcc5")},
{96090, uint256S("0x00000000033df4b94d17ab43e999caaf6c4735095cc77703685da81254d09bba")},
{200000, uint256S("0x000000001015eb5ef86a8fe2b3074d947bc972c5befe32b28dd5ce915dc0d029")},
{395750, uint256S("0x000008b78b6aef3fd05ab78db8b76c02163e885305545144420cb08704dce538")},
{470000, uint256S("0x0000009303aeadf8cf3812f5c869691dbd4cb118ad20e9bf553be434bafe6a52")},
{794950, uint256S("0x000001860e4c7248a9c5cc3bc7106041750560dc5cd9b3a2641b49494bcff5f2")},
chore: update assumevalid for v18.2.0 (#5128) <!-- *** Please remove the following help text before submitting: *** Provide a general summary of your changes in the Title above Pull requests without a rationale and clear improvement may be closed immediately. Please provide clear motivation for your patch and explain how it improves Dash Core user experience or Dash Core developer experience significantly: * Any test improvements or new tests that improve coverage are always welcome. * All other changes should have accompanying unit tests (see `src/test/`) or functional tests (see `test/`). Contributors should note which tests cover modified code. If no tests exist for a region of modified code, new tests should accompany the change. * Bug fixes are most welcome when they come with steps to reproduce or an explanation of the potential issue as well as reasoning for the way the bug was fixed. * Features are welcome, but might be rejected due to design or scope issues. If a feature is based on a lot of dependencies, contributors should first consider building the system outside of Dash Core, if possible. --> ## Issue being fixed or feature implemented <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here. --> ## What was done? <!--- Describe your changes in detail --> ## How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> Hasn't been ## Breaking Changes <!--- Please describe any breaking changes your code introduces --> ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation **For repository code-owners and collaborators only** - [x] I have assigned this pull request to a milestone
2023-01-01 23:02:19 +01:00
{808000, uint256S("0x00000104cb60a2b5e00a8a4259582756e5bf0dca201c0993c63f0e54971ea91a")},
{840000, uint256S("0x000000cd7c3084499912ae893125c13e8c3c656abb6e511dcec6619c3d65a510")},
{851000, uint256S("0x0000014d3b875540ff75517b7fbb1714e25d50ce92f65d7086cfce357928bb02")},
{905100, uint256S("0x0000020c5e0f86f385cbf8e90210de9a9fd63633f01433bf47a6b3227a2851fd")},
2024-02-29 21:26:05 +01:00
{960000, uint256S("0x0000000386cf5061ea16404c66deb83eb67892fa4f79b9e58e5eaab097ec2bd6")},
{1069875, uint256S("0x00000034bfeb926662ba547c0b8dd4ba8cbb6e0c581f4e7d1bddce8f9ca3a608")},
}
};
m_assumeutxo_data = MapAssumeutxo{
// TODO to be specified in a future patch.
};
// getchaintxstats 17280 00000034bfeb926662ba547c0b8dd4ba8cbb6e0c581f4e7d1bddce8f9ca3a608
chainTxData = ChainTxData{
1721770009, // * UNIX timestamp of last known number of transactions (Block 905100)
6548039, // * total number of transactions between genesis and that timestamp
chore: update assumevalid for v18.2.0 (#5128) <!-- *** Please remove the following help text before submitting: *** Provide a general summary of your changes in the Title above Pull requests without a rationale and clear improvement may be closed immediately. Please provide clear motivation for your patch and explain how it improves Dash Core user experience or Dash Core developer experience significantly: * Any test improvements or new tests that improve coverage are always welcome. * All other changes should have accompanying unit tests (see `src/test/`) or functional tests (see `test/`). Contributors should note which tests cover modified code. If no tests exist for a region of modified code, new tests should accompany the change. * Bug fixes are most welcome when they come with steps to reproduce or an explanation of the potential issue as well as reasoning for the way the bug was fixed. * Features are welcome, but might be rejected due to design or scope issues. If a feature is based on a lot of dependencies, contributors should first consider building the system outside of Dash Core, if possible. --> ## Issue being fixed or feature implemented <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here. --> ## What was done? <!--- Describe your changes in detail --> ## How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> Hasn't been ## Breaking Changes <!--- Please describe any breaking changes your code introduces --> ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation **For repository code-owners and collaborators only** - [x] I have assigned this pull request to a milestone
2023-01-01 23:02:19 +01:00
// (the tx=... number in the ChainStateFlushed debug.log lines)
0.0152605485140752, // * estimated number of transactions per second after that timestamp
};
}
};
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
/**
* Devnet: The Development network intended for developers use.
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
*/
class CDevNetParams : public CChainParams {
public:
explicit CDevNetParams(const ArgsManager& args) {
strNetworkID = CBaseChainParams::DEVNET;
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
consensus.nSubsidyHalvingInterval = 210240;
consensus.BIP16Height = 0;
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
consensus.nMasternodePaymentsStartBlock = 4010; // not true, but it's ok as long as it's less then nMasternodePaymentsIncreaseBlock
consensus.nMasternodePaymentsIncreaseBlock = 4030;
consensus.nMasternodePaymentsIncreasePeriod = 10;
consensus.nInstantSendConfirmationsRequired = 2;
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
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
consensus.nSuperblockStartHash = uint256(); // do not check this on devnet
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
consensus.nSuperblockCycle = 24; // Superblocks can be issued hourly on devnet
consensus.nSuperblockMaturityWindow = 8;
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
consensus.nGovernanceMinQuorum = 1;
consensus.nGovernanceFilterElements = 500;
consensus.nMasternodeMinimumConfirmations = 1;
consensus.BIP34Height = 1; // BIP34 activated immediately on devnet
consensus.BIP65Height = 1; // BIP65 activated immediately on devnet
consensus.BIP66Height = 1; // BIP66 activated immediately on devnet
consensus.BIP147Height = 1; // BIP147 activated immediately on devnet
Merge #16060: Bury bip9 deployments e78aaf41f43d0e2ad78fa6d8dad61032c8ef73d0 [docs] Add release notes for burying bip 9 soft fork deployments (John Newbery) 8319e738f9f118025b332e4fa804d4c31e4113f4 [tests] Add coverage for the content of getblockchaininfo.softforks (James O'Beirne) 0328dcdcfcb56dc8918697716d7686be048ad0b3 [Consensus] Bury segwit deployment (John Newbery) 1c93b9b31c2ab7358f9d55f52dd46340397c906d [Consensus] Bury CSV deployment height (John Newbery) 3862e473f0cb71a762c0306b171b591341d58142 [rpc] Tidy up reporting of buried and ongoing softforks (John Newbery) Pull request description: This hardcodes CSV and segwit activation heights, similar to the BIP 90 buried deployments for BIPs 34, 65 and 66. CSV and segwit have been active for over 18 months. Hardcoding the activation height is a code simplification, makes it easier to understand segwit activation status, and reduces technical debt. This was originally attempted by jl2012 in #11398 and again by me in #12360. ACKs for top commit: ajtowns: ACK e78aaf41f43d0e2ad78fa6d8dad61032c8ef73d0 ; checked diff to previous acked commit, checked tests still work ariard: ACK e78aaf4, check diff, run the tests again and successfully activated csv/segwit heights on mainnet as expected. MarcoFalke: ACK e78aaf41f43d0e2ad78fa6d8dad61032c8ef73d0 (still didn't check if the mainnet block heights are correct, but the code looks good now) Tree-SHA512: 7e951829106e21a81725f7d3e236eddbb59349189740907bb47e33f5dbf95c43753ac1231f47ae7bee85c8c81b2146afcdfdc11deb1503947f23093a9c399912
2019-08-15 22:02:02 +02:00
consensus.CSVHeight = 1; // BIP68 activated immediately on devnet
consensus.DIP0001Height = 2; // DIP0001 activated immediately on devnet
consensus.DIP0003Height = 2; // DIP0003 activated immediately on devnet
consensus.DIP0003EnforcementHeight = 2; // DIP0003 activated immediately on devnet
consensus.DIP0003EnforcementHash = uint256();
consensus.DIP0008Height = 2; // DIP0008 activated immediately on devnet
2022-03-14 22:40:01 +01:00
consensus.BRRHeight = 300;
consensus.DIP0020Height = 300;
consensus.DIP0024Height = 300;
consensus.DIP0024QuorumsHeight = 300;
consensus.V19Height = 300;
consensus.MinBIP9WarningHeight = 300 + 2016; // v19 activation height + miner confirmation window
A pack of small fixes (#1992) * Make sure gobject collateral was mined `CGovernanceObject::IsCollateralValid()` would still fail for non-mined collateral later trying to check confirmations * Fix powLimit for mainnet/testnet That's a legacy thing, slightly rising it to match the actual bit-shifted value has no effect because real values are already lower. Also clarify values for all networks in comments. * Check for script addresses in CSuperblock::ParsePaymentSchedule() Sentinel should already be downvoting such triggers if they would exist, no need to store/relay them. * Do not process already known valid vote twice in CGovernanceObject::ProcessVote() This should be handled by `CGovernanceManager::ProcessVote()` but imo it's better to have this at the `CGovernanceObject::ProcessVote()` level as well. * Make sure CGovernanceObjectVoteFile::AddVote() never adds/updates already known votes The way `CGovernanceObjectVoteFile::AddVote()` is used (i.e. wrapped in `CGovernanceObjectVoteFile::HasVote()` condition) it's already the case. Hoever nothing would guarantee consistency if it would be used elsewhere without such wrapper, so it's better to have similar check inside. * Do not even try mnb recovery when -connect is set `CConnman::ThreadOpenMasternodeConnections()` thread won't even start when `-connect` is set, so no need to ask for recovery, there is nothing that is going to be able to process such request. * No need for SIGHASH_ANYONECANPAY in PS collateral signature Collateral is just a normal tx created and signed by each participant individually, there is no need for special sig types. * Release semMasternodeOutbound in CConnman::Interrupt() Re-align Dash code with Bitcoin.
2018-03-19 14:08:32 +01:00
consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 1
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
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;
consensus.nPowKGWHeight = 4001; // nPowKGWHeight >= nPowDGWHeight means "no KGW"
consensus.nPowDGWHeight = 4001;
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
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;
Merge #21377: Speedy trial support for versionbits ffe33dfbd4c3b11e3475b022b6c1dd077613de79 chainparams: drop versionbits threshold to 90% for mainnnet and signet (Anthony Towns) f054f6bcd2c2ce5fea84cf8681013f85a444e7ea versionbits: simplify state transitions (Anthony Towns) 55ac5f568a3b73d6f1ef4654617fb76e8bcbccdf versionbits: Add explicit NEVER_ACTIVE deployments (Anthony Towns) dd07e6da48040dc7eae46bc7941db48d98a669fd fuzz: test versionbits delayed activation (Anthony Towns) dd85d5411c1702c8ae259610fe55050ba212e21e tests: test versionbits delayed activation (Anthony Towns) 73d4a706393e6dbd6b6d6b6428f8d3233ac0a2d8 versionbits: Add support for delayed activation (Anthony Towns) 9e6b65f6fa205eee5c3b99343988adcb8d320460 tests: clean up versionbits test (Anthony Towns) 593274445004506c921d5d851361aefb3434d744 tests: test ComputeBlockVersion for all deployments (Anthony Towns) 63879f0a4760c0c0f784029849cb5d21ee088abb tests: pull ComputeBlockVersion test into its own function (Anthony Towns) Pull request description: BIP9-based implementation of "speedy trial" activation specification, see https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018583.html Edge cases are tested by fuzzing added in #21380. ACKs for top commit: instagibbs: tACK https://github.com/bitcoin/bitcoin/pull/21377/commits/ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jnewbery: utACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 MarcoFalke: review ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 💈 achow101: re-ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 gmaxwell: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 benthecarman: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 Sjors: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jonatack: Initial approach ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 after a first pass of review, building and testing each commit, mostly looking at the changes and diffs. Will do a more high-level review iteration. A few minor comments follow to pick/choose/ignore. ariard: Code Review ACK ffe33df Tree-SHA512: f79a7146b2450057ee92155cbbbcec12cd64334236d9239c6bd7d31b32eec145a9781c320f178da7b44ababdb8808b84d9d22a40e0851e229ba6d224e3be747c
2021-04-15 03:33:47 +02:00
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = Consensus::BIP9Deployment::NEVER_ACTIVE;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].min_activation_height = 0; // No activation delay
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
consensus.vDeployments[Consensus::DEPLOYMENT_V20].bit = 9;
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nStartTime = 1661990400; // Sep 1st, 2022
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nWindowSize = 120;
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nThresholdStart = 80; // 80% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nThresholdMin = 60; // 60% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nFalloffCoeff = 5; // this corresponds to 10 periods
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].bit = 10;
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nStartTime = 1661990400; // Sep 1st, 2022
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nWindowSize = 120;
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nThresholdStart = 80; // 80% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nThresholdMin = 60; // 60% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nFalloffCoeff = 5; // this corresponds to 10 periods
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].useEHF = true;
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
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");
pchMessageStart[0] = 0xe2;
pchMessageStart[1] = 0xca;
pchMessageStart[2] = 0xff;
pchMessageStart[3] = 0xce;
nDefaultPort = 19799;
nDefaultPlatformP2PPort = 22100;
nDefaultPlatformHTTPPort = 22101;
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
nPruneAfterHeight = 1000;
m_assumed_blockchain_size = 0;
m_assumed_chain_state_size = 0;
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
UpdateDevnetSubsidyAndDiffParametersFromArgs(args);
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
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"));
devnetGenesis = FindDevNetGenesisBlock(genesis, 50 * COIN);
consensus.hashDevnetGenesisBlock = devnetGenesis.GetHash();
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
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)
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF};
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
// Testnet Dash BIP32 prvkeys start with 'tprv' (Bitcoin defaults)
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94};
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
// Testnet Dash BIP44 coin type is '1' (All coin's testnet default)
nExtCoinType = 1;
Implement and enforce DIP6 commitments (#2477) * Add LLMQ parameters to consensus params * Add DIP6 quorum commitment special TX * Implement CQuorumBlockProcessor which validates and handles commitments * Add quorum commitments to new blocks * Propagate QFCOMMITMENT messages to all nodes * Allow special transactions in blocks which have no inputs/outputs But only for TRANSACTION_QUORUM_COMMITMENT for now. * Add quorum commitments to self-crafted blocks in DIP3 tests * Add simple fork logic for current testnet This should avoid a fork on the current testnet. It only applies to the current chain which activated DIP3 at height 264000 and block 00000048e6e71d4bd90e7c456dcb94683ae832fcad13e1760d8283f7e89f332f. When we revert the chain to retest the DIP3 deployment, this fork logic can be removed again. * Use quorumVvecHash instead of quorumHash to make null commitments unique Implementation of https://github.com/dashpay/dips/pull/31 * Re-add quorum commitments after pruning mempool selected blocks * Refactor CQuorumBlockProcessor::ProcessBlock to have less nested if/else statements Also add BEGIN/END markers for temporary code. * Add comments/documentation to LLMQParams * Move code which determines if a commitment is required into IsCommitmentRequired This should make the code easier to read and also removes some duplication. The also changes the error types that are possible from 3 to 2 now. Instead of having "bad-qc-already-mined" and "bad-qc-not-mining-phase", there is only "bad-qc-not-allowed" now. * Use new parameter from consensus parames for the temporary fork
2018-11-23 15:42:09 +01:00
// long living quorum params
AddLLMQ(Consensus::LLMQType::LLMQ_50_60);
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
AddLLMQ(Consensus::LLMQType::LLMQ_60_75);
AddLLMQ(Consensus::LLMQType::LLMQ_400_60);
AddLLMQ(Consensus::LLMQType::LLMQ_400_85);
AddLLMQ(Consensus::LLMQType::LLMQ_100_67);
AddLLMQ(Consensus::LLMQType::LLMQ_DEVNET);
AddLLMQ(Consensus::LLMQType::LLMQ_DEVNET_DIP0024);
AddLLMQ(Consensus::LLMQType::LLMQ_DEVNET_PLATFORM);
consensus.llmqTypeChainLocks = Consensus::LLMQType::LLMQ_DEVNET;
consensus.llmqTypeDIP0024InstantSend = Consensus::LLMQType::LLMQ_DEVNET_DIP0024;
consensus.llmqTypePlatform = Consensus::LLMQType::LLMQ_DEVNET_PLATFORM;
consensus.llmqTypeMnhf = Consensus::LLMQType::LLMQ_DEVNET;
Implement and enforce DIP6 commitments (#2477) * Add LLMQ parameters to consensus params * Add DIP6 quorum commitment special TX * Implement CQuorumBlockProcessor which validates and handles commitments * Add quorum commitments to new blocks * Propagate QFCOMMITMENT messages to all nodes * Allow special transactions in blocks which have no inputs/outputs But only for TRANSACTION_QUORUM_COMMITMENT for now. * Add quorum commitments to self-crafted blocks in DIP3 tests * Add simple fork logic for current testnet This should avoid a fork on the current testnet. It only applies to the current chain which activated DIP3 at height 264000 and block 00000048e6e71d4bd90e7c456dcb94683ae832fcad13e1760d8283f7e89f332f. When we revert the chain to retest the DIP3 deployment, this fork logic can be removed again. * Use quorumVvecHash instead of quorumHash to make null commitments unique Implementation of https://github.com/dashpay/dips/pull/31 * Re-add quorum commitments after pruning mempool selected blocks * Refactor CQuorumBlockProcessor::ProcessBlock to have less nested if/else statements Also add BEGIN/END markers for temporary code. * Add comments/documentation to LLMQParams * Move code which determines if a commitment is required into IsCommitmentRequired This should make the code easier to read and also removes some duplication. The also changes the error types that are possible from 3 to 2 now. Instead of having "bad-qc-already-mined" and "bad-qc-not-mining-phase", there is only "bad-qc-not-allowed" now. * Use new parameter from consensus parames for the temporary fork
2018-11-23 15:42:09 +01:00
UpdateDevnetLLMQChainLocksFromArgs(args);
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
UpdateDevnetLLMQInstantSendDIP0024FromArgs(args);
UpdateDevnetLLMQPlatformFromArgs(args);
UpdateDevnetLLMQMnhfFromArgs(args);
UpdateLLMQDevnetParametersFromArgs(args);
UpdateDevnetPowTargetSpacingFromArgs(args);
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
fDefaultConsistencyChecks = false;
fRequireStandard = false;
fRequireRoutableExternalIP = true;
m_is_test_chain = true;
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
fAllowMultipleAddressesFromGroup = true;
fAllowMultiplePorts = true;
nLLMQConnectionRetryTimeout = 60;
m_is_mockable_chain = false;
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
nPoolMinParticipants = 2;
nPoolMaxParticipants = 20;
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
nFulfilledRequestExpireTime = 5*60; // fulfilled requests expire in 5 minutes
vSporkAddresses = {"yjPtiKh2uwk3bDutTEA2q9mCtXyiZRWn55"};
nMinSporkKeys = 1;
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
checkpointData = (CCheckpointData) {
{
{ 0, uint256S("0x000008ca1832a4baf228eb1553c03d3a2c8e02399550dd6ea8d65cec3ef23d2e")},
{ 1, devnetGenesis.GetHash() },
}
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +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
};
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01: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);
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
/**
* Allows modifying the LLMQ type for InstantSend (DIP0024).
*/
void UpdateDevnetLLMQDIP0024InstantSend(Consensus::LLMQType llmqType)
{
consensus.llmqTypeDIP0024InstantSend = llmqType;
}
/**
* Allows modifying the LLMQ type for Platform.
*/
void UpdateDevnetLLMQPlatform(Consensus::LLMQType llmqType)
{
consensus.llmqTypePlatform = llmqType;
}
/**
* Allows modifying the LLMQ type for Mnhf.
*/
void UpdateDevnetLLMQMnhf(Consensus::LLMQType llmqType)
{
consensus.llmqTypeMnhf = llmqType;
}
/**
* Allows modifying PowTargetSpacing
*/
void UpdateDevnetPowTargetSpacing(int64_t nPowTargetSpacing)
{
consensus.nPowTargetSpacing = nPowTargetSpacing;
}
/**
* Allows modifying parameters of the devnet LLMQ
*/
void UpdateLLMQDevnetParameters(int size, int threshold)
{
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;
}
void UpdateLLMQDevnetParametersFromArgs(const ArgsManager& args);
void UpdateDevnetLLMQInstantSendFromArgs(const ArgsManager& args);
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
void UpdateDevnetLLMQInstantSendDIP0024FromArgs(const ArgsManager& args);
void UpdateDevnetLLMQPlatformFromArgs(const ArgsManager& args);
void UpdateDevnetLLMQMnhfFromArgs(const ArgsManager& args);
void UpdateDevnetPowTargetSpacingFromArgs(const ArgsManager& args);
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
};
/**
* Regression test: intended for private networks only. Has minimal difficulty to ensure that
* blocks can be found instantly.
*/
class CRegTestParams : public CChainParams {
public:
explicit CRegTestParams(const ArgsManager& args) {
strNetworkID = CBaseChainParams::REGTEST;
consensus.nSubsidyHalvingInterval = 150;
consensus.BIP16Height = 0; // always enforce P2SH BIP16 on regtest
consensus.nMasternodePaymentsStartBlock = 240;
consensus.nMasternodePaymentsIncreaseBlock = 350;
consensus.nMasternodePaymentsIncreasePeriod = 10;
consensus.nInstantSendConfirmationsRequired = 2;
consensus.nInstantSendKeepLock = 6;
consensus.nBudgetPaymentsStartBlock = 1000;
consensus.nBudgetPaymentsCycleBlocks = 50;
consensus.nBudgetPaymentsWindowBlocks = 10;
consensus.nSuperblockStartBlock = 1500;
consensus.nSuperblockStartHash = uint256(); // do not check this on regtest
consensus.nSuperblockCycle = 20;
consensus.nSuperblockMaturityWindow = 10;
consensus.nGovernanceMinQuorum = 1;
consensus.nGovernanceFilterElements = 100;
consensus.nMasternodeMinimumConfirmations = 1;
consensus.BIP34Height = 1; // Always active unless overridden
consensus.BIP34Hash = uint256();
consensus.BIP65Height = 1; // Always active unless overridden
consensus.BIP66Height = 1; // Always active unless overridden
consensus.BIP147Height = 1; // Always active unless overridden
consensus.CSVHeight = 1; // Always active unless overridden
consensus.DIP0001Height = 2000;
consensus.DIP0003Height = 432;
consensus.DIP0003EnforcementHeight = 500;
consensus.DIP0003EnforcementHash = uint256();
consensus.DIP0008Height = 432;
2024-08-07 05:15:26 +02:00
consensus.BRRHeight = 1000; // see block_reward_reallocation_tests
consensus.DIP0020Height = 1;
consensus.DIP0024Height = 900;
consensus.DIP0024QuorumsHeight = 900;
consensus.V19Height = 900;
consensus.MinBIP9WarningHeight = 0;
A pack of small fixes (#1992) * Make sure gobject collateral was mined `CGovernanceObject::IsCollateralValid()` would still fail for non-mined collateral later trying to check confirmations * Fix powLimit for mainnet/testnet That's a legacy thing, slightly rising it to match the actual bit-shifted value has no effect because real values are already lower. Also clarify values for all networks in comments. * Check for script addresses in CSuperblock::ParsePaymentSchedule() Sentinel should already be downvoting such triggers if they would exist, no need to store/relay them. * Do not process already known valid vote twice in CGovernanceObject::ProcessVote() This should be handled by `CGovernanceManager::ProcessVote()` but imo it's better to have this at the `CGovernanceObject::ProcessVote()` level as well. * Make sure CGovernanceObjectVoteFile::AddVote() never adds/updates already known votes The way `CGovernanceObjectVoteFile::AddVote()` is used (i.e. wrapped in `CGovernanceObjectVoteFile::HasVote()` condition) it's already the case. Hoever nothing would guarantee consistency if it would be used elsewhere without such wrapper, so it's better to have similar check inside. * Do not even try mnb recovery when -connect is set `CConnman::ThreadOpenMasternodeConnections()` thread won't even start when `-connect` is set, so no need to ask for recovery, there is nothing that is going to be able to process such request. * No need for SIGHASH_ANYONECANPAY in PS collateral signature Collateral is just a normal tx created and signed by each participant individually, there is no need for special sig types. * Release semMasternodeOutbound in CConnman::Interrupt() Re-align Dash code with Bitcoin.
2018-03-19 14:08:32 +01:00
consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 1
consensus.nPowTargetTimespan = 24 * 60 * 60; // Dash: 1 day
consensus.nPowTargetSpacing = 2.5 * 60; // Dash: 2.5 minutes
consensus.fPowAllowMinDifficultyBlocks = true;
consensus.fPowNoRetargeting = true;
consensus.nPowKGWHeight = 15200; // same as mainnet
consensus.nPowDGWHeight = 34140; // same as mainnet
consensus.nRuleChangeActivationThreshold = 108; // 75% for testchains
consensus.nMinerConfirmationWindow = 144; // Faster than normal for regtest (144 instead of 2016)
Merge #21377: Speedy trial support for versionbits ffe33dfbd4c3b11e3475b022b6c1dd077613de79 chainparams: drop versionbits threshold to 90% for mainnnet and signet (Anthony Towns) f054f6bcd2c2ce5fea84cf8681013f85a444e7ea versionbits: simplify state transitions (Anthony Towns) 55ac5f568a3b73d6f1ef4654617fb76e8bcbccdf versionbits: Add explicit NEVER_ACTIVE deployments (Anthony Towns) dd07e6da48040dc7eae46bc7941db48d98a669fd fuzz: test versionbits delayed activation (Anthony Towns) dd85d5411c1702c8ae259610fe55050ba212e21e tests: test versionbits delayed activation (Anthony Towns) 73d4a706393e6dbd6b6d6b6428f8d3233ac0a2d8 versionbits: Add support for delayed activation (Anthony Towns) 9e6b65f6fa205eee5c3b99343988adcb8d320460 tests: clean up versionbits test (Anthony Towns) 593274445004506c921d5d851361aefb3434d744 tests: test ComputeBlockVersion for all deployments (Anthony Towns) 63879f0a4760c0c0f784029849cb5d21ee088abb tests: pull ComputeBlockVersion test into its own function (Anthony Towns) Pull request description: BIP9-based implementation of "speedy trial" activation specification, see https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018583.html Edge cases are tested by fuzzing added in #21380. ACKs for top commit: instagibbs: tACK https://github.com/bitcoin/bitcoin/pull/21377/commits/ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jnewbery: utACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 MarcoFalke: review ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 💈 achow101: re-ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 gmaxwell: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 benthecarman: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 Sjors: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jonatack: Initial approach ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 after a first pass of review, building and testing each commit, mostly looking at the changes and diffs. Will do a more high-level review iteration. A few minor comments follow to pick/choose/ignore. ariard: Code Review ACK ffe33df Tree-SHA512: f79a7146b2450057ee92155cbbbcec12cd64334236d9239c6bd7d31b32eec145a9781c320f178da7b44ababdb8808b84d9d22a40e0851e229ba6d224e3be747c
2021-04-15 03:33:47 +02:00
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 = Consensus::BIP9Deployment::NO_TIMEOUT;
Merge #21377: Speedy trial support for versionbits ffe33dfbd4c3b11e3475b022b6c1dd077613de79 chainparams: drop versionbits threshold to 90% for mainnnet and signet (Anthony Towns) f054f6bcd2c2ce5fea84cf8681013f85a444e7ea versionbits: simplify state transitions (Anthony Towns) 55ac5f568a3b73d6f1ef4654617fb76e8bcbccdf versionbits: Add explicit NEVER_ACTIVE deployments (Anthony Towns) dd07e6da48040dc7eae46bc7941db48d98a669fd fuzz: test versionbits delayed activation (Anthony Towns) dd85d5411c1702c8ae259610fe55050ba212e21e tests: test versionbits delayed activation (Anthony Towns) 73d4a706393e6dbd6b6d6b6428f8d3233ac0a2d8 versionbits: Add support for delayed activation (Anthony Towns) 9e6b65f6fa205eee5c3b99343988adcb8d320460 tests: clean up versionbits test (Anthony Towns) 593274445004506c921d5d851361aefb3434d744 tests: test ComputeBlockVersion for all deployments (Anthony Towns) 63879f0a4760c0c0f784029849cb5d21ee088abb tests: pull ComputeBlockVersion test into its own function (Anthony Towns) Pull request description: BIP9-based implementation of "speedy trial" activation specification, see https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018583.html Edge cases are tested by fuzzing added in #21380. ACKs for top commit: instagibbs: tACK https://github.com/bitcoin/bitcoin/pull/21377/commits/ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jnewbery: utACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 MarcoFalke: review ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 💈 achow101: re-ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 gmaxwell: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 benthecarman: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 Sjors: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jonatack: Initial approach ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 after a first pass of review, building and testing each commit, mostly looking at the changes and diffs. Will do a more high-level review iteration. A few minor comments follow to pick/choose/ignore. ariard: Code Review ACK ffe33df Tree-SHA512: f79a7146b2450057ee92155cbbbcec12cd64334236d9239c6bd7d31b32eec145a9781c320f178da7b44ababdb8808b84d9d22a40e0851e229ba6d224e3be747c
2021-04-15 03:33:47 +02:00
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].min_activation_height = 0; // No activation delay
consensus.vDeployments[Consensus::DEPLOYMENT_V20].bit = 9;
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nStartTime = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nWindowSize = 400;
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nThresholdStart = 384; // 80% of 480
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nThresholdMin = 288; // 60% of 480
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nFalloffCoeff = 5; // this corresponds to 10 periods
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].bit = 10;
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nStartTime = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
feat: auto generation EHF and spork+EHF activation for MN_RR (#5597) Implementation EHF mechanism, part 4. Previous changes are: - https://github.com/dashpay/dash/pull/4577 - https://github.com/dashpay/dash/pull/5505 - https://github.com/dashpay/dash/pull/5469 ## Issue being fixed or feature implemented Currently MN_RR is activated automatically by soft-fork activation after v20 is activated. It is not flexible enough, because platform may not be released by that time yet or in opposite it can be too long to wait. Also, any signal of EHF requires manual actions from MN owners to sign EHF signal - it is automated here. ## What was done? New spork `SPORK_24_MN_RR_READY`; new EHF manager that sign EHF signals semi-automatically without manual actions; and send transaction with EHF signal when signal is signed to network. Updated rpc `getblockchaininfo` to return information about of EHF activated forks. Fixed function `IsTxSafeForMining` in chainlock's handler to skip transactions without inputs (empty `vin`). ## How Has This Been Tested? Run unit/functional tests. Some tests have been updated due to new way of MN_RR activation: `feature_asset_locks.py`, `feature_mnehf.py`, `feature_llmq_evo.py` and unit test `block_reward_reallocation_tests`. ## Breaking Changes New way of MN_RR activation. ## Checklist: - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ --------- Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com> Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
2023-10-18 05:31:40 +02:00
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nWindowSize = 12;
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nThresholdStart = 9; // 80% of 12
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nThresholdMin = 7; // 60% of 7
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].nFalloffCoeff = 5; // this corresponds to 10 periods
consensus.vDeployments[Consensus::DEPLOYMENT_MN_RR].useEHF = true;
Backport "assumed valid blocks" feature from Bitcoin 0.13 (#1582) * IBD check uses minimumchain work instead of checkpoints. This introduces a 'minimum chain work' chainparam which is intended to be the known amount of work in the chain for the network at the time of software release. If you don't have this much work, you're not yet caught up. This is used instead of the count of blocks test from checkpoints. This criteria is trivial to keep updated as there is no element of subjectivity, trust, or position dependence to it. It is also a more reliable metric of sync status than a block count. * Remove GetTotalBlocksEstimate and checkpoint tests that test nothing. GetTotalBlocksEstimate is no longer used and it was the only thing the checkpoint tests were testing. Since checkpoints are on their way out it makes more sense to remove the test file than to cook up a new pointless test. # Conflicts: # src/Makefile.test.include # src/test/Checkpoints_tests.cpp * IsInitialBlockDownload no longer uses header-only timestamps. This avoids a corner case (mostly visible on testnet) where bogus headers can keep nodes in IsInitialBlockDownload. * Delay parallel block download until chain has sufficient work nMinimumChainWork is an anti-DoS threshold; wait until we have a proposed tip with more work than that before downloading blocks towards that tip. * Add timeout for headers sync At startup, we choose one peer to serve us the headers chain, until our best header is close to caught up. Disconnect this peer if more than 15 minutes + 1ms/expected_header passes and our best header is still more than 1 day away from current time. * Introduce assumevalid setting to skip presumed valid scripts. This disentangles the script validation skipping from checkpoints. A new option is introduced "assumevalid" which specifies a block whos ancestors we assume all have valid scriptsigs and so we do not check them when they are also burried under the best header by two weeks worth of work. Unlike checkpoints this has no influence on consensus unless you set it to a block with an invalid history. Because of this it can be easily be updated without risk of influencing the network consensus. This results in a massive IBD speedup. This approach was independently recommended by Peter Todd and Luke-Jr since POW based signature skipping (see PR#9180) does not have the verifiable properties of a specific hash and may create bad incentives. The downside is that, like checkpoints, the defaults bitrot and older releases will sync slower. On the plus side users can provide their own value here, and if they set it to something crazy all that will happen is more time will be spend validating signatures. Checkblocks and checklevel are also moved to the hidden debug options: Especially now that checkblocks has a low default there is little need to change these settings, and users frequently misunderstand them as influencing security or IBD speed. By hiding them we offset the space added by this new option. * Add consensusParams to FindNextBlocksToDownload * Adjust check in headers timeout logic to align with 144 blocks in Dash
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");
pchMessageStart[0] = 0xfc;
pchMessageStart[1] = 0xc1;
pchMessageStart[2] = 0xb7;
pchMessageStart[3] = 0xdc;
nDefaultPort = 19899;
nDefaultPlatformP2PPort = 22200;
nDefaultPlatformHTTPPort = 22201;
nPruneAfterHeight = args.GetBoolArg("-fastprune", false) ? 100 : 1000;
m_assumed_blockchain_size = 0;
m_assumed_chain_state_size = 0;
Merge #16060: Bury bip9 deployments e78aaf41f43d0e2ad78fa6d8dad61032c8ef73d0 [docs] Add release notes for burying bip 9 soft fork deployments (John Newbery) 8319e738f9f118025b332e4fa804d4c31e4113f4 [tests] Add coverage for the content of getblockchaininfo.softforks (James O'Beirne) 0328dcdcfcb56dc8918697716d7686be048ad0b3 [Consensus] Bury segwit deployment (John Newbery) 1c93b9b31c2ab7358f9d55f52dd46340397c906d [Consensus] Bury CSV deployment height (John Newbery) 3862e473f0cb71a762c0306b171b591341d58142 [rpc] Tidy up reporting of buried and ongoing softforks (John Newbery) Pull request description: This hardcodes CSV and segwit activation heights, similar to the BIP 90 buried deployments for BIPs 34, 65 and 66. CSV and segwit have been active for over 18 months. Hardcoding the activation height is a code simplification, makes it easier to understand segwit activation status, and reduces technical debt. This was originally attempted by jl2012 in #11398 and again by me in #12360. ACKs for top commit: ajtowns: ACK e78aaf41f43d0e2ad78fa6d8dad61032c8ef73d0 ; checked diff to previous acked commit, checked tests still work ariard: ACK e78aaf4, check diff, run the tests again and successfully activated csv/segwit heights on mainnet as expected. MarcoFalke: ACK e78aaf41f43d0e2ad78fa6d8dad61032c8ef73d0 (still didn't check if the mainnet block heights are correct, but the code looks good now) Tree-SHA512: 7e951829106e21a81725f7d3e236eddbb59349189740907bb47e33f5dbf95c43753ac1231f47ae7bee85c8c81b2146afcdfdc11deb1503947f23093a9c399912
2019-08-15 22:02:02 +02:00
UpdateActivationParametersFromArgs(args);
UpdateDIP3ParametersFromArgs(args);
UpdateDIP8ParametersFromArgs(args);
UpdateBIP147ParametersFromArgs(args);
UpdateBudgetParametersFromArgs(args);
genesis = CreateGenesisBlock(1417713337, 1096447, 0x207fffff, 1, 50 * COIN);
consensus.hashGenesisBlock = genesis.GetHash();
assert(consensus.hashGenesisBlock == uint256S("0x000008ca1832a4baf228eb1553c03d3a2c8e02399550dd6ea8d65cec3ef23d2e"));
assert(genesis.hashMerkleRoot == uint256S("0xe0028eb9648db56b1ac77cf090b99048a8007e2bb64b68f092c03c7f56a662c7"));
vFixedSeeds.clear(); //!< Regtest mode doesn't have any fixed seeds.
vSeeds.clear(); //!< Regtest mode doesn't have any DNS seeds.
fDefaultConsistencyChecks = true;
fRequireStandard = true;
fRequireRoutableExternalIP = false;
m_is_test_chain = true;
Implement named devnets (#1791) * Initial devnet * Move genesis block adding into its own method * Introduce -allowprivatenet to lift limitation on RFC1918 addresses Normally, RFC1918 (192.168.x.x/10.x.x.x/...) addresses are not allowed to be relayed. Also, masternodes won't start when the address is considered invalid. This is needed to test local devnet or regtest based networks. * Lift the requirement of minimum MN age for regtest/devnet * Implement named devnets This allows the creation of multiple independent devnets. Each one is identified by a name which is hardened into a "devnet genesis" block, which is automatically positioned at height 1. Validation rules will ensure that a node from devnet=test1 never be able to accept blocks from devnet=test2. This is done by checking the expected devnet genesis block. The genesis block of the devnet is the same as the one from regtest. This starts the devnet with a very low difficulty, allowing us to fill up needed balances for masternodes very fast. Also, the devnet name is put into the sub-version of the VERSION message. If a node connects to the wrong network, it will immediately be disconnected. * Allow to select multiple addresses from the same group in devnet/regtest The selection code normally only allows to select addresses from the same group (e.g. 192.168.x.x) once. This results in connecting to only a single node in devnet/regtest. * Show the devnet name in the title bar and on the loading screen * Add AllowMultipleAddressesFromGroup to chainparams and use it in net.cpp * Remove unused/unneeded scripts from devnet geneses creation 1. OP_RETURN not needed in input script of devnet genesis 2. genesisOutputScript was unused * Fix copy/paste error in -allowprivatenet description * Improve -devnet parameter error handling - Only allow one of -devnet, -regtest or -testnet - Only allow -devnet=name to be specified once * Use different datadir for each devnet * Fix `devnet-devnet` issue * Fix devnet splashscreen (should use testnet img) * Avoid passing devNetName around (most of the time) * Remove nMaxTipAge from CDevNetParams Not present anymore after rebase on develop
2017-12-20 12:45:01 +01:00
fAllowMultipleAddressesFromGroup = true;
fAllowMultiplePorts = true;
nLLMQConnectionRetryTimeout = 1; // must be lower then the LLMQ signing session timeout so that tests have control over failing behavior
m_is_mockable_chain = true;
nFulfilledRequestExpireTime = 5*60; // fulfilled requests expire in 5 minutes
nPoolMinParticipants = 2;
nPoolMaxParticipants = 20;
// privKey: cP4EKFyJsHT39LDqgdcB43Y3YXjNyjb5Fuas1GQSeAtjnZWmZEQK
vSporkAddresses = {"yj949n1UH6fDhw6HtVE5VMj2iSTaSWBMcW"};
nMinSporkKeys = 1;
checkpointData = {
{
{0, uint256S("0x000008ca1832a4baf228eb1553c03d3a2c8e02399550dd6ea8d65cec3ef23d2e")},
}
};
m_assumeutxo_data = MapAssumeutxo{
{
110,
{AssumeutxoHash{uint256S("0x9b2a277a3e3b979f1a539d57e949495d7f8247312dbc32bce6619128c192b44b")}, 110},
},
{
200,
{AssumeutxoHash{uint256S("0x8a5bdd92252fc6b24663244bbe958c947bb036dc1f94ccd15439f48d8d1cb4e3")}, 200},
},
};
chainTxData = ChainTxData{
0,
0,
0
};
// Regtest Dash addresses start with 'y'
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,140);
// Regtest Dash script addresses start with '8' or '9'
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,19);
// Regtest private keys start with '9' or 'c' (Bitcoin defaults)
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,239);
// Regtest Dash BIP32 pubkeys start with 'tpub' (Bitcoin defaults)
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF};
// Regtest Dash BIP32 prvkeys start with 'tprv' (Bitcoin defaults)
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94};
HD wallet (#1405) * HD wallet Minimal set of changes (no refactoring) backported from Bitcoin upstream to make HD wallets work in Dash 0.12.1.x+ * minimal bip44 (hardcoded account and change) * minimal bip39 Additional cmd-line options for new wallet: -mnemonic -mnemonicpassphrase * Do not recreate HD wallet on encryption Adjusted keypool.py test * Do not store any private keys for hd wallet besides the master one Derive all keys on the fly. Original idea/implementation - btc PR9298, backported and improved * actually use bip39 * pbkdf2 test * backport wallet-hd.py test * Allow specifying hd seed, add dumphdseed rpc, fix bugs - -hdseed cmd-line param to specify HD seed on wallet creation - dumphdseed rpc to dump HD seed - allow seed of any size - fix dumpwallet rpc bug (wasn't decrypting HD seed) - print HD seed and extended public masterkey on dumpwallet * top up keypool on HD wallet encryption * split HD chain: external/internal * add missing cs_wallet lock in init.cpp * fix `const char *` issues (use strings) * default mnemonic passphrase is an empty string in all cases * store mnemonic/mnemonicpassphrase replace dumphdseed with dumphdinfo * Add fCrypted flag to CHDChain * prepare internal structures for multiple HD accounts (plus some code cleanup) * use secure allocator for storing sensitive HD data * use secure strings for mnemonic(passphrase) * small fix in GenerateNewHDChain * use 24 words for mnemonic by default * make sure mnemonic passphrase provided by user does not exceed 256 symbols * more usage of secure allocators and memory_cleanse * code cleanup * rename: CSecureVector -> SecureVector * add missing include * fix warning in rpcdump.cpp * refactor mnemonic_check (also fix a bug) * move bip39 functions to CMnemonic * Few fixes for CMnemonic: - use `SecureVector` for data, bits, seed - `Check` should return bool * init vectors with desired size where possible
2017-05-29 13:51:40 +02:00
// Regtest Dash BIP44 coin type is '1' (All coin's testnet default)
HD wallet (#1405) * HD wallet Minimal set of changes (no refactoring) backported from Bitcoin upstream to make HD wallets work in Dash 0.12.1.x+ * minimal bip44 (hardcoded account and change) * minimal bip39 Additional cmd-line options for new wallet: -mnemonic -mnemonicpassphrase * Do not recreate HD wallet on encryption Adjusted keypool.py test * Do not store any private keys for hd wallet besides the master one Derive all keys on the fly. Original idea/implementation - btc PR9298, backported and improved * actually use bip39 * pbkdf2 test * backport wallet-hd.py test * Allow specifying hd seed, add dumphdseed rpc, fix bugs - -hdseed cmd-line param to specify HD seed on wallet creation - dumphdseed rpc to dump HD seed - allow seed of any size - fix dumpwallet rpc bug (wasn't decrypting HD seed) - print HD seed and extended public masterkey on dumpwallet * top up keypool on HD wallet encryption * split HD chain: external/internal * add missing cs_wallet lock in init.cpp * fix `const char *` issues (use strings) * default mnemonic passphrase is an empty string in all cases * store mnemonic/mnemonicpassphrase replace dumphdseed with dumphdinfo * Add fCrypted flag to CHDChain * prepare internal structures for multiple HD accounts (plus some code cleanup) * use secure allocator for storing sensitive HD data * use secure strings for mnemonic(passphrase) * small fix in GenerateNewHDChain * use 24 words for mnemonic by default * make sure mnemonic passphrase provided by user does not exceed 256 symbols * more usage of secure allocators and memory_cleanse * code cleanup * rename: CSecureVector -> SecureVector * add missing include * fix warning in rpcdump.cpp * refactor mnemonic_check (also fix a bug) * move bip39 functions to CMnemonic * Few fixes for CMnemonic: - use `SecureVector` for data, bits, seed - `Check` should return bool * init vectors with desired size where possible
2017-05-29 13:51:40 +02:00
nExtCoinType = 1;
Implement and enforce DIP6 commitments (#2477) * Add LLMQ parameters to consensus params * Add DIP6 quorum commitment special TX * Implement CQuorumBlockProcessor which validates and handles commitments * Add quorum commitments to new blocks * Propagate QFCOMMITMENT messages to all nodes * Allow special transactions in blocks which have no inputs/outputs But only for TRANSACTION_QUORUM_COMMITMENT for now. * Add quorum commitments to self-crafted blocks in DIP3 tests * Add simple fork logic for current testnet This should avoid a fork on the current testnet. It only applies to the current chain which activated DIP3 at height 264000 and block 00000048e6e71d4bd90e7c456dcb94683ae832fcad13e1760d8283f7e89f332f. When we revert the chain to retest the DIP3 deployment, this fork logic can be removed again. * Use quorumVvecHash instead of quorumHash to make null commitments unique Implementation of https://github.com/dashpay/dips/pull/31 * Re-add quorum commitments after pruning mempool selected blocks * Refactor CQuorumBlockProcessor::ProcessBlock to have less nested if/else statements Also add BEGIN/END markers for temporary code. * Add comments/documentation to LLMQParams * Move code which determines if a commitment is required into IsCommitmentRequired This should make the code easier to read and also removes some duplication. The also changes the error types that are possible from 3 to 2 now. Instead of having "bad-qc-already-mined" and "bad-qc-not-mining-phase", there is only "bad-qc-not-allowed" now. * Use new parameter from consensus parames for the temporary fork
2018-11-23 15:42:09 +01:00
// long living quorum params
AddLLMQ(Consensus::LLMQType::LLMQ_TEST);
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
AddLLMQ(Consensus::LLMQType::LLMQ_TEST_INSTANTSEND);
AddLLMQ(Consensus::LLMQType::LLMQ_TEST_V17);
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
AddLLMQ(Consensus::LLMQType::LLMQ_TEST_DIP0024);
AddLLMQ(Consensus::LLMQType::LLMQ_TEST_PLATFORM);
consensus.llmqTypeChainLocks = Consensus::LLMQType::LLMQ_TEST;
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
consensus.llmqTypeDIP0024InstantSend = Consensus::LLMQType::LLMQ_TEST_DIP0024;
consensus.llmqTypePlatform = Consensus::LLMQType::LLMQ_TEST_PLATFORM;
2021-12-11 21:00:27 +01:00
consensus.llmqTypeMnhf = Consensus::LLMQType::LLMQ_TEST;
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
UpdateLLMQTestParametersFromArgs(args, Consensus::LLMQType::LLMQ_TEST);
UpdateLLMQTestParametersFromArgs(args, Consensus::LLMQType::LLMQ_TEST_INSTANTSEND);
UpdateLLMQInstantSendDIP0024FromArgs(args);
Implement and enforce DIP6 commitments (#2477) * Add LLMQ parameters to consensus params * Add DIP6 quorum commitment special TX * Implement CQuorumBlockProcessor which validates and handles commitments * Add quorum commitments to new blocks * Propagate QFCOMMITMENT messages to all nodes * Allow special transactions in blocks which have no inputs/outputs But only for TRANSACTION_QUORUM_COMMITMENT for now. * Add quorum commitments to self-crafted blocks in DIP3 tests * Add simple fork logic for current testnet This should avoid a fork on the current testnet. It only applies to the current chain which activated DIP3 at height 264000 and block 00000048e6e71d4bd90e7c456dcb94683ae832fcad13e1760d8283f7e89f332f. When we revert the chain to retest the DIP3 deployment, this fork logic can be removed again. * Use quorumVvecHash instead of quorumHash to make null commitments unique Implementation of https://github.com/dashpay/dips/pull/31 * Re-add quorum commitments after pruning mempool selected blocks * Refactor CQuorumBlockProcessor::ProcessBlock to have less nested if/else statements Also add BEGIN/END markers for temporary code. * Add comments/documentation to LLMQParams * Move code which determines if a commitment is required into IsCommitmentRequired This should make the code easier to read and also removes some duplication. The also changes the error types that are possible from 3 to 2 now. Instead of having "bad-qc-already-mined" and "bad-qc-not-mining-phase", there is only "bad-qc-not-allowed" now. * Use new parameter from consensus parames for the temporary fork
2018-11-23 15:42:09 +01:00
}
/**
* Allows modifying the Version Bits regtest parameters.
*/
Merge #21377: Speedy trial support for versionbits ffe33dfbd4c3b11e3475b022b6c1dd077613de79 chainparams: drop versionbits threshold to 90% for mainnnet and signet (Anthony Towns) f054f6bcd2c2ce5fea84cf8681013f85a444e7ea versionbits: simplify state transitions (Anthony Towns) 55ac5f568a3b73d6f1ef4654617fb76e8bcbccdf versionbits: Add explicit NEVER_ACTIVE deployments (Anthony Towns) dd07e6da48040dc7eae46bc7941db48d98a669fd fuzz: test versionbits delayed activation (Anthony Towns) dd85d5411c1702c8ae259610fe55050ba212e21e tests: test versionbits delayed activation (Anthony Towns) 73d4a706393e6dbd6b6d6b6428f8d3233ac0a2d8 versionbits: Add support for delayed activation (Anthony Towns) 9e6b65f6fa205eee5c3b99343988adcb8d320460 tests: clean up versionbits test (Anthony Towns) 593274445004506c921d5d851361aefb3434d744 tests: test ComputeBlockVersion for all deployments (Anthony Towns) 63879f0a4760c0c0f784029849cb5d21ee088abb tests: pull ComputeBlockVersion test into its own function (Anthony Towns) Pull request description: BIP9-based implementation of "speedy trial" activation specification, see https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018583.html Edge cases are tested by fuzzing added in #21380. ACKs for top commit: instagibbs: tACK https://github.com/bitcoin/bitcoin/pull/21377/commits/ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jnewbery: utACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 MarcoFalke: review ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 💈 achow101: re-ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 gmaxwell: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 benthecarman: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 Sjors: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jonatack: Initial approach ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 after a first pass of review, building and testing each commit, mostly looking at the changes and diffs. Will do a more high-level review iteration. A few minor comments follow to pick/choose/ignore. ariard: Code Review ACK ffe33df Tree-SHA512: f79a7146b2450057ee92155cbbbcec12cd64334236d9239c6bd7d31b32eec145a9781c320f178da7b44ababdb8808b84d9d22a40e0851e229ba6d224e3be747c
2021-04-15 03:33:47 +02:00
void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout, int min_activation_height, int64_t nWindowSize, int64_t nThresholdStart, int64_t nThresholdMin, int64_t nFalloffCoeff, int64_t nUseEHF)
{
consensus.vDeployments[d].nStartTime = nStartTime;
consensus.vDeployments[d].nTimeout = nTimeout;
Merge #21377: Speedy trial support for versionbits ffe33dfbd4c3b11e3475b022b6c1dd077613de79 chainparams: drop versionbits threshold to 90% for mainnnet and signet (Anthony Towns) f054f6bcd2c2ce5fea84cf8681013f85a444e7ea versionbits: simplify state transitions (Anthony Towns) 55ac5f568a3b73d6f1ef4654617fb76e8bcbccdf versionbits: Add explicit NEVER_ACTIVE deployments (Anthony Towns) dd07e6da48040dc7eae46bc7941db48d98a669fd fuzz: test versionbits delayed activation (Anthony Towns) dd85d5411c1702c8ae259610fe55050ba212e21e tests: test versionbits delayed activation (Anthony Towns) 73d4a706393e6dbd6b6d6b6428f8d3233ac0a2d8 versionbits: Add support for delayed activation (Anthony Towns) 9e6b65f6fa205eee5c3b99343988adcb8d320460 tests: clean up versionbits test (Anthony Towns) 593274445004506c921d5d851361aefb3434d744 tests: test ComputeBlockVersion for all deployments (Anthony Towns) 63879f0a4760c0c0f784029849cb5d21ee088abb tests: pull ComputeBlockVersion test into its own function (Anthony Towns) Pull request description: BIP9-based implementation of "speedy trial" activation specification, see https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018583.html Edge cases are tested by fuzzing added in #21380. ACKs for top commit: instagibbs: tACK https://github.com/bitcoin/bitcoin/pull/21377/commits/ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jnewbery: utACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 MarcoFalke: review ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 💈 achow101: re-ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 gmaxwell: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 benthecarman: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 Sjors: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jonatack: Initial approach ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 after a first pass of review, building and testing each commit, mostly looking at the changes and diffs. Will do a more high-level review iteration. A few minor comments follow to pick/choose/ignore. ariard: Code Review ACK ffe33df Tree-SHA512: f79a7146b2450057ee92155cbbbcec12cd64334236d9239c6bd7d31b32eec145a9781c320f178da7b44ababdb8808b84d9d22a40e0851e229ba6d224e3be747c
2021-04-15 03:33:47 +02:00
consensus.vDeployments[d].min_activation_height = min_activation_height;
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;
}
if (nUseEHF != -1) {
consensus.vDeployments[d].useEHF = nUseEHF > 0;
}
}
Merge #16060: Bury bip9 deployments e78aaf41f43d0e2ad78fa6d8dad61032c8ef73d0 [docs] Add release notes for burying bip 9 soft fork deployments (John Newbery) 8319e738f9f118025b332e4fa804d4c31e4113f4 [tests] Add coverage for the content of getblockchaininfo.softforks (James O'Beirne) 0328dcdcfcb56dc8918697716d7686be048ad0b3 [Consensus] Bury segwit deployment (John Newbery) 1c93b9b31c2ab7358f9d55f52dd46340397c906d [Consensus] Bury CSV deployment height (John Newbery) 3862e473f0cb71a762c0306b171b591341d58142 [rpc] Tidy up reporting of buried and ongoing softforks (John Newbery) Pull request description: This hardcodes CSV and segwit activation heights, similar to the BIP 90 buried deployments for BIPs 34, 65 and 66. CSV and segwit have been active for over 18 months. Hardcoding the activation height is a code simplification, makes it easier to understand segwit activation status, and reduces technical debt. This was originally attempted by jl2012 in #11398 and again by me in #12360. ACKs for top commit: ajtowns: ACK e78aaf41f43d0e2ad78fa6d8dad61032c8ef73d0 ; checked diff to previous acked commit, checked tests still work ariard: ACK e78aaf4, check diff, run the tests again and successfully activated csv/segwit heights on mainnet as expected. MarcoFalke: ACK e78aaf41f43d0e2ad78fa6d8dad61032c8ef73d0 (still didn't check if the mainnet block heights are correct, but the code looks good now) Tree-SHA512: 7e951829106e21a81725f7d3e236eddbb59349189740907bb47e33f5dbf95c43753ac1231f47ae7bee85c8c81b2146afcdfdc11deb1503947f23093a9c399912
2019-08-15 22:02:02 +02:00
void UpdateActivationParametersFromArgs(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);
void UpdateBIP147Parameters(int nActivationHeight)
{
consensus.BIP147Height = nActivationHeight;
}
void UpdateBIP147ParametersFromArgs(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
*/
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
void UpdateLLMQTestParameters(int size, int threshold, const Consensus::LLMQType llmqType)
{
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
auto params = ranges::find_if(consensus.llmqs, [llmqType](const auto& llmq){ return llmq.type == llmqType;});
assert(params != consensus.llmqs.end());
params->size = size;
params->minSize = threshold;
params->threshold = threshold;
params->dkgBadVotesThreshold = threshold;
}
/**
* Allows modifying the LLMQ type for InstantSend (DIP0024).
*/
void UpdateLLMQDIP0024InstantSend(Consensus::LLMQType llmqType)
{
consensus.llmqTypeDIP0024InstantSend = llmqType;
}
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
void UpdateLLMQTestParametersFromArgs(const ArgsManager& args, const Consensus::LLMQType llmqType);
void UpdateLLMQInstantSendDIP0024FromArgs(const ArgsManager& args);
};
static void MaybeUpdateHeights(const ArgsManager& args, Consensus::Params& consensus)
{
for (const std::string& arg : args.GetArgs("-testactivationheight")) {
const auto found{arg.find('@')};
if (found == std::string::npos) {
throw std::runtime_error(strprintf("Invalid format (%s) for -testactivationheight=name@height.", arg));
}
const auto name{arg.substr(0, found)};
const auto value{arg.substr(found + 1)};
int32_t height;
if (!ParseInt32(value, &height) || height < 0 || height >= std::numeric_limits<int>::max()) {
throw std::runtime_error(strprintf("Invalid height value (%s) for -testactivationheight=name@height.", arg));
}
if (name == "bip147") {
consensus.BIP147Height = int{height};
} else if (name == "bip34") {
consensus.BIP34Height = int{height};
} else if (name == "dersig") {
consensus.BIP66Height = int{height};
} else if (name == "cltv") {
consensus.BIP65Height = int{height};
} else if (name == "csv") {
consensus.CSVHeight = int{height};
} else if (name == "dip0020") {
consensus.DIP0020Height = int{height};
} else {
throw std::runtime_error(strprintf("Invalid name (%s) for -testactivationheight=name@height.", arg));
}
}
}
Merge #16060: Bury bip9 deployments e78aaf41f43d0e2ad78fa6d8dad61032c8ef73d0 [docs] Add release notes for burying bip 9 soft fork deployments (John Newbery) 8319e738f9f118025b332e4fa804d4c31e4113f4 [tests] Add coverage for the content of getblockchaininfo.softforks (James O'Beirne) 0328dcdcfcb56dc8918697716d7686be048ad0b3 [Consensus] Bury segwit deployment (John Newbery) 1c93b9b31c2ab7358f9d55f52dd46340397c906d [Consensus] Bury CSV deployment height (John Newbery) 3862e473f0cb71a762c0306b171b591341d58142 [rpc] Tidy up reporting of buried and ongoing softforks (John Newbery) Pull request description: This hardcodes CSV and segwit activation heights, similar to the BIP 90 buried deployments for BIPs 34, 65 and 66. CSV and segwit have been active for over 18 months. Hardcoding the activation height is a code simplification, makes it easier to understand segwit activation status, and reduces technical debt. This was originally attempted by jl2012 in #11398 and again by me in #12360. ACKs for top commit: ajtowns: ACK e78aaf41f43d0e2ad78fa6d8dad61032c8ef73d0 ; checked diff to previous acked commit, checked tests still work ariard: ACK e78aaf4, check diff, run the tests again and successfully activated csv/segwit heights on mainnet as expected. MarcoFalke: ACK e78aaf41f43d0e2ad78fa6d8dad61032c8ef73d0 (still didn't check if the mainnet block heights are correct, but the code looks good now) Tree-SHA512: 7e951829106e21a81725f7d3e236eddbb59349189740907bb47e33f5dbf95c43753ac1231f47ae7bee85c8c81b2146afcdfdc11deb1503947f23093a9c399912
2019-08-15 22:02:02 +02:00
void CRegTestParams::UpdateActivationParametersFromArgs(const ArgsManager& args)
{
MaybeUpdateHeights(args, consensus);
if (!args.IsArgSet("-vbparams")) return;
for (const std::string& strDeployment : args.GetArgs("-vbparams")) {
std::vector<std::string> vDeploymentParams = SplitString(strDeployment, ':');
Merge #21377: Speedy trial support for versionbits ffe33dfbd4c3b11e3475b022b6c1dd077613de79 chainparams: drop versionbits threshold to 90% for mainnnet and signet (Anthony Towns) f054f6bcd2c2ce5fea84cf8681013f85a444e7ea versionbits: simplify state transitions (Anthony Towns) 55ac5f568a3b73d6f1ef4654617fb76e8bcbccdf versionbits: Add explicit NEVER_ACTIVE deployments (Anthony Towns) dd07e6da48040dc7eae46bc7941db48d98a669fd fuzz: test versionbits delayed activation (Anthony Towns) dd85d5411c1702c8ae259610fe55050ba212e21e tests: test versionbits delayed activation (Anthony Towns) 73d4a706393e6dbd6b6d6b6428f8d3233ac0a2d8 versionbits: Add support for delayed activation (Anthony Towns) 9e6b65f6fa205eee5c3b99343988adcb8d320460 tests: clean up versionbits test (Anthony Towns) 593274445004506c921d5d851361aefb3434d744 tests: test ComputeBlockVersion for all deployments (Anthony Towns) 63879f0a4760c0c0f784029849cb5d21ee088abb tests: pull ComputeBlockVersion test into its own function (Anthony Towns) Pull request description: BIP9-based implementation of "speedy trial" activation specification, see https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018583.html Edge cases are tested by fuzzing added in #21380. ACKs for top commit: instagibbs: tACK https://github.com/bitcoin/bitcoin/pull/21377/commits/ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jnewbery: utACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 MarcoFalke: review ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 💈 achow101: re-ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 gmaxwell: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 benthecarman: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 Sjors: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jonatack: Initial approach ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 after a first pass of review, building and testing each commit, mostly looking at the changes and diffs. Will do a more high-level review iteration. A few minor comments follow to pick/choose/ignore. ariard: Code Review ACK ffe33df Tree-SHA512: f79a7146b2450057ee92155cbbbcec12cd64334236d9239c6bd7d31b32eec145a9781c320f178da7b44ababdb8808b84d9d22a40e0851e229ba6d224e3be747c
2021-04-15 03:33:47 +02:00
if (vDeploymentParams.size() != 3 && vDeploymentParams.size() != 4 && vDeploymentParams.size() != 6 && vDeploymentParams.size() != 9) {
throw std::runtime_error("Version bits parameters malformed, expecting "
"<deployment>:<start>:<end> or "
Merge #21377: Speedy trial support for versionbits ffe33dfbd4c3b11e3475b022b6c1dd077613de79 chainparams: drop versionbits threshold to 90% for mainnnet and signet (Anthony Towns) f054f6bcd2c2ce5fea84cf8681013f85a444e7ea versionbits: simplify state transitions (Anthony Towns) 55ac5f568a3b73d6f1ef4654617fb76e8bcbccdf versionbits: Add explicit NEVER_ACTIVE deployments (Anthony Towns) dd07e6da48040dc7eae46bc7941db48d98a669fd fuzz: test versionbits delayed activation (Anthony Towns) dd85d5411c1702c8ae259610fe55050ba212e21e tests: test versionbits delayed activation (Anthony Towns) 73d4a706393e6dbd6b6d6b6428f8d3233ac0a2d8 versionbits: Add support for delayed activation (Anthony Towns) 9e6b65f6fa205eee5c3b99343988adcb8d320460 tests: clean up versionbits test (Anthony Towns) 593274445004506c921d5d851361aefb3434d744 tests: test ComputeBlockVersion for all deployments (Anthony Towns) 63879f0a4760c0c0f784029849cb5d21ee088abb tests: pull ComputeBlockVersion test into its own function (Anthony Towns) Pull request description: BIP9-based implementation of "speedy trial" activation specification, see https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018583.html Edge cases are tested by fuzzing added in #21380. ACKs for top commit: instagibbs: tACK https://github.com/bitcoin/bitcoin/pull/21377/commits/ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jnewbery: utACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 MarcoFalke: review ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 💈 achow101: re-ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 gmaxwell: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 benthecarman: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 Sjors: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jonatack: Initial approach ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 after a first pass of review, building and testing each commit, mostly looking at the changes and diffs. Will do a more high-level review iteration. A few minor comments follow to pick/choose/ignore. ariard: Code Review ACK ffe33df Tree-SHA512: f79a7146b2450057ee92155cbbbcec12cd64334236d9239c6bd7d31b32eec145a9781c320f178da7b44ababdb8808b84d9d22a40e0851e229ba6d224e3be747c
2021-04-15 03:33:47 +02:00
"<deployment>:<start>:<end>:<min_activation_height> or "
"<deployment>:<start>:<end>:<min_activation_height>:<window>:<threshold> or "
"<deployment>:<start>:<end>:<min_activation_height>:<window>:<thresholdstart>:<thresholdmin>:<falloffcoeff>:<useehf>");
}
int64_t nStartTime, nTimeout, nWindowSize = -1, nThresholdStart = -1, nThresholdMin = -1, nFalloffCoeff = -1, nUseEHF = -1;
Merge #21377: Speedy trial support for versionbits ffe33dfbd4c3b11e3475b022b6c1dd077613de79 chainparams: drop versionbits threshold to 90% for mainnnet and signet (Anthony Towns) f054f6bcd2c2ce5fea84cf8681013f85a444e7ea versionbits: simplify state transitions (Anthony Towns) 55ac5f568a3b73d6f1ef4654617fb76e8bcbccdf versionbits: Add explicit NEVER_ACTIVE deployments (Anthony Towns) dd07e6da48040dc7eae46bc7941db48d98a669fd fuzz: test versionbits delayed activation (Anthony Towns) dd85d5411c1702c8ae259610fe55050ba212e21e tests: test versionbits delayed activation (Anthony Towns) 73d4a706393e6dbd6b6d6b6428f8d3233ac0a2d8 versionbits: Add support for delayed activation (Anthony Towns) 9e6b65f6fa205eee5c3b99343988adcb8d320460 tests: clean up versionbits test (Anthony Towns) 593274445004506c921d5d851361aefb3434d744 tests: test ComputeBlockVersion for all deployments (Anthony Towns) 63879f0a4760c0c0f784029849cb5d21ee088abb tests: pull ComputeBlockVersion test into its own function (Anthony Towns) Pull request description: BIP9-based implementation of "speedy trial" activation specification, see https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018583.html Edge cases are tested by fuzzing added in #21380. ACKs for top commit: instagibbs: tACK https://github.com/bitcoin/bitcoin/pull/21377/commits/ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jnewbery: utACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 MarcoFalke: review ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 💈 achow101: re-ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 gmaxwell: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 benthecarman: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 Sjors: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jonatack: Initial approach ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 after a first pass of review, building and testing each commit, mostly looking at the changes and diffs. Will do a more high-level review iteration. A few minor comments follow to pick/choose/ignore. ariard: Code Review ACK ffe33df Tree-SHA512: f79a7146b2450057ee92155cbbbcec12cd64334236d9239c6bd7d31b32eec145a9781c320f178da7b44ababdb8808b84d9d22a40e0851e229ba6d224e3be747c
2021-04-15 03:33:47 +02:00
int min_activation_height = 0;
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]));
}
Merge #21377: Speedy trial support for versionbits ffe33dfbd4c3b11e3475b022b6c1dd077613de79 chainparams: drop versionbits threshold to 90% for mainnnet and signet (Anthony Towns) f054f6bcd2c2ce5fea84cf8681013f85a444e7ea versionbits: simplify state transitions (Anthony Towns) 55ac5f568a3b73d6f1ef4654617fb76e8bcbccdf versionbits: Add explicit NEVER_ACTIVE deployments (Anthony Towns) dd07e6da48040dc7eae46bc7941db48d98a669fd fuzz: test versionbits delayed activation (Anthony Towns) dd85d5411c1702c8ae259610fe55050ba212e21e tests: test versionbits delayed activation (Anthony Towns) 73d4a706393e6dbd6b6d6b6428f8d3233ac0a2d8 versionbits: Add support for delayed activation (Anthony Towns) 9e6b65f6fa205eee5c3b99343988adcb8d320460 tests: clean up versionbits test (Anthony Towns) 593274445004506c921d5d851361aefb3434d744 tests: test ComputeBlockVersion for all deployments (Anthony Towns) 63879f0a4760c0c0f784029849cb5d21ee088abb tests: pull ComputeBlockVersion test into its own function (Anthony Towns) Pull request description: BIP9-based implementation of "speedy trial" activation specification, see https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018583.html Edge cases are tested by fuzzing added in #21380. ACKs for top commit: instagibbs: tACK https://github.com/bitcoin/bitcoin/pull/21377/commits/ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jnewbery: utACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 MarcoFalke: review ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 💈 achow101: re-ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 gmaxwell: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 benthecarman: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 Sjors: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jonatack: Initial approach ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 after a first pass of review, building and testing each commit, mostly looking at the changes and diffs. Will do a more high-level review iteration. A few minor comments follow to pick/choose/ignore. ariard: Code Review ACK ffe33df Tree-SHA512: f79a7146b2450057ee92155cbbbcec12cd64334236d9239c6bd7d31b32eec145a9781c320f178da7b44ababdb8808b84d9d22a40e0851e229ba6d224e3be747c
2021-04-15 03:33:47 +02:00
if (vDeploymentParams.size() >= 4 && !ParseInt32(vDeploymentParams[3], &min_activation_height)) {
throw std::runtime_error(strprintf("Invalid min_activation_height (%s)", vDeploymentParams[3]));
}
if (vDeploymentParams.size() >= 6) {
if (!ParseInt64(vDeploymentParams[4], &nWindowSize)) {
throw std::runtime_error(strprintf("Invalid nWindowSize (%s)", vDeploymentParams[4]));
}
Merge #21377: Speedy trial support for versionbits ffe33dfbd4c3b11e3475b022b6c1dd077613de79 chainparams: drop versionbits threshold to 90% for mainnnet and signet (Anthony Towns) f054f6bcd2c2ce5fea84cf8681013f85a444e7ea versionbits: simplify state transitions (Anthony Towns) 55ac5f568a3b73d6f1ef4654617fb76e8bcbccdf versionbits: Add explicit NEVER_ACTIVE deployments (Anthony Towns) dd07e6da48040dc7eae46bc7941db48d98a669fd fuzz: test versionbits delayed activation (Anthony Towns) dd85d5411c1702c8ae259610fe55050ba212e21e tests: test versionbits delayed activation (Anthony Towns) 73d4a706393e6dbd6b6d6b6428f8d3233ac0a2d8 versionbits: Add support for delayed activation (Anthony Towns) 9e6b65f6fa205eee5c3b99343988adcb8d320460 tests: clean up versionbits test (Anthony Towns) 593274445004506c921d5d851361aefb3434d744 tests: test ComputeBlockVersion for all deployments (Anthony Towns) 63879f0a4760c0c0f784029849cb5d21ee088abb tests: pull ComputeBlockVersion test into its own function (Anthony Towns) Pull request description: BIP9-based implementation of "speedy trial" activation specification, see https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018583.html Edge cases are tested by fuzzing added in #21380. ACKs for top commit: instagibbs: tACK https://github.com/bitcoin/bitcoin/pull/21377/commits/ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jnewbery: utACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 MarcoFalke: review ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 💈 achow101: re-ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 gmaxwell: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 benthecarman: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 Sjors: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jonatack: Initial approach ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 after a first pass of review, building and testing each commit, mostly looking at the changes and diffs. Will do a more high-level review iteration. A few minor comments follow to pick/choose/ignore. ariard: Code Review ACK ffe33df Tree-SHA512: f79a7146b2450057ee92155cbbbcec12cd64334236d9239c6bd7d31b32eec145a9781c320f178da7b44ababdb8808b84d9d22a40e0851e229ba6d224e3be747c
2021-04-15 03:33:47 +02:00
if (!ParseInt64(vDeploymentParams[5], &nThresholdStart)) {
throw std::runtime_error(strprintf("Invalid nThresholdStart (%s)", vDeploymentParams[5]));
}
}
Merge #21377: Speedy trial support for versionbits ffe33dfbd4c3b11e3475b022b6c1dd077613de79 chainparams: drop versionbits threshold to 90% for mainnnet and signet (Anthony Towns) f054f6bcd2c2ce5fea84cf8681013f85a444e7ea versionbits: simplify state transitions (Anthony Towns) 55ac5f568a3b73d6f1ef4654617fb76e8bcbccdf versionbits: Add explicit NEVER_ACTIVE deployments (Anthony Towns) dd07e6da48040dc7eae46bc7941db48d98a669fd fuzz: test versionbits delayed activation (Anthony Towns) dd85d5411c1702c8ae259610fe55050ba212e21e tests: test versionbits delayed activation (Anthony Towns) 73d4a706393e6dbd6b6d6b6428f8d3233ac0a2d8 versionbits: Add support for delayed activation (Anthony Towns) 9e6b65f6fa205eee5c3b99343988adcb8d320460 tests: clean up versionbits test (Anthony Towns) 593274445004506c921d5d851361aefb3434d744 tests: test ComputeBlockVersion for all deployments (Anthony Towns) 63879f0a4760c0c0f784029849cb5d21ee088abb tests: pull ComputeBlockVersion test into its own function (Anthony Towns) Pull request description: BIP9-based implementation of "speedy trial" activation specification, see https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018583.html Edge cases are tested by fuzzing added in #21380. ACKs for top commit: instagibbs: tACK https://github.com/bitcoin/bitcoin/pull/21377/commits/ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jnewbery: utACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 MarcoFalke: review ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 💈 achow101: re-ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 gmaxwell: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 benthecarman: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 Sjors: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jonatack: Initial approach ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 after a first pass of review, building and testing each commit, mostly looking at the changes and diffs. Will do a more high-level review iteration. A few minor comments follow to pick/choose/ignore. ariard: Code Review ACK ffe33df Tree-SHA512: f79a7146b2450057ee92155cbbbcec12cd64334236d9239c6bd7d31b32eec145a9781c320f178da7b44ababdb8808b84d9d22a40e0851e229ba6d224e3be747c
2021-04-15 03:33:47 +02:00
if (vDeploymentParams.size() == 9) {
if (!ParseInt64(vDeploymentParams[6], &nThresholdMin)) {
throw std::runtime_error(strprintf("Invalid nThresholdMin (%s)", vDeploymentParams[6]));
}
Merge #21377: Speedy trial support for versionbits ffe33dfbd4c3b11e3475b022b6c1dd077613de79 chainparams: drop versionbits threshold to 90% for mainnnet and signet (Anthony Towns) f054f6bcd2c2ce5fea84cf8681013f85a444e7ea versionbits: simplify state transitions (Anthony Towns) 55ac5f568a3b73d6f1ef4654617fb76e8bcbccdf versionbits: Add explicit NEVER_ACTIVE deployments (Anthony Towns) dd07e6da48040dc7eae46bc7941db48d98a669fd fuzz: test versionbits delayed activation (Anthony Towns) dd85d5411c1702c8ae259610fe55050ba212e21e tests: test versionbits delayed activation (Anthony Towns) 73d4a706393e6dbd6b6d6b6428f8d3233ac0a2d8 versionbits: Add support for delayed activation (Anthony Towns) 9e6b65f6fa205eee5c3b99343988adcb8d320460 tests: clean up versionbits test (Anthony Towns) 593274445004506c921d5d851361aefb3434d744 tests: test ComputeBlockVersion for all deployments (Anthony Towns) 63879f0a4760c0c0f784029849cb5d21ee088abb tests: pull ComputeBlockVersion test into its own function (Anthony Towns) Pull request description: BIP9-based implementation of "speedy trial" activation specification, see https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018583.html Edge cases are tested by fuzzing added in #21380. ACKs for top commit: instagibbs: tACK https://github.com/bitcoin/bitcoin/pull/21377/commits/ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jnewbery: utACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 MarcoFalke: review ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 💈 achow101: re-ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 gmaxwell: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 benthecarman: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 Sjors: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jonatack: Initial approach ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 after a first pass of review, building and testing each commit, mostly looking at the changes and diffs. Will do a more high-level review iteration. A few minor comments follow to pick/choose/ignore. ariard: Code Review ACK ffe33df Tree-SHA512: f79a7146b2450057ee92155cbbbcec12cd64334236d9239c6bd7d31b32eec145a9781c320f178da7b44ababdb8808b84d9d22a40e0851e229ba6d224e3be747c
2021-04-15 03:33:47 +02:00
if (!ParseInt64(vDeploymentParams[7], &nFalloffCoeff)) {
throw std::runtime_error(strprintf("Invalid nFalloffCoeff (%s)", vDeploymentParams[7]));
}
Merge #21377: Speedy trial support for versionbits ffe33dfbd4c3b11e3475b022b6c1dd077613de79 chainparams: drop versionbits threshold to 90% for mainnnet and signet (Anthony Towns) f054f6bcd2c2ce5fea84cf8681013f85a444e7ea versionbits: simplify state transitions (Anthony Towns) 55ac5f568a3b73d6f1ef4654617fb76e8bcbccdf versionbits: Add explicit NEVER_ACTIVE deployments (Anthony Towns) dd07e6da48040dc7eae46bc7941db48d98a669fd fuzz: test versionbits delayed activation (Anthony Towns) dd85d5411c1702c8ae259610fe55050ba212e21e tests: test versionbits delayed activation (Anthony Towns) 73d4a706393e6dbd6b6d6b6428f8d3233ac0a2d8 versionbits: Add support for delayed activation (Anthony Towns) 9e6b65f6fa205eee5c3b99343988adcb8d320460 tests: clean up versionbits test (Anthony Towns) 593274445004506c921d5d851361aefb3434d744 tests: test ComputeBlockVersion for all deployments (Anthony Towns) 63879f0a4760c0c0f784029849cb5d21ee088abb tests: pull ComputeBlockVersion test into its own function (Anthony Towns) Pull request description: BIP9-based implementation of "speedy trial" activation specification, see https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018583.html Edge cases are tested by fuzzing added in #21380. ACKs for top commit: instagibbs: tACK https://github.com/bitcoin/bitcoin/pull/21377/commits/ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jnewbery: utACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 MarcoFalke: review ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 💈 achow101: re-ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 gmaxwell: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 benthecarman: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 Sjors: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jonatack: Initial approach ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 after a first pass of review, building and testing each commit, mostly looking at the changes and diffs. Will do a more high-level review iteration. A few minor comments follow to pick/choose/ignore. ariard: Code Review ACK ffe33df Tree-SHA512: f79a7146b2450057ee92155cbbbcec12cd64334236d9239c6bd7d31b32eec145a9781c320f178da7b44ababdb8808b84d9d22a40e0851e229ba6d224e3be747c
2021-04-15 03:33:47 +02:00
if (!ParseInt64(vDeploymentParams[8], &nUseEHF)) {
throw std::runtime_error(strprintf("Invalid nUseEHF (%s)", vDeploymentParams[8]));
}
}
bool found = false;
for (int j=0; j < (int)Consensus::MAX_VERSION_BITS_DEPLOYMENTS; ++j) {
if (vDeploymentParams[0] == VersionBitsDeploymentInfo[j].name) {
Merge #21377: Speedy trial support for versionbits ffe33dfbd4c3b11e3475b022b6c1dd077613de79 chainparams: drop versionbits threshold to 90% for mainnnet and signet (Anthony Towns) f054f6bcd2c2ce5fea84cf8681013f85a444e7ea versionbits: simplify state transitions (Anthony Towns) 55ac5f568a3b73d6f1ef4654617fb76e8bcbccdf versionbits: Add explicit NEVER_ACTIVE deployments (Anthony Towns) dd07e6da48040dc7eae46bc7941db48d98a669fd fuzz: test versionbits delayed activation (Anthony Towns) dd85d5411c1702c8ae259610fe55050ba212e21e tests: test versionbits delayed activation (Anthony Towns) 73d4a706393e6dbd6b6d6b6428f8d3233ac0a2d8 versionbits: Add support for delayed activation (Anthony Towns) 9e6b65f6fa205eee5c3b99343988adcb8d320460 tests: clean up versionbits test (Anthony Towns) 593274445004506c921d5d851361aefb3434d744 tests: test ComputeBlockVersion for all deployments (Anthony Towns) 63879f0a4760c0c0f784029849cb5d21ee088abb tests: pull ComputeBlockVersion test into its own function (Anthony Towns) Pull request description: BIP9-based implementation of "speedy trial" activation specification, see https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018583.html Edge cases are tested by fuzzing added in #21380. ACKs for top commit: instagibbs: tACK https://github.com/bitcoin/bitcoin/pull/21377/commits/ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jnewbery: utACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 MarcoFalke: review ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 💈 achow101: re-ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 gmaxwell: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 benthecarman: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 Sjors: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jonatack: Initial approach ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 after a first pass of review, building and testing each commit, mostly looking at the changes and diffs. Will do a more high-level review iteration. A few minor comments follow to pick/choose/ignore. ariard: Code Review ACK ffe33df Tree-SHA512: f79a7146b2450057ee92155cbbbcec12cd64334236d9239c6bd7d31b32eec145a9781c320f178da7b44ababdb8808b84d9d22a40e0851e229ba6d224e3be747c
2021-04-15 03:33:47 +02:00
UpdateVersionBitsParameters(Consensus::DeploymentPos(j), nStartTime, nTimeout, min_activation_height, nWindowSize, nThresholdStart, nThresholdMin, nFalloffCoeff, nUseEHF);
found = true;
Merge #21377: Speedy trial support for versionbits ffe33dfbd4c3b11e3475b022b6c1dd077613de79 chainparams: drop versionbits threshold to 90% for mainnnet and signet (Anthony Towns) f054f6bcd2c2ce5fea84cf8681013f85a444e7ea versionbits: simplify state transitions (Anthony Towns) 55ac5f568a3b73d6f1ef4654617fb76e8bcbccdf versionbits: Add explicit NEVER_ACTIVE deployments (Anthony Towns) dd07e6da48040dc7eae46bc7941db48d98a669fd fuzz: test versionbits delayed activation (Anthony Towns) dd85d5411c1702c8ae259610fe55050ba212e21e tests: test versionbits delayed activation (Anthony Towns) 73d4a706393e6dbd6b6d6b6428f8d3233ac0a2d8 versionbits: Add support for delayed activation (Anthony Towns) 9e6b65f6fa205eee5c3b99343988adcb8d320460 tests: clean up versionbits test (Anthony Towns) 593274445004506c921d5d851361aefb3434d744 tests: test ComputeBlockVersion for all deployments (Anthony Towns) 63879f0a4760c0c0f784029849cb5d21ee088abb tests: pull ComputeBlockVersion test into its own function (Anthony Towns) Pull request description: BIP9-based implementation of "speedy trial" activation specification, see https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018583.html Edge cases are tested by fuzzing added in #21380. ACKs for top commit: instagibbs: tACK https://github.com/bitcoin/bitcoin/pull/21377/commits/ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jnewbery: utACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 MarcoFalke: review ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 💈 achow101: re-ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 gmaxwell: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 benthecarman: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 Sjors: ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 jonatack: Initial approach ACK ffe33dfbd4c3b11e3475b022b6c1dd077613de79 after a first pass of review, building and testing each commit, mostly looking at the changes and diffs. Will do a more high-level review iteration. A few minor comments follow to pick/choose/ignore. ariard: Code Review ACK ffe33df Tree-SHA512: f79a7146b2450057ee92155cbbbcec12cd64334236d9239c6bd7d31b32eec145a9781c320f178da7b44ababdb8808b84d9d22a40e0851e229ba6d224e3be747c
2021-04-15 03:33:47 +02:00
LogPrintf("Setting version bits activation parameters for %s to start=%ld, timeout=%ld, min_activation_height=%ld, window=%ld, thresholdstart=%ld, thresholdmin=%ld, falloffcoeff=%ld, useehf=%ld\n",
vDeploymentParams[0], nStartTime, nTimeout, min_activation_height, nWindowSize, nThresholdStart, nThresholdMin, nFalloffCoeff, nUseEHF);
break;
}
}
if (!found) {
throw std::runtime_error(strprintf("Invalid deployment (%s)", vDeploymentParams[0]));
}
}
}
void CRegTestParams::UpdateDIP3ParametersFromArgs(const ArgsManager& args)
{
if (!args.IsArgSet("-dip3params")) return;
std::string strParams = args.GetArg("-dip3params", "");
std::vector<std::string> vParams = SplitString(strParams, ':');
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);
}
void CRegTestParams::UpdateDIP8ParametersFromArgs(const ArgsManager& args)
{
if (!args.IsArgSet("-dip8params")) return;
std::string strParams = args.GetArg("-dip8params", "");
std::vector<std::string> vParams = SplitString(strParams, ':');
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);
}
void CRegTestParams::UpdateBIP147ParametersFromArgs(const ArgsManager& args)
{
if (!args.IsArgSet("-bip147height")) return;
int nBIP147Height;
const std::string strParams = args.GetArg("-bip147height", "");
if (!ParseInt32(strParams, &nBIP147Height)) {
throw std::runtime_error(strprintf("Invalid activation height (%s)", strParams));
}
LogPrintf("Setting BIP147 parameters to activation=%lld\n", nBIP147Height);
UpdateBIP147Parameters(nBIP147Height);
}
void CRegTestParams::UpdateBudgetParametersFromArgs(const ArgsManager& args)
{
if (!args.IsArgSet("-budgetparams")) return;
std::string strParams = args.GetArg("-budgetparams", "");
std::vector<std::string> vParams = SplitString(strParams, ':');
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);
}
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
void CRegTestParams::UpdateLLMQTestParametersFromArgs(const ArgsManager& args, const Consensus::LLMQType llmqType)
{
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
assert(llmqType == Consensus::LLMQType::LLMQ_TEST || llmqType == Consensus::LLMQType::LLMQ_TEST_INSTANTSEND);
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
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, "");
std::vector<std::string> vParams = SplitString(strParams, ':');
if (vParams.size() != 2) {
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
throw std::runtime_error(strprintf("%s parameters malformed, expecting <size>:<threshold>", llmq_name));
}
int size, threshold;
if (!ParseInt32(vParams[0], &size)) {
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
throw std::runtime_error(strprintf("Invalid %s size (%s)", llmq_name, vParams[0]));
}
if (!ParseInt32(vParams[1], &threshold)) {
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
throw std::runtime_error(strprintf("Invalid %s threshold (%s)", llmq_name, vParams[1]));
}
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
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);
}
void CRegTestParams::UpdateLLMQInstantSendDIP0024FromArgs(const ArgsManager& args)
{
if (!args.IsArgSet("-llmqtestinstantsenddip0024")) return;
const auto& llmq_params_opt = GetLLMQ(consensus.llmqTypeDIP0024InstantSend);
assert(llmq_params_opt.has_value());
std::string strLLMQType = gArgs.GetArg("-llmqtestinstantsenddip0024", std::string(llmq_params_opt->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 -llmqtestinstantsenddip0024.");
}
LogPrintf("Setting llmqtestinstantsenddip0024 to %ld\n", ToUnderlying(llmqType));
UpdateLLMQDIP0024InstantSend(llmqType);
}
void CDevNetParams::UpdateDevnetSubsidyAndDiffParametersFromArgs(const ArgsManager& args)
{
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);
}
void CDevNetParams::UpdateDevnetLLMQChainLocksFromArgs(const ArgsManager& args)
{
if (!args.IsArgSet("-llmqchainlocks")) return;
const auto& llmq_params_opt = GetLLMQ(consensus.llmqTypeChainLocks);
assert(llmq_params_opt.has_value());
std::string strLLMQType = gArgs.GetArg("-llmqchainlocks", std::string(llmq_params_opt->name));
Consensus::LLMQType llmqType = Consensus::LLMQType::LLMQ_NONE;
for (const auto& params : consensus.llmqs) {
if (params.name == strLLMQType) {
if (params.useRotation) {
throw std::runtime_error("LLMQ type specified for -llmqchainlocks must NOT use rotation");
}
llmqType = params.type;
}
}
if (llmqType == Consensus::LLMQType::LLMQ_NONE) {
throw std::runtime_error("Invalid LLMQ type specified for -llmqchainlocks.");
}
LogPrintf("Setting llmqchainlocks to size=%ld\n", static_cast<uint8_t>(llmqType));
UpdateDevnetLLMQChainLocks(llmqType);
}
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
void CDevNetParams::UpdateDevnetLLMQInstantSendDIP0024FromArgs(const ArgsManager& args)
{
if (!args.IsArgSet("-llmqinstantsenddip0024")) return;
const auto& llmq_params_opt = GetLLMQ(consensus.llmqTypeDIP0024InstantSend);
assert(llmq_params_opt.has_value());
std::string strLLMQType = gArgs.GetArg("-llmqinstantsenddip0024", std::string(llmq_params_opt->name));
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
Consensus::LLMQType llmqType = Consensus::LLMQType::LLMQ_NONE;
for (const auto& params : consensus.llmqs) {
if (params.name == strLLMQType) {
if (!params.useRotation) {
throw std::runtime_error("LLMQ type specified for -llmqinstantsenddip0024 must use rotation");
}
feat: implement quorum rotation and updated LLMQ parameters (#4752) * Added GET_SNAPSHOT_INFO message handling * Quorum members by rotation * Quorum utils functions * Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client * Storing QuorumSnaphots in evoDB when requesting them * Added DIP Enforcement param * quorumIndex cache * Quorum Rotation deployment control * Usage of Bitsets for storing CQuorumSnapshots * Correct handling of early quorum quarters * More asserts * Corrections * Handling of quorumIndex * Refactoring of truncate mechanism * Various fixes * Interface correction * Added template type for indexed cache * Added quorumIndex into commitmenHash * Various changes * Needs to update maqQuorumsCache along with indexedQuorumsCache * Added CFinalCommitment version 2 * Renamed variables * Fixes * Refactoring & correct caching of quorumMembers by rotation * Added assertions * Refactoring * Interface change * Handling of previous DKG session failure * Applied refactoring * Build quarter members improvments * Merge Quorum Rotation and Decreased fee into one deployment (DIP24) * Added new LLMQ Type * Added functional tests + refactoring * Refactoring * Spreaded Quorum creation and Quorum Index adaptation * quorumIndex adaptations * Added quorumIndex in CFinalCommitment * Latest work * Final refactoring * Batch of refactoring * Fixes for tests * Fix for CFinalCommitment * Fix for Quorums * Fix * Small changes * Thread sync fic * Safety changes * Reuse mns when needed * Refactoring * More refactoring * Fixes for rotationinfo handling * Fix for rotation of members * Correct order of MNs lists in Quorum Snapshots * Adding extra logs * Sync rotation quorums + qrinfo changes * Fix + extra logs * Removed redundant field * Fix for null final commitment + refactoring * Added timers in tests * Fix for qrinfo message: quorumdiff and merkleRootQuorums * Small changes for rotation test * Remove reading from scanQuorumCache * Added quorum list output * Crash fix * Experimental commit * apply changes to specialtxman.cpp from specialtx.cpp * all the changes * substancially speed up feature_llmq_rotation.py * reenable asserts, add check for reorgs * Refactoring * Added extra logs * format * trivial * drop extra boost includes * drop ContainsMN * fix ScanQuorums * check quorum hash and index in CFinalCommitment::Verify * fix/tweak tests * IsQuorumRotationEnabled should be aware of the context * Calculating members based on earlier block. * Fix for Quorum Members Cache * Removed duplicate size of baseBlockHashes * Adaptations of qrinfo to -8 mn lists * Introduction of llmqTypeDIP24InstantSend * Adaptation for llmqTypeDIP24InstantSend * Adaptations for IS * bump protocol version * Added feature_llmq_is_migration test * Various cleanups * use unordered_lru_cache for quorumSnapshotCache * trivial refactor ComputeQuorumMembersByQuarterRotation * Reduced CFinalCommitment::quorumIndex from 32 to 16 bits * Keep verified LLMQ relay connections * Experimental Relay connection fix * Fix for EnsureQuorumConnections rotation * Using only valid Mns for checking * Override of nPowTargetSpacing (devnet only) * Show penalty score in masternode rpc * fixups * Rotation refactoring * Update src/chainparams.cpp * Replaced LogPrintf with LogPrint * IS locking fix once DIP24 activation * Various cleanup * Updated MIN_MASTERNODE_PROTO_VERSION * Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums * Renamed field lastQuorumHashPerIndex * Renamed to DIP0024 * chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024 Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 16:46:04 +02:00
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);
}
void CDevNetParams::UpdateDevnetLLMQPlatformFromArgs(const ArgsManager& args)
{
if (!args.IsArgSet("-llmqplatform")) return;
const auto& llmq_params_opt = GetLLMQ(consensus.llmqTypePlatform);
assert(llmq_params_opt.has_value());
std::string strLLMQType = gArgs.GetArg("-llmqplatform", std::string(llmq_params_opt->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 -llmqplatform.");
}
LogPrintf("Setting llmqplatform to size=%ld\n", static_cast<uint8_t>(llmqType));
UpdateDevnetLLMQPlatform(llmqType);
}
void CDevNetParams::UpdateDevnetLLMQMnhfFromArgs(const ArgsManager& args)
{
if (!args.IsArgSet("-llmqmnhf")) return;
const auto& llmq_params_opt = GetLLMQ(consensus.llmqTypeMnhf);
assert(llmq_params_opt.has_value());
std::string strLLMQType = gArgs.GetArg("-llmqmnhf", std::string(llmq_params_opt->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 -llmqmnhf.");
}
LogPrintf("Setting llmqmnhf to size=%ld\n", static_cast<uint8_t>(llmqType));
UpdateDevnetLLMQMnhf(llmqType);
}
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);
}
void CDevNetParams::UpdateLLMQDevnetParametersFromArgs(const ArgsManager& args)
{
if (!args.IsArgSet("-llmqdevnetparams")) return;
std::string strParams = args.GetArg("-llmqdevnetparams", "");
std::vector<std::string> vParams = SplitString(strParams, ':');
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);
}
static std::unique_ptr<const CChainParams> globalChainParams;
const CChainParams &Params() {
assert(globalChainParams);
return *globalChainParams;
}
std::unique_ptr<const CChainParams> CreateChainParams(const ArgsManager& args, const std::string& chain)
{
if (chain == CBaseChainParams::MAIN) {
return std::unique_ptr<CChainParams>(new CMainParams());
} else if (chain == CBaseChainParams::TESTNET) {
return std::unique_ptr<CChainParams>(new CTestNetParams());
} else if (chain == CBaseChainParams::DEVNET) {
return std::unique_ptr<CChainParams>(new CDevNetParams(args));
} else if (chain == CBaseChainParams::REGTEST) {
return std::unique_ptr<CChainParams>(new CRegTestParams(args));
}
throw std::runtime_error(strprintf("%s: Unknown chain %s.", __func__, chain));
}
void SelectParams(const std::string& network)
{
SelectBaseParams(network);
globalChainParams = CreateChainParams(gArgs, network);
}