Skip to content

Commit

Permalink
Merge pull request #5228 from PastaPastaPasta/v19-new-llmq
Browse files Browse the repository at this point in the history
[v19.x] backport: new llmq and rc.4 bump
  • Loading branch information
PastaPastaPasta committed Mar 1, 2023
2 parents ccea5ab + 45da082 commit a79d434
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 4 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ AC_PREREQ([2.69])
define(_CLIENT_VERSION_MAJOR, 19)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_RC, 3)
define(_CLIENT_VERSION_RC, 4)
define(_CLIENT_VERSION_IS_RELEASE, false)
define(_COPYRIGHT_YEAR, 2023)
define(_COPYRIGHT_HOLDERS,[The %s developers])
Expand Down
10 changes: 10 additions & 0 deletions doc/release-notes-5225.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Testnet Breaking Changes
------------------------

A new testnet only LLMQ has been added. This LLMQ is of the type LLMQ_25_67; this LLMQ is only active on testnet.
This LLMQ will not remove the LLMQ_100_67 from testnet; however that quorum (likely) will not form and will perform no role.
See the [diff](https://github.com/dashpay/dash/pull/5225/files#diff-e70a38a3e8c2a63ca0494627301a5c7042141ad301193f78338d97cb1b300ff9R451-R469) for specific parameters of the LLMQ.

This LLMQ will become active at the height of 847000. **This will be a breaking change and a hard fork for testnet**
This LLMQ is not activated with the v19 hardfork; as such testnet will experience two hardforks. One at height 847000,
and the other to be determined by the BIP9 hard fork process.
3 changes: 2 additions & 1 deletion src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,10 +542,11 @@ class CTestNetParams : public CChainParams {
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;
consensus.llmqTypeInstantSend = Consensus::LLMQType::LLMQ_50_60;
consensus.llmqTypeDIP0024InstantSend = Consensus::LLMQType::LLMQ_60_75;
consensus.llmqTypePlatform = Consensus::LLMQType::LLMQ_100_67;
consensus.llmqTypePlatform = Consensus::LLMQType::LLMQ_25_67;
consensus.llmqTypeMnhf = Consensus::LLMQType::LLMQ_50_60;

fDefaultConsistencyChecks = false;
Expand Down
32 changes: 30 additions & 2 deletions src/llmq/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ enum class LLMQType : uint8_t {
LLMQ_400_85 = 3, // 400 members, 340 (85%) threshold, one every 24 hours
LLMQ_100_67 = 4, // 100 members, 67 (67%) threshold, one per hour
LLMQ_60_75 = 5, // 60 members, 45 (75%) threshold, one every 12 hours
LLMQ_25_67 = 6, // 25 members, 67 (67%) threshold, one per hour

// for testing only
LLMQ_TEST = 100, // 3 members, 2 (66%) threshold, one per hour. Params might differ when -llmqtestparams is used
Expand Down Expand Up @@ -108,7 +109,7 @@ struct LLMQParams {
};


static constexpr std::array<LLMQParams, 13> available_llmqs = {
static constexpr std::array<LLMQParams, 14> available_llmqs = {

/**
* llmq_test
Expand Down Expand Up @@ -195,7 +196,7 @@ static constexpr std::array<LLMQParams, 13> available_llmqs = {
.name = "llmq_test_dip0024",
.useRotation = true,
.size = 4,
.minSize = 3,
.minSize = 4,
.threshold = 2,

.dkgInterval = 24, // DKG cycle
Expand Down Expand Up @@ -440,6 +441,33 @@ static constexpr std::array<LLMQParams, 13> available_llmqs = {
.recoveryMembers = 50,
},

/**
* llmq_25_67
* This quorum is deployed on Testnet and requires
* 25 participants
*
* Used by Dash Platform
*/
LLMQParams{
.type = LLMQType::LLMQ_25_67,
.name = "llmq_25_67",
.useRotation = false,
.size = 25,
.minSize = 22,
.threshold = 17,

.dkgInterval = 24, // one DKG per hour
.dkgPhaseBlocks = 2,
.dkgMiningWindowStart = 10, // dkgPhaseBlocks * 5 = after finalization
.dkgMiningWindowEnd = 18,
.dkgBadVotesThreshold = 22,

.signingActiveQuorumCount = 24, // a full day worth of LLMQs

.keepOldConnections = 25,
.recoveryMembers = 12,
},

}; // available_llmqs

} // namespace Consensus
Expand Down
7 changes: 7 additions & 0 deletions src/llmq/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

#include <optional>

static constexpr int TESTNET_LLMQ_25_67_ACTIVATION_HEIGHT = 847000;

namespace llmq
{

Expand Down Expand Up @@ -954,6 +956,11 @@ bool IsQuorumTypeEnabledInternal(Consensus::LLMQType llmqType, const CQuorumMana
}
break;
}
case Consensus::LLMQType::LLMQ_25_67:
if (pindex->nHeight < TESTNET_LLMQ_25_67_ACTIVATION_HEIGHT) {
return false;
}
break;
default:
throw std::runtime_error(strprintf("%s: Unknown LLMQ type %d", __func__, ToUnderlying(llmqType)));
}
Expand Down

0 comments on commit a79d434

Please sign in to comment.