Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 0 additions & 6 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ class CMainParams : public CChainParams {

vSporkAddresses = {"Xgtyuk76vhuFW2iT7UAiHgNdWXCf3J34wh"};
nMinSporkKeys = 1;
fBIP9CheckMasternodesUpgraded = true;

checkpointData = {
{
Expand Down Expand Up @@ -464,7 +463,6 @@ class CTestNetParams : public CChainParams {

vSporkAddresses = {"yjPtiKh2uwk3bDutTEA2q9mCtXyiZRWn55"};
nMinSporkKeys = 1;
fBIP9CheckMasternodesUpgraded = true;

checkpointData = {
{
Expand Down Expand Up @@ -644,8 +642,6 @@ class CDevNetParams : public CChainParams {

vSporkAddresses = {"yjPtiKh2uwk3bDutTEA2q9mCtXyiZRWn55"};
nMinSporkKeys = 1;
// devnets are started with no blocks and no MN, so we can't check for upgraded MN (as there are none)
fBIP9CheckMasternodesUpgraded = false;

checkpointData = (CCheckpointData) {
{
Expand Down Expand Up @@ -846,8 +842,6 @@ class CRegTestParams : public CChainParams {
// privKey: cP4EKFyJsHT39LDqgdcB43Y3YXjNyjb5Fuas1GQSeAtjnZWmZEQK
vSporkAddresses = {"yj949n1UH6fDhw6HtVE5VMj2iSTaSWBMcW"};
nMinSporkKeys = 1;
// regtest usually has no masternodes in most tests, so don't check for upgraged MNs
fBIP9CheckMasternodesUpgraded = false;

checkpointData = {
{
Expand Down
6 changes: 0 additions & 6 deletions src/chainparams.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,12 @@ class CChainParams
void UpdateDIP3Parameters(int nActivationHeight, int nEnforcementHeight);
void UpdateDIP8Parameters(int nActivationHeight);
void UpdateBudgetParameters(int nMasternodePaymentsStartBlock, int nBudgetPaymentsStartBlock, int nSuperblockStartBlock);
void UpdateSubsidyAndDiffParams(int nMinimumDifficultyBlocks, int nHighSubsidyBlocks, int nHighSubsidyFactor);
void UpdateLLMQChainLocks(Consensus::LLMQType llmqType);
void UpdateLLMQInstantSend(Consensus::LLMQType llmqType);
void UpdateLLMQTestParams(int size, int threshold);
void UpdateLLMQDevnetParams(int size, int threshold);
int PoolMinParticipants() const { return nPoolMinParticipants; }
int PoolMaxParticipants() const { return nPoolMaxParticipants; }
int FulfilledRequestExpireTime() const { return nFulfilledRequestExpireTime; }
const std::vector<std::string>& SporkAddresses() const { return vSporkAddresses; }
int MinSporkKeys() const { return nMinSporkKeys; }
bool BIP9CheckMasternodesUpgraded() const { return fBIP9CheckMasternodesUpgraded; }
std::optional<Consensus::LLMQParams> GetLLMQ(Consensus::LLMQType llmqType) const;

protected:
Expand Down Expand Up @@ -174,7 +169,6 @@ class CChainParams
int nFulfilledRequestExpireTime;
std::vector<std::string> vSporkAddresses;
int nMinSporkKeys;
bool fBIP9CheckMasternodesUpgraded;
uint16_t nDefaultPlatformP2PPort;
uint16_t nDefaultPlatformHTTPPort;

Expand Down
2 changes: 1 addition & 1 deletion src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
bool fDIP0003Active_context = nHeight >= chainparams.GetConsensus().DIP0003Height;
bool fDIP0008Active_context = nHeight >= chainparams.GetConsensus().DIP0008Height;

pblock->nVersion = ComputeBlockVersion(pindexPrev, chainparams.GetConsensus(), chainparams.BIP9CheckMasternodesUpgraded());
pblock->nVersion = ComputeBlockVersion(pindexPrev, chainparams.GetConsensus());
// Non-mainnet only: allow overriding block.nVersion with
// -blockversion=N to test forking scenarios
if (Params().NetworkIDString() != CBaseChainParams::MAIN)
Expand Down
7 changes: 1 addition & 6 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
#include <util/translation.h>
#include <util/system.h>
#include <validationinterface.h>
#include <versionbitsinfo.h>
#include <warnings.h>

#include <masternode/payments.h>
Expand Down Expand Up @@ -1960,18 +1959,14 @@ void StopScriptCheckWorkerThreads()

VersionBitsCache versionbitscache GUARDED_BY(cs_main);

int32_t ComputeBlockVersion(const CBlockIndex* pindexPrev, const Consensus::Params& params, bool fCheckMasternodesUpgraded)
int32_t ComputeBlockVersion(const CBlockIndex* pindexPrev, const Consensus::Params& params)
{
LOCK(cs_main);
int32_t nVersion = VERSIONBITS_TOP_BITS;

for (int i = 0; i < (int)Consensus::MAX_VERSION_BITS_DEPLOYMENTS; i++) {
Consensus::DeploymentPos pos = Consensus::DeploymentPos(i);
ThresholdState state = VersionBitsState(pindexPrev, params, pos, versionbitscache);
const struct VBDeploymentInfo& vbinfo = VersionBitsDeploymentInfo[pos];
if (vbinfo.check_mn_protocol && state == ThresholdState::STARTED && fCheckMasternodesUpgraded) {
// TODO implement new logic for MN upgrade checks (e.g. with LLMQ based feature/version voting)
}
if (state == ThresholdState::LOCKED_IN || state == ThresholdState::STARTED) {
nVersion |= VersionBitsMask(params, static_cast<Consensus::DeploymentPos>(i));
}
Expand Down
2 changes: 1 addition & 1 deletion src/validation.h
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ extern VersionBitsCache versionbitscache;
/**
* Determine what nVersion a new block should use.
*/
int32_t ComputeBlockVersion(const CBlockIndex* pindexPrev, const Consensus::Params& params, bool fCheckMasternodesUpgraded = false);
int32_t ComputeBlockVersion(const CBlockIndex* pindexPrev, const Consensus::Params& params);

/**
* Return true if hash can be found in ::ChainActive() at nBlockHeight height.
Expand Down
3 changes: 0 additions & 3 deletions src/versionbitsinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@ const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_B
{
/*.name =*/ "testdummy",
/*.gbt_force =*/ true,
/*.check_mn_protocol =*/ false,
},
{
/*.name =*/"v19",
/*.gbt_force =*/true,
/*.check_mn_protocol =*/false,
},
{
/*.name =*/"v20",
/*.gbt_force =*/true,
/*.check_mn_protocol =*/false,
},
};
2 changes: 0 additions & 2 deletions src/versionbitsinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ struct VBDeploymentInfo {
const char *name;
/** Whether GBT clients can safely ignore this rule in simplified usage */
bool gbt_force;
/** Whether to check current MN protocol or not */
bool check_mn_protocol;
};

extern const struct VBDeploymentInfo VersionBitsDeploymentInfo[];
Expand Down