From 858061fc2bd7c76d6541837a88cbd8aee95d6530 Mon Sep 17 00:00:00 2001 From: Liquid369 Date: Thu, 30 Apr 2026 08:48:36 +0700 Subject: [PATCH 1/7] Create fresh testnet6, clear seeds and new gen block --- src/chainparams.cpp | 34 +++++++++++++++++----------------- src/chainparamsbase.cpp | 2 +- src/chainparamsseeds.h | 17 +---------------- 3 files changed, 19 insertions(+), 34 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 9d7b7fa34da4..00406eb8dc1b 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -193,15 +193,14 @@ static const CCheckpointData data = { }; static MapCheckpoints mapCheckpointsTestnet = { - {0, uint256S("0x001")}, - //{ 201, uint256S("6ae7d52092fd918c8ac8d9b1334400387d3057997e6e927a88e57186dc395231")}, // v5 activation (PoS/Sapling) + {0, uint256S("0x00000431e286f849bbd0b5cce53dd39e6f6e4497f91b078a9e5f6ef418e57912")}, }; static const CCheckpointData dataTestnet = { &mapCheckpointsTestnet, - 1454124731, - 0, - 3000}; + 1777507200, // * UNIX timestamp of testnet6 genesis block (April 30, 2026) + 0, // * total number of transactions between genesis and last checkpoint (fresh start) + 250}; // * estimated number of transactions per day after checkpoint static MapCheckpoints mapCheckpointsRegtest = {{0, uint256S("0x001")}}; static const CCheckpointData dataRegtest = { @@ -372,7 +371,7 @@ class CMainParams : public CChainParams }; /** - * Testnet (v5) + * Testnet (v6) */ class CTestNetParams : public CChainParams { @@ -381,9 +380,10 @@ class CTestNetParams : public CChainParams { strNetworkID = "test"; - genesis = CreateGenesisBlock(1454124731, 2402015, 0x1e0ffff0, 1, 250 * COIN); + // Testnet6 genesis - April 30, 2026. + genesis = CreateGenesisBlock(1777507200, 461120, 0x1e0ffff0, 1, 250 * COIN); consensus.hashGenesisBlock = genesis.GetHash(); - assert(consensus.hashGenesisBlock == uint256S("0x0000041e482b9b9691d98eefb48473405c0b8ec31b76df3797c74a78680ef818")); + assert(consensus.hashGenesisBlock == uint256S("0x00000431e286f849bbd0b5cce53dd39e6f6e4497f91b078a9e5f6ef418e57912")); assert(genesis.hashMerkleRoot == uint256S("0x1b2ef6e2f28be914103a277377ae7729dcd125dfeb8bf97bd5964ba72b6dc39b")); consensus.fPowAllowMinDifficultyBlocks = true; @@ -450,10 +450,10 @@ class CTestNetParams : public CChainParams consensus.vUpgrades[Consensus::UPGRADE_V3_4].nActivationHeight = 201; consensus.vUpgrades[Consensus::UPGRADE_V4_0].nActivationHeight = 201; consensus.vUpgrades[Consensus::UPGRADE_V5_0].nActivationHeight = 201; - consensus.vUpgrades[Consensus::UPGRADE_V5_2].nActivationHeight = 262525; - consensus.vUpgrades[Consensus::UPGRADE_V5_3].nActivationHeight = 332300; - consensus.vUpgrades[Consensus::UPGRADE_V5_5].nActivationHeight = 925056; - consensus.vUpgrades[Consensus::UPGRADE_V5_6].nActivationHeight = 1624280; // Estimate Feb 23 Midnight UTC + consensus.vUpgrades[Consensus::UPGRADE_V5_2].nActivationHeight = 201; + consensus.vUpgrades[Consensus::UPGRADE_V5_3].nActivationHeight = 201; + consensus.vUpgrades[Consensus::UPGRADE_V5_5].nActivationHeight = 201; + consensus.vUpgrades[Consensus::UPGRADE_V5_6].nActivationHeight = 201; consensus.vUpgrades[Consensus::UPGRADE_V6_0].nActivationHeight = Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT; @@ -462,10 +462,10 @@ class CTestNetParams : public CChainParams * The characters are rarely used upper ASCII, not valid as UTF-8, and produce * a large 4-byte int at any alignment. */ - pchMessageStart[0] = 0xf5; - pchMessageStart[1] = 0xe6; - pchMessageStart[2] = 0xd5; - pchMessageStart[3] = 0xca; + pchMessageStart[0] = 0xf6; + pchMessageStart[1] = 0xe7; + pchMessageStart[2] = 0xd6; + pchMessageStart[3] = 0xcb; nDefaultPort = 51474; // nodes with support for servicebits filtering should be at the top @@ -484,7 +484,7 @@ class CTestNetParams : public CChainParams // Testnet pivx BIP44 coin type is '1' (All coin's testnet default) base58Prefixes[EXT_COIN_TYPE] = {0x80, 0x00, 0x00, 0x01}; - vFixedSeeds = std::vector(std::begin(chainparams_seed_test), std::end(chainparams_seed_test)); + vFixedSeeds.clear(); // Testnet6 - no fixed seeds yet fRequireStandard = false; diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index cc1a496a3b20..b2db1660299d 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -38,7 +38,7 @@ std::unique_ptr CreateBaseChainParams(const std::string& chain if (chain == CBaseChainParams::MAIN) return std::make_unique("", 51473); else if (chain == CBaseChainParams::TESTNET) - return std::make_unique("testnet5", 51475); + return std::make_unique("testnet6", 51475); else if (chain == CBaseChainParams::REGTEST) return std::make_unique("regtest", 51477); else diff --git a/src/chainparamsseeds.h b/src/chainparamsseeds.h index 28804bcd03f6..c764b0f4eb4f 100644 --- a/src/chainparamsseeds.h +++ b/src/chainparamsseeds.h @@ -331,22 +331,7 @@ static const uint8_t chainparams_seed_main[] = { 0x04,0x20,0x2d,0x23,0x2c,0xe0,0x43,0xb2,0x64,0x62,0x12,0xaa,0xb4,0x86,0x6e,0x9e,0x40,0x9c,0xe5,0x50,0x5b,0x88,0xf6,0x37,0x75,0x64,0x75,0x0f,0xf2,0x4c,0xeb,0x94,0xb1,0xd2,0xc9,0x10, }; +// Testnet6 - no fixed seeds yet (fresh network) static const uint8_t chainparams_seed_test[] = { - 0x01,0x04,0x2d,0x23,0xfb,0x45,0xc9,0x12, - 0x01,0x04,0x50,0xd0,0xe2,0xa7,0xc9,0x12, - 0x01,0x04,0x8c,0x52,0x26,0x3f,0xc9,0x12, - 0x01,0x04,0xb0,0xdf,0x80,0x83,0xc9,0x12, - 0x01,0x04,0xb9,0x51,0xa6,0x3c,0xc9,0x12, - 0x01,0x04,0xc2,0x87,0x59,0x3f,0xc9,0x12, - 0x04,0x20,0xda,0xdd,0x12,0xcc,0x6e,0x0b,0xb0,0x79,0x11,0x2c,0xfd,0x67,0x6f,0xdf,0xba,0xd0,0xfd,0x60,0x51,0x51,0xb9,0xe1,0xa9,0x90,0xda,0xc3,0x14,0x84,0x0d,0x72,0xb8,0x56,0xc9,0x12, - 0x04,0x20,0xf1,0xaf,0x92,0x10,0x55,0x94,0x9c,0xc8,0x6e,0x2f,0x9b,0xc8,0xbd,0xf8,0xee,0x4d,0xe6,0x4f,0x16,0x85,0x44,0xd8,0x4a,0x17,0x47,0x74,0x8c,0x0a,0xdd,0xb0,0x39,0x44,0xc9,0x12, - 0x04,0x20,0x0d,0x7a,0xcd,0x2c,0x2d,0xeb,0x87,0x28,0x64,0x7d,0xf8,0x63,0xab,0xc3,0x1f,0x20,0x5b,0xa8,0x9b,0x18,0xa0,0x13,0xb3,0xad,0xdf,0x0c,0x85,0x72,0x31,0x07,0x66,0xe0,0xc9,0x12, - 0x04,0x20,0x24,0xfa,0xa6,0x75,0xf1,0xfa,0x73,0x50,0xe1,0x7a,0xf7,0xe1,0x26,0x81,0x62,0x82,0x75,0x80,0x00,0x67,0x76,0xb7,0x28,0x81,0xb4,0x56,0x5a,0x75,0x76,0xcf,0xf4,0x2c,0xc9,0x12, - 0x04,0x20,0x3d,0x42,0x3f,0x28,0x5e,0xc2,0x64,0x6f,0xdb,0xd3,0x1d,0x08,0x6f,0xf8,0x99,0x7c,0x73,0x8f,0xbc,0xc2,0xbd,0x60,0x43,0x6d,0xdd,0x07,0xaa,0xb7,0x3a,0xe2,0xb8,0xd9,0xc9,0x12, - 0x04,0x20,0x63,0xe0,0x30,0x01,0xca,0x4a,0x4d,0x8d,0xb1,0x19,0x9b,0x96,0xed,0x39,0xfb,0xd4,0x81,0x5d,0x22,0x05,0x20,0xc6,0xaf,0x3d,0x87,0xbb,0xd2,0xcd,0xa7,0x7c,0x05,0x10,0xc9,0x12, - 0x04,0x20,0x6f,0xfb,0xf9,0x4d,0xdb,0xb2,0x90,0xef,0x45,0x60,0x36,0x68,0x1d,0xd9,0xc8,0xe2,0x59,0xf9,0x16,0x54,0x61,0x77,0x64,0x02,0x9e,0xf4,0x28,0x20,0xe5,0x4a,0x1f,0x72,0xc9,0x12, - 0x04,0x20,0x97,0x60,0xd9,0x46,0x4c,0x7b,0x7b,0x85,0x8b,0x55,0x84,0xdd,0x53,0x51,0xdb,0x64,0xfe,0x3f,0x69,0x5f,0xbd,0xe7,0xdb,0xc2,0x3f,0x81,0x49,0xd5,0x23,0x90,0x97,0x21,0xc9,0x12, - 0x04,0x20,0xa0,0x57,0x5a,0x42,0xfd,0xad,0x78,0x23,0x67,0x15,0xd1,0x69,0x52,0x24,0xc1,0xdf,0x2b,0x32,0x6a,0xd4,0x64,0xf2,0xbc,0xed,0xf9,0x7f,0x36,0xc6,0x26,0x02,0xe2,0xf4,0xc9,0x12, - 0x04,0x20,0xbf,0x31,0x2d,0xcd,0x4b,0x8e,0x06,0x84,0xef,0xae,0xfb,0x3f,0x7e,0x17,0x41,0x03,0x9c,0xb6,0x12,0xdb,0x87,0x3b,0x1f,0x8e,0xab,0x78,0xd5,0x9a,0x39,0xc6,0x28,0x76,0xc9,0x12, }; #endif // PIVX_CHAINPARAMSSEEDS_H From ef3ff42a54450723bd4c43ad8b6fcfb780f1b6ba Mon Sep 17 00:00:00 2001 From: Liquid369 Date: Thu, 9 Jul 2026 18:45:42 +0700 Subject: [PATCH 2/7] Set testnet v6.0 activation height to block 5000 --- src/chainparams.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 00406eb8dc1b..0c3f0ba44fd3 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -454,8 +454,7 @@ class CTestNetParams : public CChainParams consensus.vUpgrades[Consensus::UPGRADE_V5_3].nActivationHeight = 201; consensus.vUpgrades[Consensus::UPGRADE_V5_5].nActivationHeight = 201; consensus.vUpgrades[Consensus::UPGRADE_V5_6].nActivationHeight = 201; - consensus.vUpgrades[Consensus::UPGRADE_V6_0].nActivationHeight = - Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT; + consensus.vUpgrades[Consensus::UPGRADE_V6_0].nActivationHeight = 5000; /** * The message start string is designed to be unlikely to occur in normal data. From 03fb133c0a10495ad3bbe522881d5464c85af47d Mon Sep 17 00:00:00 2001 From: Liquid369 Date: Sun, 26 Jul 2026 14:05:07 +0700 Subject: [PATCH 3/7] Fix testnet6 genesis nonce and hash Old nonce never met the target for the April 30 timestamp so the genesis assert aborted on startup, remined with the same timestamp. --- src/chainparams.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 0c3f0ba44fd3..af45da4fb2a0 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -193,7 +193,7 @@ static const CCheckpointData data = { }; static MapCheckpoints mapCheckpointsTestnet = { - {0, uint256S("0x00000431e286f849bbd0b5cce53dd39e6f6e4497f91b078a9e5f6ef418e57912")}, + {0, uint256S("0x00000f254358fe046377c224341c794b7faf942a6311a7ece773d3c378239c54")}, }; static const CCheckpointData dataTestnet = { @@ -381,9 +381,9 @@ class CTestNetParams : public CChainParams strNetworkID = "test"; // Testnet6 genesis - April 30, 2026. - genesis = CreateGenesisBlock(1777507200, 461120, 0x1e0ffff0, 1, 250 * COIN); + genesis = CreateGenesisBlock(1777507200, 498658, 0x1e0ffff0, 1, 250 * COIN); consensus.hashGenesisBlock = genesis.GetHash(); - assert(consensus.hashGenesisBlock == uint256S("0x00000431e286f849bbd0b5cce53dd39e6f6e4497f91b078a9e5f6ef418e57912")); + assert(consensus.hashGenesisBlock == uint256S("0x00000f254358fe046377c224341c794b7faf942a6311a7ece773d3c378239c54")); assert(genesis.hashMerkleRoot == uint256S("0x1b2ef6e2f28be914103a277377ae7729dcd125dfeb8bf97bd5964ba72b6dc39b")); consensus.fPowAllowMinDifficultyBlocks = true; From 53a43530349441d9ef43b4b0022d4910870546ea Mon Sep 17 00:00:00 2001 From: Liquid369 Date: Sun, 26 Jul 2026 20:30:36 +0700 Subject: [PATCH 4/7] Rotate testnet6 spork key --- src/chainparams.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index af45da4fb2a0..f13b0e1192bc 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -411,7 +411,7 @@ class CTestNetParams : public CChainParams consensus.nMaxProposalPayments = 20; // spork keys - consensus.strSporkPubKey = "04677c34726c491117265f4b1c83cef085684f36c8df5a97a3a42fc499316d0c4e63959c9eca0dba239d9aaaf72011afffeb3ef9f51b9017811dec686e412eb504"; + consensus.strSporkPubKey = "04b6f3a15c8c465ac1c799e04fe79e351db3c7815aa33d70656f0bc5e3688da22bc13886ead5d2ad2307a93590ee04ad176e95c336ab179a21faf064255d79cb39"; consensus.strSporkPubKeyOld = "04E88BB455E2A04E65FCC41D88CD367E9CCE1F5A409BE94D8C2B4B35D223DED9C8E2F4E061349BA3A38839282508066B6DC4DB72DD432AC4067991E6BF20176127"; consensus.nTime_EnforceNewSporkKey = 1608512400; //!> December 21, 2020 01:00:00 AM GMT consensus.nTime_RejectOldSporkKey = 1614560400; //!> March 1, 2021 01:00:00 AM GMT From e78b78fbfcbc9120a6f0736eaf61449187840124 Mon Sep 17 00:00:00 2001 From: Liquid369 Date: Sun, 26 Jul 2026 20:43:14 +0700 Subject: [PATCH 5/7] Fix dangling reference to mining target in PIVXMiner hashTarget held a reference to a temporary, so the miner ended up comparing the hash against itself and instantly submitting invalid blocks in a loop. Take it by value. --- src/miner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/miner.cpp b/src/miner.cpp index 15761cf8f34f..4ff1bdedf563 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -195,7 +195,7 @@ void BitcoinMiner(CWallet* pwallet, bool fProofOfStake) // Search // int64_t nStart = GetTime(); - arith_uint256& hashTarget = arith_uint256().SetCompact(pblock->nBits); + arith_uint256 hashTarget = arith_uint256().SetCompact(pblock->nBits); while (true) { unsigned int nHashesDone = 0; From 1e4f03464a69586b7b1b24e2afd0b19c45ff01ee Mon Sep 17 00:00:00 2001 From: Liquid369 Date: Mon, 27 Jul 2026 14:12:53 +0700 Subject: [PATCH 6/7] Stage the testnet6 upgrade heights All at 201 meant the chain never crossed an upgrade boundary. Block version is gated per upgrade and the stake modifier changes at POS_V2, so none of it got exercised. Spread from 201 to 700. --- src/chainparams.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index f13b0e1192bc..5c8ac612218c 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -442,18 +442,18 @@ class CTestNetParams : public CChainParams consensus.vUpgrades[Consensus::UPGRADE_TESTDUMMY].nActivationHeight = Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT; consensus.vUpgrades[Consensus::UPGRADE_POS].nActivationHeight = 201; - consensus.vUpgrades[Consensus::UPGRADE_POS_V2].nActivationHeight = 201; - consensus.vUpgrades[Consensus::UPGRADE_ZC].nActivationHeight = 201; - consensus.vUpgrades[Consensus::UPGRADE_ZC_V2].nActivationHeight = 201; - consensus.vUpgrades[Consensus::UPGRADE_BIP65].nActivationHeight = 201; - consensus.vUpgrades[Consensus::UPGRADE_ZC_PUBLIC].nActivationHeight = 201; - consensus.vUpgrades[Consensus::UPGRADE_V3_4].nActivationHeight = 201; - consensus.vUpgrades[Consensus::UPGRADE_V4_0].nActivationHeight = 201; - consensus.vUpgrades[Consensus::UPGRADE_V5_0].nActivationHeight = 201; - consensus.vUpgrades[Consensus::UPGRADE_V5_2].nActivationHeight = 201; - consensus.vUpgrades[Consensus::UPGRADE_V5_3].nActivationHeight = 201; - consensus.vUpgrades[Consensus::UPGRADE_V5_5].nActivationHeight = 201; - consensus.vUpgrades[Consensus::UPGRADE_V5_6].nActivationHeight = 201; + consensus.vUpgrades[Consensus::UPGRADE_POS_V2].nActivationHeight = 225; + consensus.vUpgrades[Consensus::UPGRADE_ZC].nActivationHeight = 250; + consensus.vUpgrades[Consensus::UPGRADE_ZC_V2].nActivationHeight = 275; + consensus.vUpgrades[Consensus::UPGRADE_BIP65].nActivationHeight = 300; + consensus.vUpgrades[Consensus::UPGRADE_ZC_PUBLIC].nActivationHeight = 350; + consensus.vUpgrades[Consensus::UPGRADE_V3_4].nActivationHeight = 400; + consensus.vUpgrades[Consensus::UPGRADE_V4_0].nActivationHeight = 450; + consensus.vUpgrades[Consensus::UPGRADE_V5_0].nActivationHeight = 500; + consensus.vUpgrades[Consensus::UPGRADE_V5_2].nActivationHeight = 550; + consensus.vUpgrades[Consensus::UPGRADE_V5_3].nActivationHeight = 600; + consensus.vUpgrades[Consensus::UPGRADE_V5_5].nActivationHeight = 650; + consensus.vUpgrades[Consensus::UPGRADE_V5_6].nActivationHeight = 700; consensus.vUpgrades[Consensus::UPGRADE_V6_0].nActivationHeight = 5000; /** From ebc64535df0f377296ae783336e49d2f72ef188b Mon Sep 17 00:00:00 2001 From: Liquid369 Date: Mon, 27 Jul 2026 15:11:27 +0700 Subject: [PATCH 7/7] Use a 50 member quorum for testnet chainlocks Testnet was still on LLMQ_400_60, which needs 300 masternodes before a quorum forms. Testnet has nowhere near that so chainlocks could never form at all. LLMQ_50_60 needs 40, which a testnet fleet can actually reach. --- src/chainparams.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 5c8ac612218c..80bf16f74546 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -504,7 +504,7 @@ class CTestNetParams : public CChainParams nLLMQConnectionRetryTimeout = 60; - consensus.llmqTypeChainLocks = Consensus::LLMQ_400_60; + consensus.llmqTypeChainLocks = Consensus::LLMQ_50_60; // Tier two nFulfilledRequestExpireTime = 60 * 60; // fulfilled requests expire in 1 hour