Skip to content

Commit

Permalink
Merge pull request #57 from pepecoinppc/update-auxpow-block-activatio…
Browse files Browse the repository at this point in the history
…n-height

Set auxpow activation height to 42,000
  • Loading branch information
pepecoinppc authored May 9, 2024
2 parents 86f87df + d65fdee commit 93a5b0d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
14 changes: 6 additions & 8 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ class CMainParams : public CChainParams {
CMainParams() {
strNetworkID = "main";

// Blocks 0 - 144999 are conventional difficulty calculation
consensus.nSubsidyHalvingInterval = 100000;
consensus.nMajorityEnforceBlockUpgrade = 1500;
consensus.nMajorityRejectBlockOutdated = 1900;
Expand Down Expand Up @@ -123,18 +122,18 @@ class CMainParams : public CChainParams {
consensus.nHeightEffective = 0;
consensus.fSimplifiedRewards = true;

// Blocks 1000 - 37,999 are Digishield without AuxPoW
// Blocks 1000 - 41,999 are Digishield without AuxPoW
digishieldConsensus = consensus;
digishieldConsensus.nHeightEffective = 1000;
digishieldConsensus.fSimplifiedRewards = true;
digishieldConsensus.fDigishieldDifficultyCalculation = true;
digishieldConsensus.nPowTargetTimespan = 60; // post-digishield: 1 minute
digishieldConsensus.nCoinbaseMaturity = 240;

// Blocks 38,000+ are AuxPoW
// Blocks 42,000+ are AuxPoW
// Some tests from Dogecoin expect non-auxpow blocks. This allows those tests to pass.
auxpowConsensus = digishieldConsensus;
auxpowConsensus.nHeightEffective = 38000;
auxpowConsensus.nHeightEffective = 42000;
auxpowConsensus.fAllowLegacyBlocks = false;

// Assemble the binary search tree of consensus parameters
Expand Down Expand Up @@ -199,7 +198,6 @@ class CTestNetParams : public CChainParams {
CTestNetParams() {
strNetworkID = "test";

// Blocks 0 - 144999 are pre-Digishield
consensus.nSubsidyHalvingInterval = 100000;
consensus.nMajorityEnforceBlockUpgrade = 501;
consensus.nMajorityRejectBlockOutdated = 750;
Expand Down Expand Up @@ -256,15 +254,15 @@ class CTestNetParams : public CChainParams {
digishieldConsensus.fPowAllowMinDifficultyBlocks = false;
digishieldConsensus.nCoinbaseMaturity = 240;

// Blocks 1250 - 37,999 are Digishield with minimum difficulty on all blocks
// Blocks 1250 - 41,999 are Digishield with minimum difficulty on all blocks
minDifficultyConsensus = digishieldConsensus;
minDifficultyConsensus.nHeightEffective = 1250;
minDifficultyConsensus.fPowAllowDigishieldMinDifficultyBlocks = true;
minDifficultyConsensus.fPowAllowMinDifficultyBlocks = true;

// Enable AuxPoW at 38,000
// Enable AuxPoW at 42,000
auxpowConsensus = minDifficultyConsensus;
auxpowConsensus.nHeightEffective = 38000;
auxpowConsensus.nHeightEffective = 42000;
auxpowConsensus.fPowAllowDigishieldMinDifficultyBlocks = true;
auxpowConsensus.fAllowLegacyBlocks = false;

Expand Down
6 changes: 3 additions & 3 deletions src/test/pepecoin_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,13 @@ BOOST_AUTO_TEST_CASE(hardfork_parameters)
BOOST_CHECK_EQUAL(digishieldParams.fAllowLegacyBlocks, true);
BOOST_CHECK_EQUAL(digishieldParams.fDigishieldDifficultyCalculation, true);

const Consensus::Params& digishieldParamsEnd = Params().GetConsensus(37999);
const Consensus::Params& digishieldParamsEnd = Params().GetConsensus(41999);
BOOST_CHECK_EQUAL(digishieldParamsEnd.nPowTargetTimespan, 60);
BOOST_CHECK_EQUAL(digishieldParamsEnd.fAllowLegacyBlocks, true);
BOOST_CHECK_EQUAL(digishieldParamsEnd.fDigishieldDifficultyCalculation, true);

const Consensus::Params& auxpowParams = Params().GetConsensus(38000);//PEPE TODO Magic number
BOOST_CHECK_EQUAL(auxpowParams.nHeightEffective, 38000);//PEPE TODO Magic number
const Consensus::Params& auxpowParams = Params().GetConsensus(42000);//PEPE TODO Magic number
BOOST_CHECK_EQUAL(auxpowParams.nHeightEffective, 42000);//PEPE TODO Magic number
BOOST_CHECK_EQUAL(auxpowParams.nPowTargetTimespan, 60);
BOOST_CHECK_EQUAL(auxpowParams.fAllowLegacyBlocks, false);
BOOST_CHECK_EQUAL(auxpowParams.fDigishieldDifficultyCalculation, true);
Expand Down

0 comments on commit 93a5b0d

Please sign in to comment.