Introduce testnet4 reboot chain alongside legacy testnet3 - #9
Open
qlpqlp wants to merge 6 commits into
Open
Conversation
Remove second occurrences of duplicate #include directives in: - src/test/transaction_tests.cpp: <boost/assign/list_of.hpp> - src/httprpc.cpp: "utilstrencodings.h" - src/qt/rpcconsole.cpp: "bantablemodel.h" and <QThread> A duplicate was also found in src/leveldb/port/port_stdcxx.h, but that file is part of the vendored LevelDB library and is left unchanged. No behavioral change.
Strip trailing spaces and tabs from line endings across src/. The vendored leveldb and secp256k1 subtrees are excluded. No behavioral change.
…cate-includes Remove duplicate #include lines in three source files
…tespace cleanup: remove trailing whitespace across src/
## Summary Adds an opt-in rebooted public test network (`-testnet4`) while keeping legacy testnet3 fully available via `-testnet`. Operators choose which chain to run; both are not active in the same process. Testnet4 is a fresh chain intended to replace testnet3 for new development after legacy testnet3 block-storm / time-warp abuse. It implements strict minimum-difficulty rules adapted from [PR dogecoin#3967](dogecoin#3967) (BIP-94 inspired, Digishield-aware). Mainnet and legacy testnet3 consensus are unchanged. ## Motivation Legacy testnet3 has grown to tens of millions of blocks at abnormally high rates, breaking explorers, indexers, and practical testing. Rather than removing legacy testnet3, this PR adds a parallel reboot chain so existing tooling keeps working while a hardened network can grow from genesis. ## Chain comparison | | Legacy testnet3 | Reboot testnet4 | |---|-----------------|-----------------| | Flag | `-testnet` | `-testnet4` | | Datadir | `testnet3/` | `testnet4/` | | RPC `chain` | `test` | `testnet4` | | P2P magic | `fc c1 b7 dc` | `fd d4 dc e1` | | P2P / RPC ports | 44556 / 44555 | 44556 / 44555 | | Addresses | `n` / `2` | `T` (`0x41` / `0x42`) | | Genesis | `bb0a7826…` | `b9f29a99…` | | Strict min-difficulty | No | Yes (from block 1) | | Block subsidy (h≥1) | Historical schedule | 10,000 DOGE (tail subsidy) | Magic bytes differ so nodes only peer with their selected chain despite sharing port 44556 and the same fixed seed list from `chainparamsseeds.h`. ## Implementation - New `CTestNet4Params` and `-testnet4` chain selection (`CBaseChainParams::TESTNET4`) - Consensus: `fEnforceStrictMinDifficulty` and `fTailSubsidyOnly` (testnet4 only) - `AllowDigishieldMinDifficultyForBlock()`: strict rules when `fEnforceStrictMinDifficulty` is set (no consecutive min-diff blocks, MTP check, 10× spacing threshold) - Qt: testnet4 network styling, payment URI detection for `T` addresses, autostart flags - Docs: `doc/testnet-reboot.md`, updates to `getting-started.md` and `files.md` - Unit tests for strict min-difficulty, testnet4 subsidy, and `T` address prefix ## Breaking changes - **None for legacy testnet3** (`-testnet` behavior preserved) - **None for mainnet** - Testnet4 is additive; users must pass `-testnet4` explicitly to join the new chain ## Test plan - [ ] `dogecoind -testnet` syncs legacy testnet3; `getblockchaininfo` reports `"chain": "test"` - [ ] `dogecoind -testnet4` starts from testnet4 genesis; `getblockchaininfo` reports `"chain": "testnet4"` - [ ] `getnewaddress` on testnet4 returns `T…` addresses; testnet3 still returns `n…` addresses - [ ] `-testnet` and `-testnet4` together are rejected at startup - [ ] Run unit tests: `test_dogecoin`, `pow_tests` (strict min-difficulty cases) - [ ] Two testnet4 nodes peer via `addnode` and advance the chain - [ ] (Optional) DogeGo reboot node peers with Core `-testnet4` on port 44556 ## References - dogecoin#3967 (strict min-difficulty rules) - dogecoin#3971 (testnet block generation speed) - Maintainer note on testnet4 direction (dogecoin#3967)
The testnet4 genesis nonce 166041 produced block hash b9f29a99… (GetHash) but failed Core's scrypt PoW check (GetPoWHash), causing dogecoind -testnet4 to abort at height 0. Remine genesis with nonce 2139303 and hash d5d619f8be025d4700940883c86f271d08cffa8dd1d3d4afa474c9ed9e8b68a0. Update the height-0 checkpoint and docs, and add a unit test that the genesis passes CheckAuxPowProofOfWork. Legacy testnet3 (-testnet) is unchanged. Anyone who started testnet4 with the old genesis must delete testnet4/ and resync.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an opt-in rebooted public test network (
-testnet4) while keeping legacy testnet3 fully available via-testnet. Operators choose which chain to run; both are not active in the same process.Testnet4 is a fresh chain intended to replace testnet3 for new development after legacy testnet3 block-storm / time-warp abuse. It implements strict minimum-difficulty rules adapted from PR #3967 (BIP-94 inspired, Digishield-aware). Mainnet and legacy testnet3 consensus are unchanged.
Motivation
Legacy testnet3 has grown to tens of millions of blocks at abnormally high rates, breaking explorers, indexers, and practical testing. Rather than removing legacy testnet3, this PR adds a parallel reboot chain so existing tooling keeps working while a hardened network can grow from genesis.
Chain comparison
-testnet-testnet4testnet3/testnet4/chaintesttestnet4fc c1 b7 dcfd d4 dc e1bb0a7826…b9f29a99…Magic bytes differ so nodes only peer with their selected chain despite sharing port 44556 and the same fixed seed list from
chainparamsseeds.h.Implementation
CTestNet4Paramsand-testnet4chain selection (CBaseChainParams::TESTNET4)fEnforceStrictMinDifficultyandfTailSubsidyOnly(testnet4 only)AllowDigishieldMinDifficultyForBlock(): strict rules whenfEnforceStrictMinDifficultyis set (no consecutive min-diff blocks, MTP check, 10× spacing threshold)Taddresses, autostart flagsdoc/testnet-reboot.md, updates togetting-started.mdandfiles.mdTaddress prefixBreaking changes
-testnetbehavior preserved)-testnet4explicitly to join the new chainTest plan
dogecoind -testnetsyncs legacy testnet3;getblockchaininforeports"chain": "test"dogecoind -testnet4starts from testnet4 genesis;getblockchaininforeports"chain": "testnet4"getnewaddresson testnet4 returnsT…addresses; testnet3 still returnsn…addresses-testnetand-testnet4together are rejected at startuptest_dogecoin,pow_tests(strict min-difficulty cases)addnodeand advance the chain-testnet4on port 44556References