From ffbaef8388ad651e903187a635061f9069c437da Mon Sep 17 00:00:00 2001 From: Davide Grilli Date: Thu, 30 Oct 2025 23:25:15 +0100 Subject: [PATCH] testnet update: rename testnet3 to testnet Update all references to 'testnet3' to 'testnet' for consistency. This includes: - Changing magic bytes in network messages - Updating directory paths and configuration files - Modifying documentation and test framework references - Adjusting chain parameters and validation logic --- contrib/linearize/example-linearize.cfg | 2 +- doc/files.md | 2 +- doc/release-process.md | 6 +++--- src/chainparams.cpp | 8 ++++---- src/chainparamsbase.cpp | 2 +- src/validation.cpp | 2 +- test/functional/p2p_dos_header_tree.py | 6 +++--- test/functional/test_framework/mininode.py | 2 +- test/functional/test_framework/util.py | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/contrib/linearize/example-linearize.cfg b/contrib/linearize/example-linearize.cfg index fc219e0..1e640d2 100644 --- a/contrib/linearize/example-linearize.cfg +++ b/contrib/linearize/example-linearize.cfg @@ -26,7 +26,7 @@ input=/home/example/.palladium/blocks # testnet #netmagic=0b110907 #genesis=000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943 -#input=/home/example/.palladium/testnet3/blocks +#input=/home/example/.palladium/testnet/blocks # regtest #netmagic=fabfb5da diff --git a/doc/files.md b/doc/files.md index a24eac6..4ff2198 100644 --- a/doc/files.md +++ b/doc/files.md @@ -33,7 +33,7 @@ Windows | `%APPDATA%\Palladium\` [\[1\]](#note1) Chain option | Data directory path --------------------|-------------------- no option (mainnet) | *path_to_datadir*`/` -`-testnet` | *path_to_datadir*`/testnet3/` +`-testnet` | *path_to_datadir*`/testnet/` `-regtest` | *path_to_datadir*`/regtest/` ## Data directory layout diff --git a/doc/release-process.md b/doc/release-process.md index 128d2e5..948180d 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -377,13 +377,13 @@ Both variables are used as a guideline for how much space the user needs on thei Note that all values should be taken from a **fully synced** node and have an overhead of 5-10% added on top of its base value. To calculate `m_assumed_blockchain_size`: -- For `mainnet` -> Take the size of the data directory, excluding `/regtest` and `/testnet3` directories. -- For `testnet` -> Take the size of the `/testnet3` directory. +- For `mainnet` -> Take the size of the data directory, excluding `/regtest` and `/testnet` directories. +- For `testnet` -> Take the size of the `/testnet` directory. To calculate `m_assumed_chain_state_size`: - For `mainnet` -> Take the size of the `/chainstate` directory. -- For `testnet` -> Take the size of the `/testnet3/chainstate` directory. +- For `testnet` -> Take the size of the `/testnet/chainstate` directory. Notes: - When taking the size for `m_assumed_blockchain_size`, there's no need to exclude the `/chainstate` directory since it's a guideline value and an overhead will be added anyway. diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 568cb23..131a355 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -220,10 +220,10 @@ public: - pchMessageStart[0] = 0x0b; - pchMessageStart[1] = 0x11; - pchMessageStart[2] = 0x09; - pchMessageStart[3] = 0x07; + pchMessageStart[0] = 0x0c; + pchMessageStart[1] = 0x12; + pchMessageStart[2] = 0x0a; + pchMessageStart[3] = 0x08; nDefaultPort = 12333; nPruneAfterHeight = 1000; m_assumed_blockchain_size = 1; diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index 7c2f938..6d25728 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 MakeUnique("", 2332); else if (chain == CBaseChainParams::TESTNET) - return MakeUnique("testnet3", 12332); + return MakeUnique("testnet", 12332); else if (chain == CBaseChainParams::REGTEST) return MakeUnique("regtest", 12443); else diff --git a/src/validation.cpp b/src/validation.cpp index 56d296a..0ffb495 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2039,7 +2039,7 @@ bool CChainState::ConnectBlock(const CBlock& block, BlockValidationState& state, // edge case when manipulating the UTXO and it would be simpler not to have // another edge case to deal with. - // testnet3 has no blocks before the BIP34 height with indicated heights + // testnet has no blocks before the BIP34 height with indicated heights // post BIP34 before approximately height 486,000,000 and presumably will // be reset before it reaches block 1,983,702 and starts doing unnecessary // BIP30 checking again. diff --git a/test/functional/p2p_dos_header_tree.py b/test/functional/p2p_dos_header_tree.py index 5c56296..2176391 100644 --- a/test/functional/p2p_dos_header_tree.py +++ b/test/functional/p2p_dos_header_tree.py @@ -20,13 +20,13 @@ import os class RejectLowDifficultyHeadersTest(PalladiumTestFramework): def set_test_params(self): self.setup_clean_chain = True - self.chain = 'testnet3' # Use testnet chain because it has an early checkpoint + self.chain = 'testnet' self.num_nodes = 2 def add_options(self, parser): parser.add_argument( '--datafile', - default='data/blockheader_testnet3.hex', + default='data/blockheader_testnet.hex', help='Test data file (default: %(default)s)', ) @@ -36,7 +36,7 @@ class RejectLowDifficultyHeadersTest(PalladiumTestFramework): with open(self.headers_file_path, encoding='utf-8') as headers_data: h_lines = [l.strip() for l in headers_data.readlines()] - # The headers data is taken from testnet3 for early blocks from genesis until the first checkpoint. There are + # The headers data is taken from testnet for early blocks from genesis until the first checkpoint. There are # two headers with valid POW at height 1 and 2, forking off from genesis. They are indicated by the FORK_PREFIX. FORK_PREFIX = 'fork:' self.headers = [l for l in h_lines if not l.startswith(FORK_PREFIX)] diff --git a/test/functional/test_framework/mininode.py b/test/functional/test_framework/mininode.py index eccfff6..d36d798 100644 --- a/test/functional/test_framework/mininode.py +++ b/test/functional/test_framework/mininode.py @@ -90,7 +90,7 @@ MESSAGEMAP = { MAGIC_BYTES = { "mainnet": b"\xf9\xbe\xb4\xd9", # mainnet - "testnet3": b"\x0b\x11\x09\x07", # testnet3 + "testnet": b"\x0c\x12\x0a\x08", # testnet "regtest": b"\xfa\xbf\xb5\xda", # regtest } diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index c38862d..e32e51f 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -302,7 +302,7 @@ def initialize_datadir(dirname, n, chain): if not os.path.isdir(datadir): os.makedirs(datadir) # Translate chain name to config name - if chain == 'testnet3': + if chain == 'testnet': chain_name_conf_arg = 'testnet' chain_name_conf_section = 'test' else: