Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
771c2c2
Added GET_SNAPSHOT_INFO message handling
ogabrielides Mar 29, 2022
40562e1
Quorum members by rotation
ogabrielides Sep 30, 2021
b7a0945
Quorum utils functions
ogabrielides Mar 29, 2022
42cb0bc
Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client
ogabrielides Mar 29, 2022
f20720a
Storing QuorumSnaphots in evoDB when requesting them
ogabrielides Mar 29, 2022
ef7beb1
Added DIP Enforcement param
ogabrielides Oct 12, 2021
d5e273b
quorumIndex cache
ogabrielides Oct 18, 2021
bc2abda
Quorum Rotation deployment control
ogabrielides Apr 5, 2022
f2bef5b
Usage of Bitsets for storing CQuorumSnapshots
ogabrielides Oct 18, 2021
1143773
Correct handling of early quorum quarters
ogabrielides Oct 19, 2021
8eac583
More asserts
ogabrielides Oct 29, 2021
765629b
Corrections
ogabrielides Mar 29, 2022
9651229
Handling of quorumIndex
ogabrielides Apr 5, 2022
d149b58
Refactoring of truncate mechanism
ogabrielides Oct 22, 2021
905147c
Various fixes
ogabrielides Oct 25, 2021
8274b32
Interface correction
ogabrielides Oct 25, 2021
f330530
Added template type for indexed cache
ogabrielides Oct 25, 2021
ae6d8e8
Added quorumIndex into commitmenHash
ogabrielides Oct 25, 2021
f5c3330
Various changes
ogabrielides Oct 25, 2021
24a6837
Needs to update maqQuorumsCache along with indexedQuorumsCache
ogabrielides Oct 26, 2021
b93a7fa
Added CFinalCommitment version 2
ogabrielides Oct 27, 2021
f9d4b7b
Renamed variables
ogabrielides Oct 27, 2021
caff9e4
Fixes
ogabrielides Oct 27, 2021
4c32ee4
Refactoring & correct caching of quorumMembers by rotation
ogabrielides Oct 27, 2021
c77a9d0
Added assertions
ogabrielides Oct 27, 2021
3dc0c2c
Refactoring
ogabrielides Oct 29, 2021
6a01797
Interface change
ogabrielides Nov 1, 2021
0cf55f5
Handling of previous DKG session failure
ogabrielides Nov 1, 2021
0684558
Applied refactoring
ogabrielides Nov 1, 2021
78c3245
Build quarter members improvments
ogabrielides Nov 2, 2021
c74dbb2
Merge Quorum Rotation and Decreased fee into one deployment (DIP24)
ogabrielides Mar 29, 2022
19924b8
Added new LLMQ Type
ogabrielides Nov 3, 2021
8728e50
Added functional tests + refactoring
ogabrielides Mar 30, 2022
5792b1d
Refactoring
ogabrielides Nov 11, 2021
dc7fe2a
Spreaded Quorum creation and Quorum Index adaptation
ogabrielides Apr 5, 2022
11cdc64
quorumIndex adaptations
ogabrielides Nov 22, 2021
bfe0f1c
Added quorumIndex in CFinalCommitment
ogabrielides Nov 22, 2021
1e643e8
Latest work
ogabrielides Apr 5, 2022
4630d5b
Final refactoring
ogabrielides Mar 30, 2022
2d07540
Batch of refactoring
kwvg Apr 5, 2022
b3eea5c
Fixes for tests
ogabrielides Nov 25, 2021
4f1357a
Fix for CFinalCommitment
ogabrielides Nov 27, 2021
28da1fb
Fix for Quorums
ogabrielides Nov 29, 2021
44eafbc
Fix
ogabrielides Nov 29, 2021
706f3d8
Small changes
ogabrielides Dec 2, 2021
c032720
Thread sync fic
ogabrielides Dec 3, 2021
ffb2eab
Safety changes
ogabrielides Dec 5, 2021
5baeb7f
Reuse mns when needed
ogabrielides Dec 5, 2021
d809f0c
Refactoring
ogabrielides Dec 7, 2021
d1aa32d
More refactoring
ogabrielides Dec 8, 2021
24231c9
Fixes for rotationinfo handling
ogabrielides Dec 13, 2021
42a7486
Fix for rotation of members
ogabrielides Dec 16, 2021
8a57c09
Correct order of MNs lists in Quorum Snapshots
ogabrielides Dec 18, 2021
38815a1
Adding extra logs
ogabrielides Dec 22, 2021
528587d
Sync rotation quorums + qrinfo changes
ogabrielides Dec 30, 2021
5741e0e
Fix + extra logs
ogabrielides Dec 31, 2021
a51898e
Removed redundant field
ogabrielides Jan 3, 2022
1ca80bc
Fix for null final commitment + refactoring
ogabrielides Jan 4, 2022
60dcb77
Added timers in tests
ogabrielides Jan 14, 2022
ad39d74
Fix for qrinfo message: quorumdiff and merkleRootQuorums
ogabrielides Jan 17, 2022
d53de5c
Small changes for rotation test
ogabrielides Jan 17, 2022
e0087e0
Remove reading from scanQuorumCache
ogabrielides Apr 5, 2022
6964c1b
Added quorum list output
ogabrielides Jan 17, 2022
ff5300d
Crash fix
ogabrielides Jan 19, 2022
399cfbc
Experimental commit
ogabrielides Jan 20, 2022
841b8c4
apply changes to specialtxman.cpp from specialtx.cpp
PastaPastaPasta Jan 26, 2022
ddbc160
all the changes
PastaPastaPasta Jan 23, 2022
7dadb51
substancially speed up feature_llmq_rotation.py
PastaPastaPasta Jan 26, 2022
071b8c2
reenable asserts, add check for reorgs
PastaPastaPasta Jan 26, 2022
8eb1cc1
Refactoring
ogabrielides Jan 25, 2022
f1fe7fc
Added extra logs
ogabrielides Feb 3, 2022
0be7f7b
format
ogabrielides Mar 29, 2022
c2cc9a5
trivial
UdjinM6 Feb 4, 2022
4edcdff
drop extra boost includes
UdjinM6 Feb 4, 2022
5f8d172
drop ContainsMN
UdjinM6 Feb 4, 2022
cac0344
fix ScanQuorums
UdjinM6 Feb 8, 2022
4cb36cb
check quorum hash and index in CFinalCommitment::Verify
UdjinM6 Feb 8, 2022
fa41c16
fix/tweak tests
UdjinM6 Feb 8, 2022
dc795e8
IsQuorumRotationEnabled should be aware of the context
UdjinM6 Feb 8, 2022
66a9fd5
Calculating members based on earlier block.
ogabrielides Apr 5, 2022
c88fe0a
Fix for Quorum Members Cache
ogabrielides Feb 17, 2022
31682e9
Removed duplicate size of baseBlockHashes
ogabrielides Feb 21, 2022
879e82c
Adaptations of qrinfo to -8 mn lists
ogabrielides Feb 23, 2022
c4a088a
Introduction of llmqTypeDIP24InstantSend
ogabrielides Mar 8, 2022
6aba9c1
Adaptation for llmqTypeDIP24InstantSend
ogabrielides Mar 8, 2022
442effc
Adaptations for IS
ogabrielides Mar 11, 2022
f29794a
bump protocol version
PastaPastaPasta Mar 12, 2022
e30a07b
Added feature_llmq_is_migration test
ogabrielides Mar 17, 2022
173cf02
Various cleanups
ogabrielides Mar 29, 2022
e14b953
use unordered_lru_cache for quorumSnapshotCache
UdjinM6 Mar 23, 2022
578a313
trivial refactor ComputeQuorumMembersByQuarterRotation
UdjinM6 Mar 23, 2022
e520357
Reduced CFinalCommitment::quorumIndex from 32 to 16 bits
ogabrielides Mar 24, 2022
967d7d0
Keep verified LLMQ relay connections
ogabrielides Mar 25, 2022
1b1807f
Experimental Relay connection fix
ogabrielides Mar 26, 2022
8595527
Fix for EnsureQuorumConnections rotation
ogabrielides Mar 27, 2022
2b4d369
Using only valid Mns for checking
ogabrielides Mar 30, 2022
3cc69b8
Override of nPowTargetSpacing (devnet only)
ogabrielides Mar 31, 2022
34ccdcf
Show penalty score in masternode rpc
ogabrielides Apr 5, 2022
e0abf1d
fixup! not relevant whitespace diff
PastaPastaPasta Apr 4, 2022
33786d2
fixup! use int() instead of static_cast
PastaPastaPasta Apr 4, 2022
fc02e29
fixup! not-relevant whitespace
PastaPastaPasta Apr 4, 2022
a4c4a00
fixup! TODOs
PastaPastaPasta Apr 4, 2022
6190ad9
fixup! use more verbose name
PastaPastaPasta Apr 4, 2022
d5a1513
fixup! default quorumIndex to 0
PastaPastaPasta Apr 4, 2022
e9b1df1
fixup! default quorumIndex to 0
PastaPastaPasta Apr 4, 2022
5eb4139
fixup! formatting
PastaPastaPasta Apr 4, 2022
edaee1f
fixup! remove unneeded includes
PastaPastaPasta Apr 4, 2022
2b2eeba
fixup! use Mutex instead of CCriticalSection
PastaPastaPasta Apr 4, 2022
c0b6ea0
fix: linter fixes
PastaPastaPasta Apr 4, 2022
4087309
Applied corrections
ogabrielides Apr 5, 2022
da5a28c
Applied corrections
ogabrielides Apr 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ BITCOIN_CORE_H = \
llmq/dkgsession.h \
llmq/init.h \
llmq/instantsend.h \
llmq/snapshot.h \
llmq/signing.h \
llmq/signing_shares.h \
llmq/utils.h \
Expand Down Expand Up @@ -404,6 +405,7 @@ libdash_server_a_SOURCES = \
llmq/dkgsession.cpp \
llmq/init.cpp \
llmq/instantsend.cpp \
llmq/snapshot.cpp \
llmq/signing.cpp \
llmq/signing_shares.cpp \
llmq/utils.cpp \
Expand Down
105 changes: 72 additions & 33 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,14 @@ class CMainParams : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nThresholdMin = 2420; // 60% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nFalloffCoeff = 5; // this corresponds to 10 periods

// Deployment of decreased proposal fee, script addresses for Governance Proposals
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].bit = 7;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nStartTime = 1638316800; // Dec 1st, 2021
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nTimeout = 1669852800; // Dec 1st, 2022
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nWindowSize = 4032;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nThresholdStart = 3226; // 80% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nThresholdMin = 2420; // 60% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nFalloffCoeff = 5; // this corresponds to 10 periods
// Deployment of Quorum Rotation DIP and decreased proposal fee (Values to be determined)
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].bit = 7;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nStartTime = 1638316800; // Dec 1st, 2021
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nTimeout = 1669852800; // Dec 1st, 2022
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nWindowSize = 4032;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nThresholdStart = 3226; // 80% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nThresholdMin = 2420; // 60% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nFalloffCoeff = 5; // this corresponds to 10 periods

// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000549cd3ccb81a55892330"); // 1450000
Expand Down Expand Up @@ -299,11 +299,13 @@ class CMainParams : public CChainParams {

// long living quorum params
AddLLMQ(Consensus::LLMQType::LLMQ_50_60);
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;
consensus.llmqTypeInstantSend = Consensus::LLMQType::LLMQ_50_60;
consensus.llmqTypeDIP0024InstantSend = Consensus::LLMQType::LLMQ_60_75;
consensus.llmqTypePlatform = Consensus::LLMQType::LLMQ_100_67;
consensus.llmqTypeMnhf = Consensus::LLMQType::LLMQ_400_85;

Expand Down Expand Up @@ -461,14 +463,14 @@ class CTestNetParams : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nThresholdMin = 60; // 60% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nFalloffCoeff = 5; // this corresponds to 10 periods

// Deployment of decreased proposal fee, script addresses for Governance Proposals
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].bit = 7;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nStartTime = 999999999999ULL; // TODO renable this before first RC
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nTimeout = 999999999999ULL;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nWindowSize = 4032;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nThresholdStart = 3226; // 80% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nThresholdMin = 2420; // 60% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nFalloffCoeff = 5; // this corresponds to 10 periods
// Deployment of Quorum Rotation DIP and decreased proposal fee (Values to be determined)
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].bit = 7;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nStartTime = 1625097600; // July 1st, 2021
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nTimeout = 1656633600; // July 1st, 2022
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nWindowSize = 4032;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nThresholdStart = 3226; // 80% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nThresholdMin = 2420; // 60% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nFalloffCoeff = 5; // this corresponds to 10 periods

// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000000022f14ac5d56b5ef"); // 470000
Expand Down Expand Up @@ -513,11 +515,13 @@ class CTestNetParams : public CChainParams {

// long living quorum params
AddLLMQ(Consensus::LLMQType::LLMQ_50_60);
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_50_60;
consensus.llmqTypeInstantSend = Consensus::LLMQType::LLMQ_50_60;
consensus.llmqTypeDIP0024InstantSend = Consensus::LLMQType::LLMQ_60_75;
consensus.llmqTypePlatform = Consensus::LLMQType::LLMQ_100_67;
consensus.llmqTypeMnhf = Consensus::LLMQType::LLMQ_50_60;

Expand Down Expand Up @@ -654,14 +658,13 @@ class CDevNetParams : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nThresholdMin = 60; // 60% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nFalloffCoeff = 5; // this corresponds to 10 periods

// Deployment of decreased proposal fee, script addresses for Governance Proposals
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].bit = 7;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nStartTime = 1635724800; // Nov 1st, 2021
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nTimeout = 999999999999ULL;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nThresholdStart = 80;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nThresholdMin = 60;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nFalloffCoeff = 5; // this corresponds to 10 periods
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].bit = 7;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nStartTime = 1625097600; // July 1st, 2021
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nTimeout = 1656633600; // July 1st, 2022
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nThresholdStart = 80; // 80% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nThresholdMin = 60; // 60% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nFalloffCoeff = 5; // this corresponds to 10 periods

// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000000000000000000000");
Expand Down Expand Up @@ -707,17 +710,20 @@ class CDevNetParams : public CChainParams {

// long living quorum params
AddLLMQ(Consensus::LLMQType::LLMQ_50_60);
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);
consensus.llmqTypeChainLocks = Consensus::LLMQType::LLMQ_50_60;
consensus.llmqTypeInstantSend = Consensus::LLMQType::LLMQ_50_60;
consensus.llmqTypeDIP0024InstantSend = Consensus::LLMQType::LLMQ_60_75;
consensus.llmqTypePlatform = Consensus::LLMQType::LLMQ_100_67;
consensus.llmqTypeMnhf = Consensus::LLMQType::LLMQ_50_60;

UpdateDevnetLLMQChainLocksFromArgs(args);
UpdateDevnetLLMQInstantSendFromArgs(args);
UpdateDevnetLLMQInstantSendDIP0024FromArgs(args);
UpdateLLMQDevnetParametersFromArgs(args);
UpdateDevnetPowTargetSpacingFromArgs(args);

Expand Down Expand Up @@ -788,6 +794,14 @@ class CDevNetParams : public CChainParams {
consensus.nPowTargetSpacing = nPowTargetSpacing;
}

/**
* Allows modifying the LLMQ type for InstantSend (DIP0024).
*/
void UpdateDevnetLLMQDIP0024InstantSend(Consensus::LLMQType llmqType)
{
consensus.llmqTypeDIP0024InstantSend = llmqType;
}

/**
* Allows modifying parameters of the devnet LLMQ
*/
Expand All @@ -800,8 +814,10 @@ class CDevNetParams : public CChainParams {
params->threshold = threshold;
params->dkgBadVotesThreshold = threshold;
}

void UpdateLLMQDevnetParametersFromArgs(const ArgsManager& args);
void UpdateDevnetLLMQInstantSendFromArgs(const ArgsManager& args);
void UpdateDevnetLLMQInstantSendDIP0024FromArgs(const ArgsManager& args);
void UpdateDevnetPowTargetSpacingFromArgs(const ArgsManager& args);
};

Expand Down Expand Up @@ -879,13 +895,15 @@ class CRegTestParams : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nThresholdStart = 80;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nThresholdMin = 60;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nFalloffCoeff = 5;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].bit = 7;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nStartTime = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nTimeout = 999999999999ULL;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nThresholdStart = 80;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nThresholdMin = 60;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nFalloffCoeff = 5;

// Deployment of Quorum Rotation DIP and decreased proposal fee (Values to be determined)
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].bit = 7;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nStartTime = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nTimeout = 999999999999ULL;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nWindowSize = 300;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nThresholdStart = 240; // 80% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nThresholdMin = 180; // 60% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0024].nFalloffCoeff = 5; // this corresponds to 10 periods

// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x00");
Expand Down Expand Up @@ -962,8 +980,10 @@ class CRegTestParams : public CChainParams {
// long living quorum params
AddLLMQ(Consensus::LLMQType::LLMQ_TEST);
AddLLMQ(Consensus::LLMQType::LLMQ_TEST_V17);
AddLLMQ(Consensus::LLMQType::LLMQ_TEST_DIP0024);
consensus.llmqTypeChainLocks = Consensus::LLMQType::LLMQ_TEST;
consensus.llmqTypeInstantSend = Consensus::LLMQType::LLMQ_TEST;
consensus.llmqTypeDIP0024InstantSend = Consensus::LLMQType::LLMQ_TEST_DIP0024;
consensus.llmqTypePlatform = Consensus::LLMQType::LLMQ_TEST;
consensus.llmqTypeMnhf = Consensus::LLMQType::LLMQ_TEST;

Expand Down Expand Up @@ -1222,6 +1242,25 @@ void CDevNetParams::UpdateDevnetLLMQInstantSendFromArgs(const ArgsManager& args)
UpdateDevnetLLMQInstantSend(llmqType);
}

void CDevNetParams::UpdateDevnetLLMQInstantSendDIP0024FromArgs(const ArgsManager& args)
{
if (!args.IsArgSet("-llmqinstantsenddip0024")) return;

std::string strLLMQType = gArgs.GetArg("-llmqinstantsenddip0024", std::string(GetLLMQ(consensus.llmqTypeDIP0024InstantSend).name));

Consensus::LLMQType llmqType = Consensus::LLMQType::LLMQ_NONE;
for (const auto& params : consensus.llmqs) {
if (params.name == strLLMQType) {
llmqType = params.type;
}
}
if (llmqType == Consensus::LLMQType::LLMQ_NONE) {
throw std::runtime_error("Invalid LLMQ type specified for -llmqinstantsenddip0024.");
}
LogPrintf("Setting llmqinstantsenddip0024 to size=%ld\n", static_cast<uint8_t>(llmqType));
UpdateDevnetLLMQDIP0024InstantSend(llmqType);
}

void CDevNetParams::UpdateDevnetPowTargetSpacingFromArgs(const ArgsManager& args)
{
if (!args.IsArgSet("-powtargetspacing")) return;
Expand Down Expand Up @@ -1275,9 +1314,9 @@ std::unique_ptr<const CChainParams> CreateChainParams(const std::string& chain)
return std::make_unique<CMainParams>();
else if (chain == CBaseChainParams::TESTNET)
return std::make_unique<CTestNetParams>();
else if (chain == CBaseChainParams::DEVNET) {
else if (chain == CBaseChainParams::DEVNET)
return std::make_unique<CDevNetParams>(gArgs);
} else if (chain == CBaseChainParams::REGTEST)
else if (chain == CBaseChainParams::REGTEST)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undo this change?

return std::make_unique<CRegTestParams>(gArgs);

throw std::runtime_error(strprintf("%s: Unknown chain %s.", __func__, chain));
Expand Down
1 change: 1 addition & 0 deletions src/chainparamsbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ void SetupChainParamsBaseOptions()
gArgs.AddArg("-llmqchainlocks=<quorum name>", "Override the default LLMQ type used for ChainLocks. Allows using ChainLocks with smaller LLMQs. (default: llmq_50_60, devnet-only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
gArgs.AddArg("-llmqdevnetparams=<size>:<threshold>", "Override the default LLMQ size for the LLMQ_DEVNET quorum (default: 3:2, devnet-only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
gArgs.AddArg("-llmqinstantsend=<quorum name>", "Override the default LLMQ type used for InstantSend. Allows using InstantSend with smaller LLMQs. (default: llmq_50_60, devnet-only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
gArgs.AddArg("-llmqinstantsenddip0024=<quorum name>", "Override the default LLMQ type used for InstantSendDIP0024. (default: llmq_60_75, devnet-only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
gArgs.AddArg("-llmqtestparams=<size>:<threshold>", "Override the default LLMQ size for the LLMQ_TEST quorum (default: 10:6, regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
gArgs.AddArg("-powtargetspacing=<n>", "Override the default PowTargetSpacing value in seconds (default: 2.5 minutes, devnet-only)", ArgsManager::ALLOW_INT, OptionsCategory::CHAINPARAMS);
gArgs.AddArg("-minimumdifficultyblocks=<n>", "The number of blocks that can be mined with the minimum difficulty at the start of a chain (default: 0, devnet-only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
Expand Down
10 changes: 5 additions & 5 deletions src/consensus/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@

namespace Consensus {

enum DeploymentPos
{
enum DeploymentPos {
DEPLOYMENT_TESTDUMMY,
DEPLOYMENT_CSV, // Deployment of BIP68, BIP112, and BIP113.
DEPLOYMENT_CSV, // Deployment of BIP68, BIP112, and BIP113.
DEPLOYMENT_DIP0001, // Deployment of DIP0001 and lower transaction fees.
DEPLOYMENT_BIP147, // Deployment of BIP147 (NULLDUMMY)
DEPLOYMENT_BIP147, // Deployment of BIP147 (NULLDUMMY)
DEPLOYMENT_DIP0003, // Deployment of DIP0002 and DIP0003 (txv3 and deterministic MN lists)
DEPLOYMENT_DIP0008, // Deployment of ChainLock enforcement
DEPLOYMENT_REALLOC, // Deployment of Block Reward Reallocation
DEPLOYMENT_DIP0020, // Deployment of DIP0020, DIP0021 and LMQ_100_67 quorums
DEPLOYMENT_GOV_FEE, // Deployment of decreased governance proposal fee
DEPLOYMENT_DIP0024, // Deployment of DIP0024 (Quorum Rotation) and decreased governance proposal fee
// NOTE: Also add new deployments to VersionBitsDeploymentInfo in versionbits.cpp
MAX_VERSION_BITS_DEPLOYMENTS
};
Expand Down Expand Up @@ -120,6 +119,7 @@ struct Params {
std::vector<LLMQParams> llmqs;
LLMQType llmqTypeChainLocks;
LLMQType llmqTypeInstantSend{LLMQType::LLMQ_NONE};
LLMQType llmqTypeDIP0024InstantSend{LLMQType::LLMQ_NONE};
LLMQType llmqTypePlatform{LLMQType::LLMQ_NONE};
LLMQType llmqTypeMnhf{LLMQType::LLMQ_NONE};
};
Expand Down
5 changes: 3 additions & 2 deletions src/evo/deterministicmns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,8 @@ bool CDeterministicMNManager::BuildNewListFromBlock(const CBlock& block, const C
}
if (!qc.commitment.IsNull()) {
const auto& llmq_params = llmq::GetLLMQParams(qc.commitment.llmqType);
uint32_t quorumHeight = qc.nHeight - (qc.nHeight % llmq_params.dkgInterval);
int qcnHeight = int(qc.nHeight);
int quorumHeight = qcnHeight - (qcnHeight % llmq_params.dkgInterval) + int(qc.commitment.quorumIndex);
auto pQuorumBaseBlockIndex = pindexPrev->GetAncestor(quorumHeight);
if (!pQuorumBaseBlockIndex || pQuorumBaseBlockIndex->GetBlockHash() != qc.commitment.quorumHash) {
// we should actually never get into this case as validation should have caught it...but let's be sure
Expand Down Expand Up @@ -875,7 +876,7 @@ void CDeterministicMNManager::HandleQuorumCommitment(const llmq::CFinalCommitmen
{
// The commitment has already been validated at this point, so it's safe to use members of it

auto members = llmq::CLLMQUtils::GetAllQuorumMembers(llmq::GetLLMQParams(qc.llmqType), pQuorumBaseBlockIndex);
auto members = llmq::CLLMQUtils::GetAllQuorumMembers(qc.llmqType, pQuorumBaseBlockIndex);

for (size_t i = 0; i < members.size(); i++) {
if (!mnList.HasMN(members[i]->proTxHash)) {
Expand Down
2 changes: 1 addition & 1 deletion src/evo/specialtxman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ bool CheckSpecialTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CVali
case TRANSACTION_QUORUM_COMMITMENT:
return llmq::CheckLLMQCommitment(tx, pindexPrev, state);
case TRANSACTION_MNHF_SIGNAL:
return VersionBitsTipState(Params().GetConsensus(), Consensus::DEPLOYMENT_GOV_FEE) == ThresholdState::ACTIVE && CheckMNHFTx(tx, pindexPrev, state);
return VersionBitsTipState(Params().GetConsensus(), Consensus::DEPLOYMENT_DIP0024) == ThresholdState::ACTIVE && CheckMNHFTx(tx, pindexPrev, state);
}
} catch (const std::exception& e) {
LogPrintf("%s -- failed: %s\n", __func__, e.what());
Expand Down
4 changes: 2 additions & 2 deletions src/governance/governance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ void CGovernanceManager::UpdateCachesAndClean()
} else {
// NOTE: triggers are handled via triggerman
if (pObj->GetObjectType() == GOVERNANCE_OBJECT_PROPOSAL) {
bool fAllowScript = (VersionBitsTipState(Params().GetConsensus(), Consensus::DEPLOYMENT_GOV_FEE) == ThresholdState::ACTIVE);
bool fAllowScript = (VersionBitsTipState(Params().GetConsensus(), Consensus::DEPLOYMENT_DIP0024) == ThresholdState::ACTIVE);
bool fAllowLegacyFormat = !fAllowScript; // reusing the same bit to stop accepting proposals in legacy format
CProposalValidator validator(pObj->GetDataAsHexString(), fAllowLegacyFormat, fAllowScript);
if (!validator.Validate()) {
Expand Down Expand Up @@ -672,7 +672,7 @@ void CGovernanceManager::SyncObjects(CNode* pnode, CConnman& connman) const

LogPrint(BCLog::GOBJECT, "CGovernanceManager::%s -- syncing all objects to peer=%d\n", __func__, pnode->GetId());

bool fAllowScript = WITH_LOCK(cs_main, return VersionBitsTipState(Params().GetConsensus(), Consensus::DEPLOYMENT_GOV_FEE) == ThresholdState::ACTIVE);
bool fAllowScript = WITH_LOCK(cs_main, return VersionBitsTipState(Params().GetConsensus(), Consensus::DEPLOYMENT_DIP0024) == ThresholdState::ACTIVE);

LOCK(cs);

Expand Down
Loading