Skip to content

Commit c03be0a

Browse files
author
GINcoin Dev
committed
DGW parameters change + checkpoints - v1.0.2.0
1 parent 88fb952 commit c03be0a

File tree

11 files changed

+55
-24
lines changed

11 files changed

+55
-24
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
22
AC_PREREQ([2.60])
33
define(_CLIENT_VERSION_MAJOR, 1)
44
define(_CLIENT_VERSION_MINOR, 0)
5-
define(_CLIENT_VERSION_REVISION, 0)
5+
define(_CLIENT_VERSION_REVISION, 2)
66
define(_CLIENT_VERSION_BUILD, 0)
77
define(_CLIENT_VERSION_IS_RELEASE, true)
88
define(_COPYRIGHT_YEAR, 2017)

contrib/gitian-descriptors/gitian-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: "gincoin-linux-0.12"
2+
name: "gincoin-linux-1.0.2.0"
33
enable_cache: true
44
suites:
55
- "trusty"

contrib/gitian-descriptors/gitian-osx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: "gincoin-osx-0.1.0.0"
2+
name: "gincoin-osx-1.0.2.0"
33
enable_cache: true
44
suites:
55
- "trusty"

contrib/gitian-descriptors/gitian-win.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: "gincoin-win-0.12"
2+
name: "gincoin-win-1.0.2.0"
33
enable_cache: true
44
suites:
55
- "trusty"

share/genbuild.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if [ -e "$(which git 2>/dev/null)" -a "$(git rev-parse --is-inside-work-tree 2>/
2828

2929
# otherwise generate suffix from git, i.e. string like "59887e8-dirty"
3030
SUFFIX=$(git rev-parse --short HEAD)
31-
git diff-index --quiet HEAD -- || SUFFIX="$SUFFIX-dirty"
31+
git diff-index --quiet HEAD -- || SUFFIX="$SUFFIX" #-dirty
3232

3333
# get a string like "2012-04-10 16:27:19 +0200"
3434
LAST_COMMIT_DATE="$(git log -n 1 --format="%ci")"

src/chainparams.cpp

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ class CMainParams : public CChainParams {
9393
consensus.BIP34Height = 0;
9494
consensus.BIP34Hash = uint256S("0x00000cd6bde619b2c3b23ad2e384328a450a37fa28731debf748c3b17f91f97d");
9595
consensus.powLimit = uint256S("00000fffff000000000000000000000000000000000000000000000000000000");
96-
consensus.nPowTargetTimespan = 24 * 60 * 60; // Gincoin: 1 day
97-
consensus.nPowTargetSpacing = 2.5 * 60; // Gincoin: 2.5 minutes
96+
consensus.nPowTargetTimespan = 24 * 60 * 60; // Gincoin: 1 day // used only for KGW and Bitcoin Diff
97+
consensus.nPowTargetSpacing = 2.5 * 60; // Gincoin: 2.5 minutes // soft change to nPowApr2018TargetSpacing after mPowDGWReconfigureApr2018Height
9898
consensus.fPowAllowMinDifficultyBlocks = false;
9999
consensus.fPowNoRetargeting = false;
100100
consensus.nPowKGWHeight = 15200; //not used
@@ -117,11 +117,15 @@ class CMainParams : public CChainParams {
117117
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nWindowSize = 4032;
118118
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nThreshold = 3226; // 80% of 4032
119119

120+
// Consensus Update Apr 2018
121+
consensus.mPowDGWReconfigureApr2018Height = 23750;
122+
consensus.nPowApr2018TargetSpacing = 2 * 60;
123+
120124
// The best chain should have at least this much work.
121-
consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000000000006500074");
125+
consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000047a222baa2d1fe");
122126

123127
// By default assume that the signatures in ancestors of this block are valid.
124-
consensus.defaultAssumeValid = uint256S("0x000001d9726a3d9624b6bd53428b658204333461708f84a520570272c5d7f511");
128+
consensus.defaultAssumeValid = uint256S("0x00000000000a106c24554e369cdacdb683fd6daef276ca38b1991ad82e74dc63");
125129

126130
/**
127131
* The message start string is designed to be unlikely to occur in normal data.
@@ -181,9 +185,11 @@ class CMainParams : public CChainParams {
181185
( 0, consensus.hashGenesisBlock)
182186
( 20, uint256S("0x000003e547bec8e303a0af407ab1781e1a56ce995d4cb8abd9443d8e89daee94"))
183187
( 100, uint256S("0x000001d9726a3d9624b6bd53428b658204333461708f84a520570272c5d7f511"))
188+
( 1000, uint256S("0x00000000015079cff402ec1f9d88af43eba786f1a70bed49eca4c96b1786c074"))
189+
( 22092, uint256S("0x00000000000a106c24554e369cdacdb683fd6daef276ca38b1991ad82e74dc63"))
184190
,
185-
1519397453, // * UNIX timestamp of last checkpoint block
186-
0, // * total number of transactions between genesis and last checkpoint
191+
1522841266, // * UNIX timestamp of last checkpoint block
192+
28497, // * total number of transactions between genesis and last checkpoint
187193
// (the tx=... number in the SetBestChain debug.log lines)
188194
5000 // * estimated number of transactions per day after checkpoint
189195
};
@@ -218,8 +224,8 @@ class CTestNetParams : public CChainParams {
218224
consensus.BIP34Height = 0;
219225
consensus.BIP34Hash = uint256S("0x0000070936337da4fa971d46112401d17a7288b57bde0e45fba010b94b2577a9");
220226
consensus.powLimit = uint256S("00000fffff000000000000000000000000000000000000000000000000000000");
221-
consensus.nPowTargetTimespan = 24 * 60 * 60; // Gincoin: 1 day
222-
consensus.nPowTargetSpacing = 2.5 * 60; // Gincoin: 2.5 minutes
227+
consensus.nPowTargetTimespan = 24 * 60 * 60; // Gincoin: 1 day // used only for KGW and Bitcoin Diff
228+
consensus.nPowTargetSpacing = 2 * 60; // Gincoin: 2 minutes
223229
consensus.fPowAllowMinDifficultyBlocks = true;
224230
consensus.fPowNoRetargeting = false;
225231
consensus.nPowKGWHeight = 4001; // nPowKGWHeight >= nPowDGWHeight means "no KGW"
@@ -248,6 +254,10 @@ class CTestNetParams : public CChainParams {
248254
// By default assume that the signatures in ancestors of this block are valid.
249255
consensus.defaultAssumeValid = uint256S("0x00");
250256

257+
// Consensus Update Apr 2018
258+
consensus.mPowDGWReconfigureApr2018Height = 1;
259+
consensus.nPowApr2018TargetSpacing = 2 * 60;
260+
251261
pchMessageStart[0] = 0xce;
252262
pchMessageStart[1] = 0xe2;
253263
pchMessageStart[2] = 0xca;
@@ -336,8 +346,8 @@ class CRegTestParams : public CChainParams {
336346
consensus.BIP34Height = -1; // BIP34 has not necessarily activated on regtest
337347
consensus.BIP34Hash = uint256();
338348
consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
339-
consensus.nPowTargetTimespan = 24 * 60 * 60; // Gincoin: 1 day
340-
consensus.nPowTargetSpacing = 2.5 * 60; // Gincoin: 2.5 minutes
349+
consensus.nPowTargetTimespan = 24 * 60 * 60; // Gincoin: 1 day // used only for KGW and Bitcoin Diff
350+
consensus.nPowTargetSpacing = 2 * 60; // Gincoin: 2 minutes
341351
consensus.fPowAllowMinDifficultyBlocks = true;
342352
consensus.fPowNoRetargeting = true;
343353
consensus.nPowKGWHeight = 15200; // same as mainnet
@@ -360,6 +370,10 @@ class CRegTestParams : public CChainParams {
360370
// By default assume that the signatures in ancestors of this block are valid.
361371
consensus.defaultAssumeValid = uint256S("0x00");
362372

373+
// Consensus Update Apr 2018
374+
consensus.mPowDGWReconfigureApr2018Height = 1;
375+
consensus.nPowApr2018TargetSpacing = 2 * 60;
376+
363377
pchMessageStart[0] = 0xfc;
364378
pchMessageStart[1] = 0xc1;
365379
pchMessageStart[2] = 0xb7;

src/clientversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
//! These need to be macros, as clientversion.cpp's and dash*-res.rc's voodoo requires it
1717
#define CLIENT_VERSION_MAJOR 1
1818
#define CLIENT_VERSION_MINOR 0
19-
#define CLIENT_VERSION_REVISION 0
19+
#define CLIENT_VERSION_REVISION 2
2020
#define CLIENT_VERSION_BUILD 0
2121

2222
//! Set to true for release, false for prerelease or test build

src/consensus/params.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,23 @@ struct Params {
8484
int64_t DifficultyAdjustmentInterval() const { return nPowTargetTimespan / nPowTargetSpacing; }
8585
uint256 nMinimumChainWork;
8686
uint256 defaultAssumeValid;
87+
int mPowDGWReconfigureApr2018Height;
88+
int64_t nPowApr2018TargetSpacing;
89+
int64_t GetPowTargetSpacing(int blockHeight) const {
90+
if (blockHeight >= mPowDGWReconfigureApr2018Height) {
91+
return nPowApr2018TargetSpacing;
92+
} else {
93+
return nPowTargetSpacing;
94+
}
95+
}
96+
int nApr2018DGWPastBlocks;
97+
int64_t GetDGWPastBlocks(int blockHeight) const {
98+
if (blockHeight >= mPowDGWReconfigureApr2018Height) {
99+
return 30;
100+
} else {
101+
return 24;
102+
}
103+
}
87104
};
88105
} // namespace Consensus
89106

src/net_processing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ void UpdateBlockAvailability(NodeId nodeid, const uint256 &hash) {
349349
// Requires cs_main
350350
bool CanDirectFetch(const Consensus::Params &consensusParams)
351351
{
352-
return chainActive.Tip()->GetBlockTime() > GetAdjustedTime() - consensusParams.nPowTargetSpacing * 20;
352+
return chainActive.Tip()->GetBlockTime() > GetAdjustedTime() - consensusParams.GetPowTargetSpacing(chainActive.Tip()->nHeight) * 20;
353353
}
354354

355355
// Requires cs_main

src/pow.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ unsigned int static KimotoGravityWell(const CBlockIndex* pindexLast, const Conse
2929

3030
uint64_t pastSecondsMin = params.nPowTargetTimespan * 0.025;
3131
uint64_t pastSecondsMax = params.nPowTargetTimespan * 7;
32-
uint64_t PastBlocksMin = pastSecondsMin / params.nPowTargetSpacing;
33-
uint64_t PastBlocksMax = pastSecondsMax / params.nPowTargetSpacing;
32+
uint64_t PastBlocksMin = pastSecondsMin / params.GetPowTargetSpacing(BlockLastSolved->nHeight + 1);
33+
uint64_t PastBlocksMax = pastSecondsMax / params.GetPowTargetSpacing(BlockLastSolved->nHeight + 1);
3434

3535
if (BlockLastSolved == NULL || BlockLastSolved->nHeight == 0 || (uint64_t)BlockLastSolved->nHeight < PastBlocksMin) { return UintToArith256(params.powLimit).GetCompact(); }
3636

@@ -49,7 +49,7 @@ unsigned int static KimotoGravityWell(const CBlockIndex* pindexLast, const Conse
4949
PastDifficultyAveragePrev = PastDifficultyAverage;
5050

5151
PastRateActualSeconds = BlockLastSolved->GetBlockTime() - BlockReading->GetBlockTime();
52-
PastRateTargetSeconds = params.nPowTargetSpacing * PastBlocksMass;
52+
PastRateTargetSeconds = params.GetPowTargetSpacing(BlockLastSolved->nHeight + 1) * PastBlocksMass;
5353
PastRateAdjustmentRatio = double(1);
5454
if (PastRateActualSeconds < 0) { PastRateActualSeconds = 0; }
5555
if (PastRateActualSeconds != 0 && PastRateTargetSeconds != 0) {
@@ -83,7 +83,7 @@ unsigned int static KimotoGravityWell(const CBlockIndex* pindexLast, const Conse
8383
unsigned int static DarkGravityWave(const CBlockIndex* pindexLast, const Consensus::Params& params) {
8484
/* current difficulty formula, dash - DarkGravity v3, written by Evan Duffield - evan@dash.org */
8585
const arith_uint256 bnPowLimit = UintToArith256(params.powLimit);
86-
int64_t nPastBlocks = 24;
86+
int64_t nPastBlocks = params.GetDGWPastBlocks(pindexLast->nHeight);
8787

8888
// make sure we have at least (nPastBlocks + 1) blocks, otherwise just return powLimit
8989
if (!pindexLast || pindexLast->nHeight < nPastBlocks) {
@@ -112,7 +112,7 @@ unsigned int static DarkGravityWave(const CBlockIndex* pindexLast, const Consens
112112

113113
int64_t nActualTimespan = pindexLast->GetBlockTime() - pindex->GetBlockTime();
114114
// NOTE: is this accurate? nActualTimespan counts it for (nPastBlocks - 1) blocks only...
115-
int64_t nTargetTimespan = nPastBlocks * params.nPowTargetSpacing;
115+
int64_t nTargetTimespan = nPastBlocks * params.GetPowTargetSpacing(pindex->nHeight);
116116

117117
if (nActualTimespan < nTargetTimespan/3)
118118
nActualTimespan = nTargetTimespan/3;
@@ -146,7 +146,7 @@ unsigned int GetNextWorkRequiredBTC(const CBlockIndex* pindexLast, const CBlockH
146146
// Special difficulty rule for testnet:
147147
// If the new block's timestamp is more than 2* 2.5 minutes
148148
// then allow mining of a min-difficulty block.
149-
if (pblock->GetBlockTime() > pindexLast->GetBlockTime() + params.nPowTargetSpacing*2)
149+
if (pblock->GetBlockTime() > pindexLast->GetBlockTime() + params.GetPowTargetSpacing(pindexLast->nHeight+1)*2)
150150
return nProofOfWorkLimit;
151151
else
152152
{

0 commit comments

Comments
 (0)