Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

params.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2015 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef BITCOIN_CONSENSUS_PARAMS_H
7 #define BITCOIN_CONSENSUS_PARAMS_H
8 
9 #include <uint256.h>
10 #include <map>
11 #include <string>
12 
13 namespace Consensus {
14 
16 {
18  DEPLOYMENT_CSV, // Deployment of BIP68, BIP112, and BIP113.
19  DEPLOYMENT_DIP0001, // Deployment of DIP0001 and lower transaction fees.
20  DEPLOYMENT_BIP147, // Deployment of BIP147 (NULLDUMMY)
21  DEPLOYMENT_DIP0003, // Deployment of DIP0002 and DIP0003 (txv3 and deterministic MN lists)
22  DEPLOYMENT_DIP0008, // Deployment of ChainLock enforcement
23  DEPLOYMENT_REALLOC, // Deployment of Block Reward Reallocation
24  // NOTE: Also add new deployments to VersionBitsDeploymentInfo in versionbits.cpp
26 };
27 
33  int bit;
35  int64_t nStartTime;
37  int64_t nTimeout;
39  int64_t nWindowSize{0};
41  int64_t nThresholdStart{0};
43  int64_t nThresholdMin{0};
45  int64_t nFalloffCoeff{0};
46 };
47 
48 enum LLMQType : uint8_t
49 {
50  LLMQ_NONE = 0xff,
51 
52  LLMQ_50_60 = 1, // 50 members, 30 (60%) threshold, one per hour
53  LLMQ_400_60 = 2, // 400 members, 240 (60%) threshold, one every 12 hours
54  LLMQ_400_85 = 3, // 400 members, 340 (85%) threshold, one every 24 hours
55 
56  // for testing only
57  LLMQ_TEST = 100, // 3 members, 2 (66%) threshold, one per hour. Params might differ when -llmqtestparams is used
58 
59  // for devnets only
60  LLMQ_DEVNET = 101, // 10 members, 6 (60%) threshold, one per hour. Params might differ when -llmqdevnetparams is used
61 };
62 
63 // Configures a LLMQ and its DKG
64 // See https://github.com/dashpay/dips/blob/master/dip-0006.md for more details
65 struct LLMQParams {
67 
68  // not consensus critical, only used in logging, RPC and UI
69  std::string name;
70 
71  // the size of the quorum, e.g. 50 or 400
72  int size;
73 
74  // The minimum number of valid members after the DKK. If less members are determined valid, no commitment can be
75  // created. Should be higher then the threshold to allow some room for failing nodes, otherwise quorum might end up
76  // not being able to ever created a recovered signature if more nodes fail after the DKG
77  int minSize;
78 
79  // The threshold required to recover a final signature. Should be at least 50%+1 of the quorum size. This value
80  // also controls the size of the public key verification vector and has a large influence on the performance of
81  // recovery. It also influences the amount of minimum messages that need to be exchanged for a single signing session.
82  // This value has the most influence on the security of the quorum. The number of total malicious masternodes
83  // required to negatively influence signing sessions highly correlates to the threshold percentage.
84  int threshold;
85 
86  // The interval in number blocks for DKGs and the creation of LLMQs. If set to 24 for example, a DKG will start
87  // every 24 blocks, which is approximately once every hour.
89 
90  // The number of blocks per phase in a DKG session. There are 6 phases plus the mining phase that need to be processed
91  // per DKG. Set this value to a number of blocks so that each phase has enough time to propagate all required
92  // messages to all members before the next phase starts. If blocks are produced too fast, whole DKG sessions will
93  // fail.
95 
96  // The starting block inside the DKG interval for when mining of commitments starts. The value is inclusive.
97  // Starting from this block, the inclusion of (possibly null) commitments is enforced until the first non-null
98  // commitment is mined. The chosen value should be at least 5 * dkgPhaseBlocks so that it starts right after the
99  // finalization phase.
101 
102  // The ending block inside the DKG interval for when mining of commitments ends. The value is inclusive.
103  // Choose a value so that miners have enough time to receive the commitment and mine it. Also take into consideration
104  // that miners might omit real commitments and revert to always including null commitments. The mining window should
105  // be large enough so that other miners have a chance to produce a block containing a non-null commitment. The window
106  // should at the same time not be too large so that not too much space is wasted with null commitments in case a DKG
107  // session failed.
109 
110  // In the complaint phase, members will vote on other members being bad (missing valid contribution). If at least
111  // dkgBadVotesThreshold have voted for another member to be bad, it will considered to be bad by all other members
112  // as well. This serves as a protection against late-comers who send their contribution on the bring of
113  // phase-transition, which would otherwise result in inconsistent views of the valid members set
115 
116  // Number of quorums to consider "active" for signing sessions
118 
119  // Used for inter-quorum communication. This is the number of quorums for which we should keep old connections. This
120  // should be at least one more then the active quorums set.
122 
123  // How many members should we try to send all sigShares to before we give up.
125 };
126 
130 struct Params {
138  int nInstantSendKeepLock; // in blocks
144  int nSuperblockCycle; // in blocks
145  int nGovernanceMinQuorum; // Min absolute vote count to trigger an action
169  // Default BIP9Deployment::nWindowSize value for deployments where it's not specified and for unknown deployments.
183 
188 
189  std::map<LLMQType, LLMQParams> llmqs;
192 };
193 } // namespace Consensus
194 
195 // This must be outside of all namespaces. We must also duplicate the forward declaration of is_serializable_enum to
196 // avoid inclusion of serialize.h here.
197 template<typename T> struct is_serializable_enum;
198 template<> struct is_serializable_enum<Consensus::LLMQType> : std::true_type {};
199 
200 #endif // BITCOIN_CONSENSUS_PARAMS_H
int nMasternodePaymentsIncreaseBlock
Definition: params.h:135
uint256 DIP0003EnforcementHash
Definition: params.h:161
uint256 BIP34Hash
Definition: params.h:150
int64_t nPowTargetTimespan
Definition: params.h:177
bool fPowNoRetargeting
Definition: params.h:175
If none of the specialized versions above matched and T is an enum, default to calling Serialize/Unse...
Definition: params.h:197
int nBudgetPaymentsCycleBlocks
Definition: params.h:140
int nBudgetPaymentsWindowBlocks
Definition: params.h:141
bool fPowAllowMinDifficultyBlocks
Definition: params.h:174
int BIP66Height
Block height at which BIP66 becomes active.
Definition: params.h:154
int nSuperblockCycle
Definition: params.h:144
int nMasternodePaymentsStartBlock
Definition: params.h:134
int nHighSubsidyFactor
Definition: params.h:187
std::string name
Definition: params.h:69
uint256 nSuperblockStartHash
Definition: params.h:143
int nGovernanceFilterElements
Definition: params.h:146
int nBudgetPaymentsStartBlock
Definition: params.h:139
int nSubsidyHalvingInterval
Definition: params.h:133
int64_t nFalloffCoeff
A coefficient which adjusts the speed a required number of signaling blocks is decreasing from nThres...
Definition: params.h:45
int nInstantSendKeepLock
Definition: params.h:138
LLMQType
Definition: params.h:48
int nMinimumDifficultyBlocks
these parameters are only used on devnet and can be configured from the outside
Definition: params.h:185
uint256 powLimit
Proof of work parameters.
Definition: params.h:173
int nInstantSendConfirmationsRequired
Definition: params.h:137
int nSuperblockStartBlock
Definition: params.h:142
DeploymentPos
Definition: params.h:15
Struct for each individual consensus rule change using BIP9.
Definition: params.h:31
int BIP34Height
Block height and hash at which BIP34 becomes active.
Definition: params.h:149
int64_t nStartTime
Start MedianTime for version bits miner confirmation.
Definition: params.h:35
int64_t nPowTargetSpacing
Definition: params.h:176
int DIP0003Height
Block height at which DIP0003 becomes active.
Definition: params.h:158
int64_t nWindowSize
The number of past blocks (including the block under consideration) to be taken into account for lock...
Definition: params.h:39
uint32_t nMinerConfirmationWindow
Definition: params.h:170
Parameters that influence chain consensus.
Definition: params.h:130
int nGovernanceMinQuorum
Definition: params.h:145
std::map< LLMQType, LLMQParams > llmqs
Definition: params.h:189
int64_t nThresholdMin
A minimum number of blocks, in the range of 1..nWindowSize, which must signal for a fork in order to ...
Definition: params.h:43
int BIP65Height
Block height at which BIP65 becomes active.
Definition: params.h:152
int64_t DifficultyAdjustmentInterval() const
Definition: params.h:180
int DIP0003EnforcementHeight
Block height at which DIP0003 becomes enforced.
Definition: params.h:160
int signingActiveQuorumCount
Definition: params.h:117
int64_t nTimeout
Timeout/expiry MedianTime for the deployment attempt.
Definition: params.h:37
256-bit opaque blob.
Definition: uint256.h:123
LLMQType llmqTypeChainLocks
Definition: params.h:190
uint256 nMinimumChainWork
Definition: params.h:181
uint256 defaultAssumeValid
Definition: params.h:182
int64_t nThresholdStart
A starting number of blocks, in the range of 1..nWindowSize, which must signal for a fork in order to...
Definition: params.h:41
uint32_t nRuleChangeActivationThreshold
Minimum blocks including miner confirmation of the total of nMinerConfirmationWindow blocks in a reta...
Definition: params.h:168
uint256 hashDevnetGenesisBlock
Definition: params.h:132
int nMasternodePaymentsIncreasePeriod
Definition: params.h:136
int bit
Bit position to select the particular bit in nVersion.
Definition: params.h:33
LLMQType llmqTypeInstantSend
Definition: params.h:191
uint256 hashGenesisBlock
Definition: params.h:131
int nHighSubsidyBlocks
Definition: params.h:186
BIP9Deployment vDeployments[MAX_VERSION_BITS_DEPLOYMENTS]
Definition: params.h:171
int DIP0001Height
Block height at which DIP0001 becomes active.
Definition: params.h:156
int nMasternodeMinimumConfirmations
Definition: params.h:147
Released under the MIT license