Skip to content

Commit

Permalink
Sync issue fix
Browse files Browse the repository at this point in the history
Seed node update.
Fix issue with df04016.
Unsuitable Dash-specific code removed.
Checkpoint update.
Progress feedback improved.
  • Loading branch information
Krekeler committed Nov 24, 2019
1 parent b9e9f99 commit 4ecc327
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 21 deletions.
11 changes: 9 additions & 2 deletions contrib/seeds/nodes_main.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
45.84.0.125:41319
45.124.64.164:41319
46.105.181.190:41319
74.208.160.38:41319
77.73.66.229:41319
80.211.88.234:41319
81.169.215.168:41319
85.214.65.60:41319
91.200.100.209:41319
95.216.143.13:41319
104.140.22.62:41319
104.206.241.183:41319
107.172.248.127:41319
107.174.203.97:41319
107.175.31.173:41319
145.239.184.91:41319
159.69.189.185:41319
192.3.80.58:41319
195.201.226.128:41319
213.59.123.142:41319
217.160.60.76:41319
3 changes: 3 additions & 0 deletions contrib/seeds/nodes_test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
81.169.215.168:41319
85.214.65.60:41419
95.216.143.13:41419
107.174.203.97:41419
159.69.189.185:41419
185.122.58.44:41419
195.201.226.128:41419
32 changes: 17 additions & 15 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class CMainParams : public CChainParams {
consensus.nPowTargetSpacing = 6 * 60; // DMS 6 minutes (initial 4 minutes); Bitcoin 10 minutes; Dash 2.5 minutes
consensus.fPowAllowMinDifficultyBlocks = false;
consensus.fPowNoRetargeting = false;
consensus.nPowNTSHeight = 0;
consensus.nPowNTSHeight = 4794; // see commit df04016c84ee09eb716605a962cf05064c7eea9f
consensus.nRuleChangeActivationThreshold = 1916; // 95% of 2016
consensus.nMinerConfirmationWindow = 2016; //relevant to BIP 9 soft fork, see params.h
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
Expand All @@ -177,10 +177,10 @@ class CMainParams : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nThreshold = 3226; // 80% of 4032

// The best chain should have at least this much work. Backport "assumed valid blocks" feature from Bitcoin 0.13 https://github.com/dashpay/dash/commit/ccee103a0e6f568f545c4e6b06f6a3e565cdbcb1#diff-64cbe1ad5465e13bc59ee8bb6f3de2e7
consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000000000000100010"); // TODO
consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000000000000045e8fe4cec");

// By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("0x00000295f0e654ec4c7ec2e4051acaca0eda31ae2ca2d7a38e56a7875cf457dd"); // 79403
consensus.defaultAssumeValid = uint256S("0x0000000c15de23b822043f7fd7ff4ace4761ec455da710442ef6c1e5035a14d1"); // 103260

/**
* The message start string is designed to be unlikely to occur in normal data.
Expand Down Expand Up @@ -263,13 +263,15 @@ class CMainParams : public CChainParams {
( 79403, uint256S("0x00000295f0e654ec4c7ec2e4051acaca0eda31ae2ca2d7a38e56a7875cf457dd")) // 2019-Aug-12
( 86998, uint256S("0x0000000d6ca0904b7ec849283a177b7a25b0ed3c23413c14d9e564bfa4d2514a")) // 2019-Sep-14
( 94707, uint256S("0x000000d52750d7b5cf3e682106b258de7f9c0f66e011e7cf0699b6526a05339d")) // 2019-Oct-18
(100000, uint256S("0x00000095a23b6cc9ec9c0d7385bf4c3705220271d425a203af41163b4600e96d")) // 2019-Nov-10
(103260, uint256S("0x0000000c15de23b822043f7fd7ff4ace4761ec455da710442ef6c1e5035a14d1")) // 2019-Nov-24
};

chainTxData = ChainTxData{
1535270400, // * UNIX timestamp of last known number of transactions
0, // * total number of transactions between genesis and that timestamp
// (the tx=... number in the SetBestChain debug.log lines)
0.1 // * estimated number of transactions per second after that timestamp https://github.com/dashpay/dash/commit/658479355e298307e7d087893c4fd545ab61a0cc#diff-64cbe1ad5465e13bc59ee8bb6f3de2e7
1574599910, // * UNIX timestamp of last known number of transactions
141893, // * total number of transactions between genesis and that timestamp
// (the tx=... number in the UpdateTip debug.log lines)
0.01 // * estimated number of transactions per second after that timestamp
};
}
};
Expand Down Expand Up @@ -334,10 +336,10 @@ class CTestNetParams : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nThreshold = 3226;

// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000000000000100010");
consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000000000023f5f791");

// By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("0x00011741fd5041f21e6309f6479ca5af3dc077516344df8640faf4fd7b948e89");
consensus.defaultAssumeValid = uint256S("0x00003f6631657d5cbad67f3da00c7c3ed5d43d969c419026b32ffd73412348c4"); // 104960

pchMessageStart[0] = 0xce; // same as Dash Testnet
pchMessageStart[1] = 0x44; // D
Expand Down Expand Up @@ -399,7 +401,6 @@ class CTestNetParams : public CChainParams {
checkpointData = (CCheckpointData) {
boost::assign::map_list_of
( 0, uint256S("0x00004399a114a034b2f8d742b8e7f018d3cfdec0b25150d0b7e271b63c9cd4ce"))
( 133, uint256S("0x00093b270f3e8b798c6463821fc660583002778ee09d96e6ff99b64d1200f9aa"))
( 4600, uint256S("0x00024d5b6d0aa1cfda1f78360cc85d246bab6c08b9a4684094adfbfc14afee8d"))
( 15000, uint256S("0x0006adc6713cbbdbcb4dfe4de2c6197a5ccfa061aab8abc93c6b12c161197245"))
( 20013, uint256S("0x000db2f24a22ad664156f89734b09326a7b93e824d29d14d7ce9b41b4f4ac2d3"))
Expand All @@ -412,13 +413,14 @@ class CTestNetParams : public CChainParams {
( 73989, uint256S("0x0003ecfd52a44d853c3e9967764482a10e6f16dacb0a634dd62d993ef2b22cf8"))
( 86998, uint256S("0x0007fc0bf4654559a160911cb8cabf494ffb1010867a6141ee48bd130812cea0"))
( 94707, uint256S("0x000b602b64a3d1ef2d001bbcb5466ab68a1536e1bcddb193311c64ef14ac628d"))
( 96078, uint256S("0x00011741fd5041f21e6309f6479ca5af3dc077516344df8640faf4fd7b948e89"))
(100000, uint256S("0x00001db74c7881d3294ed79f695085086e80c17c7d042555a569b4440f734e9d"))
(104960, uint256S("0x00003f6631657d5cbad67f3da00c7c3ed5d43d969c419026b32ffd73412348c4"))
};
chainTxData = ChainTxData{
1559127600, // * UNIX timestamp of last known number of transactions
0, // * total number of transactions between genesis and that timestamp
// (the tx=... number in the SetBestChain debug.log lines)
0.01 // * estimated number of transactions per second after that timestamp
1574600128, // * UNIX timestamp of last known number of transactions
105776, // * total number of transactions between genesis and that timestamp
// (the tx=... number in the UpdateTip debug.log lines)
0.003 // * estimated number of transactions per second after that timestamp
};
}
};
Expand Down
14 changes: 12 additions & 2 deletions src/chainparamsseeds.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,34 @@
* 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,0x2d,0x54,0x00,0x7d}, 41319},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x7c,0x40,0xa4}, 41319},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0x69,0xb5,0xbe}, 41319},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4a,0xd0,0xa0,0x26}, 41319},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4d,0x49,0x42,0xe5}, 41319},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x50,0xd3,0x58,0xea}, 41319},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x51,0xa9,0xd7,0xa8}, 41319},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0xd6,0x41,0x3c}, 41319},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0xc8,0x64,0xd1}, 41319},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0xd8,0x8f,0x0d}, 41319},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x68,0x8c,0x16,0x3e}, 41319},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x68,0xce,0xf1,0xb7}, 41319},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6b,0xac,0xf8,0x7f}, 41319},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6b,0xae,0xcb,0x61}, 41319},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6b,0xaf,0x1f,0xad}, 41319},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x91,0xef,0xb8,0x5b}, 41319},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9f,0x45,0xbd,0xb9}, 41319},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0x03,0x50,0x3a}, 41319},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0xc9,0xe2,0x80}, 41319},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd5,0x3b,0x7b,0x8e}, 41319},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd9,0xa0,0x3c,0x4c}, 41319}
};

static SeedSpec6 pnSeed6_test[] = {
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x51,0xa9,0xd7,0xa8}, 41319},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0xd6,0x41,0x3c}, 41419},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0xd8,0x8f,0x0d}, 41419},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6b,0xae,0xcb,0x61}, 41419},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9f,0x45,0xbd,0xb9}, 41419},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x7a,0x3a,0x2c}, 41419},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0xc9,0xe2,0x80}, 41419}
};
#endif // DMS_CHAINPARAMSSEEDS_H
7 changes: 6 additions & 1 deletion src/pow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ unsigned int static DarkGravityWave(const CBlockIndex* pindexLast, const CBlockH
nPowTargetSpacing = params.nPowTargetSpacing; // normal block interval
}
else {
nPowTargetSpacing = 30; // fast testnet 0..95936
if (Params().NetworkIDString() == CBaseChainParams::MAIN)
nPowTargetSpacing = 4*60; // 4min 0..4793
else if (Params().NetworkIDString() == CBaseChainParams::TESTNET)
nPowTargetSpacing = 30; // fast testnet 0..95936
else
params.nPowTargetSpacing;
}

// make sure we have at least (nPastBlocks + 1) blocks, otherwise just return powLimit
Expand Down
8 changes: 7 additions & 1 deletion src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,7 @@ CAmount GetMasternodePayment(int nHeight, CAmount blockValue)
if(nHeight > nMNPIBlock+(nMNPIPeriod* 3)) ret += blockValue / 40; // 81000 - 37.5% ~ 2019-08-19
if(nHeight > nMNPIBlock+(nMNPIPeriod* 4)) ret += blockValue / 40; // 88000 - 40.0% ~ 2019-09-18
if(nHeight > nMNPIBlock+(nMNPIPeriod* 5)) ret += blockValue /100; // 95000 - 41.0% ~ 2019-10-19
if(nHeight > nMNPIBlock+(nMNPIPeriod* 6)) ret += blockValue /100; // 102000 - 42.0% ~ 2019-11
if(nHeight > nMNPIBlock+(nMNPIPeriod* 6)) ret += blockValue /100; // 102000 - 42.0% ~ 2019-11-19
if(nHeight > nMNPIBlock+(nMNPIPeriod* 7)) ret += blockValue /100; // 109000 - 43.0% ~ 2019-12
if(nHeight > nMNPIBlock+(nMNPIPeriod* 8)) ret += blockValue /100; // 116000 - 44.0% ~ 2020-01
if(nHeight > nMNPIBlock+(nMNPIPeriod* 9)) ret += blockValue /100; // 123000 - 45.0% ~ 2020-02
Expand Down Expand Up @@ -3394,6 +3394,7 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
{
const int nHeight = pindexPrev == NULL ? 0 : pindexPrev->nHeight + 1;
// Check proof of work
/* Dash specific, not used in DMS
if(Params().NetworkIDString() == CBaseChainParams::MAIN && nHeight <= 68589){
// architecture issues with DGW v1 and v2)
unsigned int nBitsNext = GetNextWorkRequired(pindexPrev, &block, consensusParams);
Expand All @@ -3407,6 +3408,11 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
if (block.nBits != GetNextWorkRequired(pindexPrev, &block, consensusParams))
return state.DoS(100, false, REJECT_INVALID, "bad-diffbits", false, strprintf("incorrect proof of work at %d", nHeight));
}
*/
unsigned int nGnwr = GetNextWorkRequired(pindexPrev, &block, consensusParams);
//LogPrintf("DEBUG %s at %d (%d: %d , %d)\n", __func__, nHeight, pindexPrev->nHeight, block.nBits, nGnwr); // starts with: nHeight = 1 and pindexPrev->nHeight = 0
if (block.nBits != nGnwr)
return state.DoS(100, false, REJECT_INVALID, "bad-diffbits", false, strprintf("incorrect proof of work at %d (%d != %d)", nHeight, block.nBits, nGnwr));

// Check timestamp against prev
if (block.GetBlockTime() <= pindexPrev->GetMedianTimePast())
Expand Down

0 comments on commit 4ecc327

Please sign in to comment.