Skip to content

Commit f4c6838

Browse files
NateIsernclaude
andcommitted
feat(testnet): short PoW phase + fast stake age so testnet is lively
Builds on the testnet block-1 premine fix. Tunes testnet-only params so a fresh chain reaches live PoS in minutes instead of hours: - CTestNetParams nLastPOWBlock 200 -> 25 (mine the PoW phase in minutes). - nStakeMinAge 7200s -> 60s on testnet only (PoS starts ~1 min after mining, not 2 hours). Mainnet keeps 7200s. Mainnet consensus is unchanged; this binary ships only as a *-testnet prerelease. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 8a58e00 commit f4c6838

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/chainparams.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,9 @@ class CTestNetParams : public CMainParams
472472
nMinerThreads = 0;
473473
nTargetTimespan = 1 * 60; // faircoin: 1 day
474474
nTargetSpacing = 1 * 60; // faircoin: 1 minute
475-
nLastPOWBlock = 200;
475+
// Short PoW phase so a fresh testnet can be mined to PoS in minutes
476+
// (mainnet is 10000). After this height blocks must be PoS.
477+
nLastPOWBlock = 25;
476478
nMaturity = 15;
477479
nMasternodeCountDrift = 4;
478480
nModifierUpdateBlock = 51197; //approx Mon, 17 Apr 2017 04:00:00 GMT

src/init.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,14 @@ bool AppInit2(boost::thread_group& threadGroup)
691691
fLogTimestamps = GetBoolArg("-logtimestamps", true);
692692
fLogIPs = GetBoolArg("-logips", false);
693693

694+
// Testnet: shorten the minimum stake age so a freshly-bootstrapped chain
695+
// starts producing PoS blocks within ~1 minute of the PoW phase instead of
696+
// 2 hours. Mainnet keeps the default nStakeMinAge (7200s).
697+
if (Params().NetworkID() == CBaseChainParams::TESTNET) {
698+
nStakeMinAge = 60;
699+
LogPrintf("AppInit2 : testnet -> nStakeMinAge=%u\n", nStakeMinAge);
700+
}
701+
694702
if (mapArgs.count("-bind") || mapArgs.count("-whitebind")) {
695703
// when specifying an explicit binding address, you want to listen on it
696704
// even when -connect or -proxy is specified

0 commit comments

Comments
 (0)