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
4 changes: 0 additions & 4 deletions src/activemasternode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ void CActiveMasternodeManager::Init()

if (!fMasternodeMode) return;

if (!deterministicMNManager->IsDIP3Enforced()) return;

// Check that our local network configuration is correct
if (!fListen) {
// listen option is probably overwritten by smth else, no good
Expand Down Expand Up @@ -131,8 +129,6 @@ void CActiveMasternodeManager::UpdatedBlockTip(const CBlockIndex* pindexNew, con

if (!fMasternodeMode) return;

if (!deterministicMNManager->IsDIP3Enforced(pindexNew->nHeight)) return;

if (state == MASTERNODE_READY) {
auto mnList = deterministicMNManager->GetListForBlock(pindexNew->GetBlockHash());
if (!mnList.IsMNValid(mnListEntry->proTxHash)) {
Expand Down
96 changes: 51 additions & 45 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static CBlock FindDevNetGenesisBlock(const Consensus::Params& params, const CBlo
static Consensus::LLMQParams llmq5_60 = {
.type = Consensus::LLMQ_5_60,
.name = "llmq_5_60",
.size = 5,
.size = 3,
.minSize = 3,
.threshold = 3,

Expand Down Expand Up @@ -223,7 +223,6 @@ class CMainParams : public CChainParams {
consensus.nGovernanceFilterElements = 20000;
consensus.nMasternodeMinimumConfirmations = 15;
consensus.nMasternodeCollateral = 500000 * COIN;
consensus.nCollateralBugHeight = 331460;
consensus.BIP34Height = 951;
consensus.BIP34Hash = uint256S("0x000001f35e70f7c5705f64c6c5cc3dea9449e74d5b5c7cf74dad1bcca14a8012");
consensus.BIP65Height = 619382;
Expand Down Expand Up @@ -398,41 +397,40 @@ class CTestNetParams : public CChainParams {
public:
CTestNetParams() {
strNetworkID = "test";
consensus.nSubsidyHalvingInterval = NEVER32; // unused
consensus.nSubsidyHalvingInterval = NEVER32;
consensus.nMasternodePaymentsStartBlock = 50;
consensus.nMasternodePaymentsIncreaseBlock = NEVER32;
consensus.nMasternodePaymentsIncreasePeriod = NEVER32;
consensus.nInstantSendConfirmationsRequired = 2;
consensus.nInstantSendKeepLock = 6;
consensus.nInstantSendSigsRequired = 6;
consensus.nInstantSendSigsTotal = 10;
consensus.nBudgetPaymentsStartBlock = NEVER32;
consensus.nBudgetPaymentsCycleBlocks = NEVER32;
consensus.nBudgetPaymentsWindowBlocks = NEVER32;
consensus.nSuperblockStartBlock = NEVER32;
consensus.nSuperblockStartHash = uint256(); // do not check this on testnet
consensus.nSuperblockCycle = 24; // Superblocks can be issued hourly on testnet
consensus.nInstantSendSigsRequired = 2;
consensus.nInstantSendSigsTotal = 4;
consensus.nBudgetPaymentsStartBlock = 50;
consensus.nBudgetPaymentsCycleBlocks = 50;
consensus.nBudgetPaymentsWindowBlocks = 100;
consensus.nSuperblockStartBlock = 100;
consensus.nSuperblockStartHash = uint256();
consensus.nSuperblockCycle = 24;
consensus.nGovernanceMinQuorum = 1;
consensus.nGovernanceFilterElements = 500;
consensus.nMasternodeMinimumConfirmations = 15;
consensus.nMasternodeCollateral = 5000 * COIN;
consensus.nCollateralBugHeight = 0;
consensus.nMasternodeCollateral = 1000 * COIN;
consensus.BIP34Height = 1;
consensus.BIP34Hash = uint256S("0x0000000000000000000000000000000000000000000000000000000000000000");
consensus.BIP65Height = 0;
consensus.BIP66Height = 0;
consensus.DIP0001Height = 1;
consensus.DIP0003Height = 50;
consensus.DIP0003EnforcementHeight = 250;
consensus.DIP0003Height = 125;
consensus.DIP0003EnforcementHeight = 25000;
consensus.DIP0003EnforcementHash = uint256S("0x0000000000000000000000000000000000000000000000000000000000000000");
consensus.powLimit = uint256S("0000fffff0000000000000000000000000000000000000000000000000000000");
consensus.posLimit = uint256S("007ffff000000000000000000000000000000000000000000000000000000000");
consensus.nLastPoWBlock = 125;
consensus.nPowTargetTimespan = 450;
consensus.nPowTargetSpacing = 150;
consensus.nLastPoWBlock = consensus.DIP0003Height;
consensus.nPowTargetTimespan = 60;
consensus.nPowTargetSpacing = 60;
consensus.nPosTargetSpacing = consensus.nPowTargetSpacing;
consensus.nPosTargetTimespan = consensus.nPowTargetTimespan;
consensus.nMinimumStakeValue = 10000 * COIN;
consensus.nMinimumStakeValue = 100 * COIN;
consensus.nStakeMinAge = 10 * 60;
consensus.nStakeMaxAge = 60 * 60 * 24 * 30;
consensus.nModifierInterval = 60 * 20;
Expand All @@ -442,40 +440,41 @@ class CTestNetParams : public CChainParams {
consensus.nPowDGWHeight = NEVER32; // unused
consensus.nRuleChangeActivationThreshold = 1512;
consensus.nMinerConfirmationWindow = 2016;

consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1544655600;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = NEVER32;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1573325000;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = NEVER64;

// Deployment of BIP68, BIP112, and BIP113.
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1544655600;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = NEVER32;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1573325000;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = NEVER64;

// Deployment of DIP0001
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].bit = 1;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nStartTime = 1544655600;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nTimeout = NEVER32;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nStartTime = 1573325000;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nTimeout = NEVER64;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nThreshold = 50;

// Deployment of BIP147
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].bit = 2;
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nStartTime = 1544655600;
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nTimeout = NEVER32;
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nStartTime = 1573325000;
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nTimeout = NEVER64;
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nThreshold = 50;

// Deployment of DIP0003
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].bit = 3;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nStartTime = 1544655600;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nTimeout = NEVER32;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nStartTime = Consensus::BIP9Deployment::ALWAYS_ACTIVE;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nThreshold = 50;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nThreshold = 10;

// Deployment of DIP0008
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].bit = 4;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nStartTime = 1544655600;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nTimeout = NEVER32;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nStartTime = Consensus::BIP9Deployment::ALWAYS_ACTIVE;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nThreshold = 10;

Expand All @@ -493,16 +492,26 @@ class CTestNetParams : public CChainParams {
nDefaultPort = 29999;
nPruneAfterHeight = 1000;

genesis = CreateGenesisBlock(1567646780, 24712, 0x1f00ffff, 1, 0 * COIN, true);
uint32_t nTime = 1573325000;
uint32_t nNonce = 0;

if (nNonce == 0) {
while (UintToArith256(genesis.GetHash()) >
UintToArith256(consensus.powLimit))
{
nNonce++;
genesis = CreateGenesisBlock(nTime, nNonce, 0x1f00ffff, 1, 0 * COIN, true);
if (nNonce % 128 == 0) printf("\rgenesis %08x", nNonce);
}
}

genesis = CreateGenesisBlock(nTime, nNonce, 0x1f00ffff, 1, 0 * COIN, true);
consensus.hashGenesisBlock = genesis.GetHash();
assert(consensus.hashGenesisBlock == uint256S("0x0000d3b6747d6f7fe976c218fe7834d2fa79b661a6debe69a0af9b8faea3b0fa"));

vFixedSeeds.clear();
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test));

vSeeds.clear();
vSeeds.push_back(CDNSSeedData("pacglobal.io", "seed2.pacglobal.io"));
vSeeds.push_back(CDNSSeedData("pacglobal.io", "seed3.pacglobal.io"));

// Testnet PACGlobal addresses start with 'y'
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,140);
Expand All @@ -519,25 +528,23 @@ class CTestNetParams : public CChainParams {
nExtCoinType = 1;

// long living quorum params
consensus.llmqs[Consensus::LLMQ_50_60] = llmq50_60;
consensus.llmqs[Consensus::LLMQ_400_60] = llmq400_60;
consensus.llmqs[Consensus::LLMQ_400_85] = llmq400_85;
consensus.llmqChainLocks = Consensus::LLMQ_50_60;
consensus.llmqForInstaPAC = Consensus::LLMQ_50_60;
consensus.llmqs[Consensus::LLMQ_5_60] = llmq5_60;
consensus.llmqChainLocks = Consensus::LLMQ_5_60;
consensus.llmqForInstaPAC = Consensus::LLMQ_5_60;

fMiningRequiresPeers = true;
fDefaultConsistencyChecks = false;
fRequireStandard = false;
fRequireStandard = true;
fRequireRoutableExternalIP = false;
fMineBlocksOnDemand = false;
fAllowMultipleAddressesFromGroup = false;
fAllowMultipleAddressesFromGroup = true;
fAllowMultiplePorts = true;

nPoolMinParticipants = 3;
nPoolMaxParticipants = 5;
nFulfilledRequestExpireTime = 5*60; // fulfilled requests expire in 5 minutes

vSporkAddresses = {"yarEgAKyKCAanupC45vXhdWe6DAQf7RKPh"};
vSporkAddresses = {"yTpFjxs3Rtwe7MXfC1i5XACz2K5UYi2GpL"};
nMinSporkKeys = 1;
fBIP9CheckMasternodesUpgraded = true;

Expand Down Expand Up @@ -582,7 +589,6 @@ class CDevNetParams : public CChainParams {
consensus.nGovernanceFilterElements = 500;
consensus.nMasternodeMinimumConfirmations = 1;
consensus.nMasternodeCollateral = 500000 * COIN;
consensus.nCollateralBugHeight = 0;
consensus.BIP34Height = 1; // BIP34 activated immediately on devnet
consensus.BIP65Height = 1; // BIP65 activated immediately on devnet
consensus.BIP66Height = 1; // BIP66 activated immediately on devnet
Expand Down
10 changes: 0 additions & 10 deletions src/chainparamsseeds.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,7 @@
* IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly.
*/
static SeedSpec6 pnSeed6_main[] = {
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x74,0xcb,0x9a,0x6e}, 7112},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x74,0xcb,0x9b,0x1a}, 7112},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x74,0xcb,0x37,0x86}, 7112},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x74,0xcb,0xdd,0xf9}, 7112},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0xd8,0xa3,0x29}, 7112},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0xd9,0x0b,0x8d}, 7112},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0xd9,0x0b,0x8c}, 7112},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0xd8,0x98,0x22}, 7112}
};
static SeedSpec6 pnSeed6_test[] = {
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9d,0xe6,0xf4,0xe9}, 29999},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa5,0x16,0x64,0x7f}, 29999}
};
#endif // PAC_CHAINPARAMSSEEDS_H
8 changes: 7 additions & 1 deletion src/consensus/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ struct BIP9Deployment {
int64_t nWindowSize;
/** A number of blocks, in the range of 1..nWindowSize, which must signal for a fork in order to lock it in. */
int64_t nThreshold;
/** Constant for nTimeout very far in the future. */
static constexpr int64_t NO_TIMEOUT = std::numeric_limits<int64_t>::max();
/** Special value for nStartTime indicating that the deployment is always active.
* This is useful for testing, as it means tests don't need to deal with the activation
* process (which takes at least 3 BIP9 intervals). Only tests that specifically test the
* behaviour during activation cannot use this. */
static constexpr int64_t ALWAYS_ACTIVE = -1;
};

enum LLMQType : uint8_t
Expand Down Expand Up @@ -138,7 +145,6 @@ struct Params {
int nGovernanceFilterElements;
int nMasternodeMinimumConfirmations;
CAmount nMasternodeCollateral;
int nCollateralBugHeight;
/** Block height and hash at which BIP34 becomes active */
int BIP34Height;
uint256 BIP34Hash;
Expand Down
12 changes: 6 additions & 6 deletions src/evo/cbtx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ bool CheckCbTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CValidatio
return state.DoS(100, false, REJECT_INVALID, "bad-cbtx-height");
}

if (pindexPrev) {
bool fDIP0008Active = VersionBitsState(pindexPrev, Params().GetConsensus(), Consensus::DEPLOYMENT_DIP0008, versionbitscache) == THRESHOLD_ACTIVE;
if (fDIP0008Active && cbTx.nVersion < 2) {
return state.DoS(100, false, REJECT_INVALID, "bad-cbtx-version");
}
}
// if (pindexPrev) {
// bool fDIP0008Active = VersionBitsState(pindexPrev, Params().GetConsensus(), Consensus::DEPLOYMENT_DIP0008, versionbitscache) == THRESHOLD_ACTIVE;
// if (fDIP0008Active && cbTx.nVersion < 2) {
// return state.DoS(100, false, REJECT_INVALID, "bad-cbtx-version");
// }
// }

return true;
}
Expand Down
13 changes: 1 addition & 12 deletions src/evo/providertx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,6 @@ bool CheckProRegTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CValid
if (mnList.HasUniqueProperty(ptx.keyIDOwner) || mnList.HasUniqueProperty(ptx.pubKeyOperator)) {
return state.DoS(10, false, REJECT_DUPLICATE, "bad-protx-dup-key");
}

if (!deterministicMNManager->IsDIP3Enforced(pindexPrev->nHeight)) {
if (ptx.keyIDOwner != ptx.keyIDVoting) {
return state.DoS(10, false, REJECT_INVALID, "bad-protx-key-not-same");
}
}
}

if (!CheckInputsHash(tx, ptx, state)) {
Expand Down Expand Up @@ -330,15 +324,10 @@ bool CheckProUpRegTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CVal
}
}

if (!deterministicMNManager->IsDIP3Enforced(pindexPrev->nHeight)) {
if (dmn->pdmnState->keyIDOwner != ptx.keyIDVoting) {
return state.DoS(10, false, REJECT_INVALID, "bad-protx-key-not-same");
}
}

if (!CheckInputsHash(tx, ptx, state)) {
return false;
}

if (!CheckHashSig(ptx, dmn->pdmnState->keyIDOwner, state)) {
return false;
}
Expand Down
4 changes: 1 addition & 3 deletions src/governance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1268,9 +1268,7 @@ void CGovernanceManager::UpdatedBlockTip(const CBlockIndex* pindex, CConnman& co
nCachedBlockHeight = pindex->nHeight;
LogPrint("gobject", "CGovernanceManager::UpdatedBlockTip -- nCachedBlockHeight: %d\n", nCachedBlockHeight);

if (deterministicMNManager->IsDIP3Enforced(pindex->nHeight)) {
RemoveInvalidVotes();
}
RemoveInvalidVotes();

CheckPostponedObjects(connman);

Expand Down
2 changes: 2 additions & 0 deletions src/llmq/quorums_chainlocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,13 @@ void CChainLocksHandler::TrySignChainTip()
}
}

#if 0
if (txAge < WAIT_FOR_ISLOCK_TIMEOUT && !quorumInstantSendManager->IsLocked(txid)) {
LogPrint("chainlocks", "CChainLocksHandler::%s -- not signing block %s due to TX %s not being ixlocked and not old enough. age=%d\n", __func__,
pindexWalk->GetBlockHash().ToString(), txid.ToString(), txAge);
return;
}
#endif
}

pindexWalk = pindexWalk->pprev;
Expand Down
4 changes: 0 additions & 4 deletions src/llmq/quorums_dkgsessionhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,6 @@ bool CDKGSessionHandler::InitNewQuorum(int newQuorumHeight, const uint256& newQu

curSession = std::make_shared<CDKGSession>(params, blsWorker, dkgManager);

if (!deterministicMNManager->IsDIP3Enforced(newQuorumHeight)) {
return false;
}

auto mns = CLLMQUtils::GetAllQuorumMembers(params.type, newQuorumHash);

if (!curSession->Init(newQuorumHeight, newQuorumHash, mns, activeMasternodeInfo.proTxHash)) {
Expand Down
3 changes: 1 addition & 2 deletions src/llmq/quorums_dkgsessionmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ void CDKGSessionManager::UpdatedBlockTip(const CBlockIndex* pindexNew, bool fIni

if (fInitialDownload)
return;
if (!deterministicMNManager->IsDIP3Enforced(pindexNew->nHeight))
return;

if (!sporkManager.IsSporkActive(SPORK_17_QUORUM_DKG_ENABLED))
return;

Expand Down
Loading