Skip to content

Commit

Permalink
Enforce correct chain and deterministic operation.
Browse files Browse the repository at this point in the history
  • Loading branch information
barrystyle committed Oct 4, 2019
1 parent 7ffebde commit 8efaee1
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
16 changes: 10 additions & 6 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ class CMainParams : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nThreshold = 10;

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

// By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("0x0000000000000000000000000000000000000000000000000000000000000000");
Expand All @@ -312,12 +312,14 @@ class CMainParams : public CChainParams {
assert(genesis.hashMerkleRoot == uint256S("0xf3939e4de05e537431ef32bbebd9bc7c4e701f7205d72016f04686557af58dbf"));

vSeeds.clear();
vSeeds.push_back(CDNSSeedData("pacglobal.io", "seed2.pacglobal.io"));
vSeeds.push_back(CDNSSeedData("pacglobal.io", "seed3.pacglobal.io"));
vSeeds.push_back(CDNSSeedData("pacnode.net", "seed0.pacnode.net"));
vSeeds.push_back(CDNSSeedData("pacnode.net", "seed1.pacnode.net"));
vSeeds.push_back(CDNSSeedData("pacnode.net", "seed2.pacnode.net"));
vSeeds.push_back(CDNSSeedData("pacnode.net", "seed3.pacnode.net"));
vSeeds.push_back(CDNSSeedData("pacglobal.io", "seed0.pacglobal.io"));
vSeeds.push_back(CDNSSeedData("pacglobal.io", "seed1.pacglobal.io"));
vSeeds.push_back(CDNSSeedData("pacnode.net", "seed2.pacnode.net"));
vSeeds.push_back(CDNSSeedData("pacnode.net", "seed3.pacnode.net"));

// PAC addresses start with 'P'
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,55);
Expand Down Expand Up @@ -356,7 +358,7 @@ class CMainParams : public CChainParams {

vSporkAddresses = {"PGtvidAAsW6a9tMBKmdh2tZ1B3SxFDpdXP"};
nMinSporkKeys = 1;
fBIP9CheckMasternodesUpgraded = false;
fBIP9CheckMasternodesUpgraded = true;

checkpointData = (CCheckpointData) {
boost::assign::map_list_of
Expand All @@ -374,12 +376,14 @@ class CMainParams : public CChainParams {
( 280000, uint256S("0x0000000000003b2680a18e08c41719206c76b05e2eb32f8aa45730246d63b2b7"))
( 290000, uint256S("0x00000000000069c1ef2e4f3122e6021177b581fd944c174390f1d3cdcdcc6722"))
( 300000, uint256S("0x0000000000001f4f2650510e1ad032f356d2fcb001aafcd5e13a87a259f8e15e"))
( 330000, uint256S("0x816ef933e4ab900d99eecde8d6abb1d2f2b71c001d05f79f5d4b98a67facd143"))
( 331000, uint256S("0xec03918f66618c53742a0638d976b2b56807d3e3ca7a7de2d72e920f02fe521e"))
( 332000, uint256S("0xbee2c8b8c12ad020783e241e086440f92054c7ea557c7639c32bc7fa6430a0cd"))
};

chainTxData = ChainTxData{
1550525942, // * UNIX timestamp of last known number of transactions
814704, // * total number of transactions between genesis and that timestamp
1570098593, // * UNIX timestamp of last known number of transactions
980978, // * 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
};
Expand Down
8 changes: 8 additions & 0 deletions src/chainparamsseeds.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
* 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},
Expand Down
5 changes: 0 additions & 5 deletions src/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,6 @@ bool CheckProofOfStake(const CBlock &block, uint256& hashProofOfStake)

CTxOut prevTxOut = txPrev->vout[txin.prevout.n];

// Troublemaker prevention (garn)
if (prevTxOut.nValue == Params().GetConsensus().nMasternodeCollateral &&
chainActive.Height() > Params().GetConsensus().nCollateralBugHeight)
return error("CheckProofOfStake() : INFO: we have some comedians with us tonight!");

// Enforce minimum amount for stake input
if (prevTxOut.nValue < Params().GetConsensus().nMinimumStakeValue)
return error("CheckProofOfStake() : INFO: stakeinput value less than minimum required (%llu < %llu), blockhash %s\n",
Expand Down
2 changes: 1 addition & 1 deletion src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1963,7 +1963,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
// Send the rest of the chain
if (pindex)
pindex = chainActive.Next(pindex);
int nLimit = 500;
int nLimit = 1000;
LogPrint("net", "getblocks %d to %s limit %d from peer=%d\n", (pindex ? pindex->nHeight : -1), hashStop.IsNull() ? "end" : hashStop.ToString(), nLimit, pfrom->id);
for (; pindex; pindex = chainActive.Next(pindex))
{
Expand Down
2 changes: 1 addition & 1 deletion src/txdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CCoinsViewDBCursor;
class uint256;

//! Compensate for extra memory peak (x1.5-x1.9) at flush time.
static constexpr int DB_PEAK_USAGE_FACTOR = 2;
static constexpr int DB_PEAK_USAGE_FACTOR = 8;
//! No need to periodic flush if at least this much space still available.
static constexpr int MAX_BLOCK_COINSDB_USAGE = 10 * DB_PEAK_USAGE_FACTOR;
//! -dbcache default (MiB)
Expand Down

0 comments on commit 8efaee1

Please sign in to comment.