Skip to content

Introduce testnet4 reboot chain alongside legacy testnet3 - #9

Open
qlpqlp wants to merge 6 commits into
dogecoinfoundation:masterfrom
qlpqlp:dogecoin-testnet-rebooted
Open

Introduce testnet4 reboot chain alongside legacy testnet3#9
qlpqlp wants to merge 6 commits into
dogecoinfoundation:masterfrom
qlpqlp:dogecoin-testnet-rebooted

Conversation

@qlpqlp

@qlpqlp qlpqlp commented Jul 25, 2026

Copy link
Copy Markdown

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

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
Genesis bb0a7826… b9f29a99…
Strict min-difficulty No Yes (from block 1)

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

pmzajaczkowski and others added 6 commits May 7, 2026 23:31
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants