diff --git a/contrib/completions/bash/bitcoin-cli.bash b/contrib/completions/bash/bitcoin-cli.bash index 3018d076..17b7fd47 100644 --- a/contrib/completions/bash/bitcoin-cli.bash +++ b/contrib/completions/bash/bitcoin-cli.bash @@ -9,7 +9,7 @@ _bitcoin_rpc() { local rpcargs=() for i in ${COMP_LINE}; do case "$i" in - -conf=*|-datadir=*|-regtest|-rpc*|-testnet|-testnet4) + -conf=*|-datadir=*|-regtest|-rpc*|-testnet4) rpcargs=( "${rpcargs[@]}" "$i" ) ;; esac diff --git a/doc/external-signer.md b/doc/external-signer.md index c1b6b20c..e8b2eddb 100644 --- a/doc/external-signer.md +++ b/doc/external-signer.md @@ -100,7 +100,7 @@ A future extension could add an optional return field `reachable`, in case ` --fingerprint= (--testnet) signtransaction +$ --fingerprint= (--testnet4) signtransaction base64_encode_signed_psbt ``` @@ -110,21 +110,21 @@ The `psbt` SHOULD include bip32 derivations. The command SHOULD fail if none of The command SHOULD fail if the user cancels. -The command MAY complain if `--testnet` is set, but any of the BIP32 derivation paths contain a coin type other than `1h` (and vice versa). +The command MAY complain if `--testnet4` is set, but any of the BIP32 derivation paths contain a coin type other than `1h` (and vice versa). ### `getdescriptors` (optional) Usage: ``` -$ --fingerprint= (--testnet) getdescriptors +$ --fingerprint= (--testnet4) getdescriptors ``` Returns descriptors supported by the device. Example: ``` -$ --fingerprint=00000000 --testnet getdescriptors +$ --fingerprint=00000000 --testnet4 getdescriptors { "receive": [ "pkh([00000000/44h/0h/0h]xpub6C.../0/*)#fn95jwmg", @@ -143,13 +143,13 @@ $ --fingerprint=00000000 --testnet getdescriptors Usage: ``` - --fingerprint= (--testnet) displayaddress --desc descriptor + --fingerprint= (--testnet4) displayaddress --desc descriptor ``` Example, display the first native SegWit receive address on Testnet: ``` - --fingerprint=00000000 --testnet displayaddress --desc "wpkh([00000000/84h/1h/0h]tpubDDUZ..../0/0)" + --fingerprint=00000000 --testnet4 displayaddress --desc "wpkh([00000000/84h/1h/0h]tpubDDUZ..../0/0)" ``` The command MUST be able to figure out the address type from the descriptor. @@ -161,7 +161,7 @@ If contains a master key fingerprint, the command MUST fail if it d If contains an xpub, the command MUST fail if it does not match the xpub known by the device. -The command MAY complain if `--testnet` is set, but the BIP32 coin type is not `1h` (and vice versa). +The command MAY complain if `--testnet4` is set, but the BIP32 coin type is not `1h` (and vice versa). ## How Bitcoin Core uses the Signer API diff --git a/doc/release-notes/release-notes-0.3.14.md b/doc/release-notes/release-notes-0.3.14.md index e73052ed..e6fcd66a 100644 --- a/doc/release-notes/release-notes-0.3.14.md +++ b/doc/release-notes/release-notes-0.3.14.md @@ -4,7 +4,7 @@ http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.3.14/ Changes: * Key pool feature for safer wallet backup Gavin Andresen: -* TEST network mode with switch -testnet +* TEST network mode with switch -testnet4 * Option to use SSL for JSON-RPC connections on unix/osx * validateaddress RPC command eurekafag: diff --git a/doc/release-notes/release-notes-0.7.1.md b/doc/release-notes/release-notes-0.7.1.md index 22e910c0..4f1fd5c2 100644 --- a/doc/release-notes/release-notes-0.7.1.md +++ b/doc/release-notes/release-notes-0.7.1.md @@ -77,7 +77,7 @@ Bug fixes * Clicking on a bitcoin: URI on Windows should now launch Bitcoin-Qt properly. -* When running -testnet, use RPC port 18332 by default. +* When running -testnet4, use RPC port 18332 by default. * Better detection and handling of corrupt wallet.dat and blkindex.dat files. Previous versions would crash with a DB_RUNRECOVERY exception, this diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 14a0cb24..77974fe9 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -75,7 +75,6 @@ static void SetupCliArgs(ArgsManager& argsman) SetupHelpOptions(argsman); const auto defaultBaseParams = CreateBaseChainParams(ChainType::MAIN); - const auto testnetBaseParams = CreateBaseChainParams(ChainType::TESTNET); const auto testnet4BaseParams = CreateBaseChainParams(ChainType::TESTNET4); const auto signetBaseParams = CreateBaseChainParams(ChainType::SIGNET); const auto regtestBaseParams = CreateBaseChainParams(ChainType::REGTEST); @@ -100,7 +99,7 @@ static void SetupCliArgs(ArgsManager& argsman) argsman.AddArg("-rpcconnect=", strprintf("Send commands to node running on (default: %s)", DEFAULT_RPCCONNECT), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-rpccookiefile=", "Location of the auth cookie. Relative paths will be prefixed by a net-specific datadir location. (default: data dir)", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-rpcpassword=", "Password for JSON-RPC connections", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); - argsman.AddArg("-rpcport=", strprintf("Connect to JSON-RPC on (default: %u, testnet: %u, testnet4: %u, signet: %u, regtest: %u)", defaultBaseParams->RPCPort(), testnetBaseParams->RPCPort(), testnet4BaseParams->RPCPort(), signetBaseParams->RPCPort(), regtestBaseParams->RPCPort()), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::OPTIONS); + argsman.AddArg("-rpcport=", strprintf("Connect to JSON-RPC on (default: %u, testnet4: %u, signet: %u, regtest: %u)", defaultBaseParams->RPCPort(), testnet4BaseParams->RPCPort(), signetBaseParams->RPCPort(), regtestBaseParams->RPCPort()), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::OPTIONS); argsman.AddArg("-rpcuser=", "Username for JSON-RPC connections", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-rpcwait", "Wait for RPC server to start", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-rpcwaittimeout=", strprintf("Timeout in seconds to wait for the RPC server to start, or 0 for no timeout. (default: %d)", DEFAULT_WAIT_CLIENT_TIMEOUT), ArgsManager::ALLOW_ANY | ArgsManager::DISALLOW_NEGATION, OptionsCategory::OPTIONS); @@ -429,8 +428,6 @@ class NetinfoRequestHandler : public BaseRequestHandler switch (gArgs.GetChainType()) { case ChainType::TESTNET4: return " testnet4"; - case ChainType::TESTNET: - return " testnet"; case ChainType::SIGNET: return " signet"; case ChainType::REGTEST: diff --git a/src/chainparams.cpp b/src/chainparams.cpp index eb915b0b..be598894 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -119,8 +119,6 @@ std::unique_ptr CreateChainParams(const ArgsManager& args, c switch (chain) { case ChainType::MAIN: return CChainParams::Main(); - case ChainType::TESTNET: - return CChainParams::TestNet(); case ChainType::TESTNET4: return CChainParams::TestNet4(); case ChainType::SIGNET: { diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index d816d1af..ebd436be 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -17,7 +17,6 @@ void SetupChainParamsBaseOptions(ArgsManager& argsman) argsman.AddArg("-regtest", "Enter regression test mode, which uses a special chain in which blocks can be solved instantly. " "This is intended for regression testing tools and app development. Equivalent to -chain=regtest.", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS); argsman.AddArg("-testactivationheight=name@height.", "Set the activation height of 'name' (segwit, bip34, dersig, cltv, csv). (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); - argsman.AddArg("-testnet", "Use the testnet3 chain. Equivalent to -chain=test. Support for testnet3 is deprecated and will be removed in an upcoming release. Consider moving to testnet4 now by using -testnet4.", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS); argsman.AddArg("-testnet4", "Use the testnet4 chain. Equivalent to -chain=testnet4.", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS); argsman.AddArg("-vbparams=deployment:start:end[:min_activation_height]", "Use given start/end times and min_activation_height for specified version bits deployment (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS); argsman.AddArg("-signet", "Use the signet chain. Equivalent to -chain=signet. Note that the network is defined by the -signetchallenge parameter", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS); @@ -42,8 +41,6 @@ std::unique_ptr CreateBaseChainParams(const ChainType chain) switch (chain) { case ChainType::MAIN: return std::make_unique("", 8332); - case ChainType::TESTNET: - return std::make_unique("testnet3", 18332); case ChainType::TESTNET4: return std::make_unique("testnet4", 48332); case ChainType::SIGNET: diff --git a/src/common/args.cpp b/src/common/args.cpp index d3e7558c..c756d0b9 100644 --- a/src/common/args.cpp +++ b/src/common/args.cpp @@ -159,7 +159,6 @@ std::list ArgsManager::GetUnrecognizedSections() const static const std::set available_sections{ ChainTypeToString(ChainType::REGTEST), ChainTypeToString(ChainType::SIGNET), - ChainTypeToString(ChainType::TESTNET), ChainTypeToString(ChainType::TESTNET4), ChainTypeToString(ChainType::MAIN), }; @@ -799,12 +798,11 @@ std::variant ArgsManager::GetChainArg() const const bool fRegTest = get_net("-regtest"); const bool fSigNet = get_net("-signet"); - const bool fTestNet = get_net("-testnet"); const bool fTestNet4 = get_net("-testnet4"); const auto chain_arg = GetArg("-chain"); - if ((int)chain_arg.has_value() + (int)fRegTest + (int)fSigNet + (int)fTestNet + (int)fTestNet4 > 1) { - throw std::runtime_error("Invalid combination of -regtest, -signet, -testnet, -testnet4 and -chain. Can use at most one."); + if ((int)chain_arg.has_value() + (int)fRegTest + (int)fSigNet + (int)fTestNet4 > 1) { + throw std::runtime_error("Invalid combination of -regtest, -signet, -testnet4 and -chain. Can use at most one."); } if (chain_arg) { if (auto parsed = ChainTypeFromString(*chain_arg)) return *parsed; @@ -813,7 +811,6 @@ std::variant ArgsManager::GetChainArg() const } if (fRegTest) return ChainType::REGTEST; if (fSigNet) return ChainType::SIGNET; - if (fTestNet) return ChainType::TESTNET; if (fTestNet4) return ChainType::TESTNET4; return ChainType::MAIN; } diff --git a/src/common/args.h b/src/common/args.h index a2ce53ad..5a2f3660 100644 --- a/src/common/args.h +++ b/src/common/args.h @@ -432,7 +432,7 @@ class ArgsManager fs::path GetDataDir(bool net_specific) const; /** - * Return -regtest/-signet/-testnet/-testnet4/-chain= setting as a ChainType enum if a + * Return -regtest/-signet/-testnet4/-chain= setting as a ChainType enum if a * recognized chain type was set, or as a string if an unrecognized chain * name was set. Raise an exception if an invalid combination of flags was * provided. diff --git a/src/init.cpp b/src/init.cpp index 3103ab1b..9f1f41eb 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -451,12 +451,10 @@ void SetupServerArgs(ArgsManager& argsman, bool can_listen_ipc) init::AddLoggingArgs(argsman); const auto defaultBaseParams = CreateBaseChainParams(ChainType::MAIN); - const auto testnetBaseParams = CreateBaseChainParams(ChainType::TESTNET); const auto testnet4BaseParams = CreateBaseChainParams(ChainType::TESTNET4); const auto signetBaseParams = CreateBaseChainParams(ChainType::SIGNET); const auto regtestBaseParams = CreateBaseChainParams(ChainType::REGTEST); const auto defaultChainParams = CreateChainParams(argsman, ChainType::MAIN); - const auto testnetChainParams = CreateChainParams(argsman, ChainType::TESTNET); const auto testnet4ChainParams = CreateChainParams(argsman, ChainType::TESTNET4); const auto signetChainParams = CreateChainParams(argsman, ChainType::SIGNET); const auto regtestChainParams = CreateChainParams(argsman, ChainType::REGTEST); @@ -471,7 +469,7 @@ void SetupServerArgs(ArgsManager& argsman, bool can_listen_ipc) #if HAVE_SYSTEM argsman.AddArg("-alertnotify=", "Execute command when an alert is raised (%s in cmd is replaced by message)", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); #endif - argsman.AddArg("-assumevalid=", strprintf("If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet3: %s, testnet4: %s, signet: %s)", defaultChainParams->GetConsensus().defaultAssumeValid.GetHex(), testnetChainParams->GetConsensus().defaultAssumeValid.GetHex(), testnet4ChainParams->GetConsensus().defaultAssumeValid.GetHex(), signetChainParams->GetConsensus().defaultAssumeValid.GetHex()), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); + argsman.AddArg("-assumevalid=", strprintf("If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet4: %s, signet: %s)", defaultChainParams->GetConsensus().defaultAssumeValid.GetHex(), testnet4ChainParams->GetConsensus().defaultAssumeValid.GetHex(), signetChainParams->GetConsensus().defaultAssumeValid.GetHex()), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-blocksdir=", "Specify directory to hold blocks subdirectory for *.dat files (default: )", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-blocksxor", strprintf("Whether an XOR-key applies to blocksdir *.dat files. " @@ -498,7 +496,7 @@ void SetupServerArgs(ArgsManager& argsman, bool can_listen_ipc) // TODO: remove in v31.0 argsman.AddArg("-maxorphantx=", strprintf("(Removed option, see release notes)"), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-mempoolexpiry=", strprintf("Do not keep transactions in the mempool longer than hours (default: %u)", DEFAULT_MEMPOOL_EXPIRY_HOURS), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); - argsman.AddArg("-minimumchainwork=", strprintf("Minimum work assumed to exist on a valid chain in hex (default: %s, testnet3: %s, testnet4: %s, signet: %s)", defaultChainParams->GetConsensus().nMinimumChainWork.GetHex(), testnetChainParams->GetConsensus().nMinimumChainWork.GetHex(), testnet4ChainParams->GetConsensus().nMinimumChainWork.GetHex(), signetChainParams->GetConsensus().nMinimumChainWork.GetHex()), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::OPTIONS); + argsman.AddArg("-minimumchainwork=", strprintf("Minimum work assumed to exist on a valid chain in hex (default: %s, testnet4: %s, signet: %s)", defaultChainParams->GetConsensus().nMinimumChainWork.GetHex(), testnet4ChainParams->GetConsensus().nMinimumChainWork.GetHex(), signetChainParams->GetConsensus().nMinimumChainWork.GetHex()), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::OPTIONS); argsman.AddArg("-par=", strprintf("Set the number of script verification threads (0 = auto, up to %d, <0 = leave that many cores free, default: %d)", MAX_SCRIPTCHECK_THREADS, DEFAULT_SCRIPTCHECK_THREADS), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-persistmempool", strprintf("Whether to save the mempool on shutdown and load on restart (default: %u)", DEFAULT_PERSIST_MEMPOOL), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); @@ -527,7 +525,7 @@ void SetupServerArgs(ArgsManager& argsman, bool can_listen_ipc) argsman.AddArg("-addnode=", strprintf("Add a node to connect to and attempt to keep the connection open (see the addnode RPC help for more info). This option can be specified multiple times to add multiple nodes; connections are limited to %u at a time and are counted separately from the -maxconnections limit.", MAX_ADDNODE_CONNECTIONS), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::CONNECTION); argsman.AddArg("-asmap=", strprintf("Specify asn mapping used for bucketing of the peers (default: %s). Relative paths will be prefixed by the net-specific datadir location.", DEFAULT_ASMAP_FILENAME), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); argsman.AddArg("-bantime=", strprintf("Default duration (in seconds) of manually configured bans (default: %u)", DEFAULT_MISBEHAVING_BANTIME), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); - argsman.AddArg("-bind=[:][=onion]", strprintf("Bind to given address and always listen on it (default: 0.0.0.0). Use [host]:port notation for IPv6. Append =onion to tag any incoming connections to that address and port as incoming Tor connections (default: 127.0.0.1:%u=onion, testnet3: 127.0.0.1:%u=onion, testnet4: 127.0.0.1:%u=onion, signet: 127.0.0.1:%u=onion, regtest: 127.0.0.1:%u=onion)", defaultChainParams->GetDefaultPort() + 1, testnetChainParams->GetDefaultPort() + 1, testnet4ChainParams->GetDefaultPort() + 1, signetChainParams->GetDefaultPort() + 1, regtestChainParams->GetDefaultPort() + 1), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::CONNECTION); + argsman.AddArg("-bind=[:][=onion]", strprintf("Bind to given address and always listen on it (default: 0.0.0.0). Use [host]:port notation for IPv6. Append =onion to tag any incoming connections to that address and port as incoming Tor connections (default: 127.0.0.1:%u=onion, testnet4: 127.0.0.1:%u=onion, signet: 127.0.0.1:%u=onion, regtest: 127.0.0.1:%u=onion)", defaultChainParams->GetDefaultPort() + 1 + 1, testnet4ChainParams->GetDefaultPort() + 1, signetChainParams->GetDefaultPort() + 1, regtestChainParams->GetDefaultPort() + 1), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::CONNECTION); argsman.AddArg("-cjdnsreachable", "If set, then this host is configured for CJDNS (connecting to fc00::/8 addresses would lead us to the CJDNS network, see doc/cjdns.md) (default: 0)", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); argsman.AddArg("-connect=", "Connect only to the specified node; -noconnect disables automatic connections (the rules for this peer are the same as for -addnode). This option can be specified multiple times to connect to multiple nodes.", ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::CONNECTION); argsman.AddArg("-discover", "Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); @@ -554,7 +552,7 @@ void SetupServerArgs(ArgsManager& argsman, bool can_listen_ipc) argsman.AddArg("-peerbloomfilters", strprintf("Support filtering of blocks and transaction with bloom filters (default: %u)", DEFAULT_PEERBLOOMFILTERS), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); argsman.AddArg("-peerblockfilters", strprintf("Serve compact block filters to peers per BIP 157 (default: %u)", DEFAULT_PEERBLOCKFILTERS), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); argsman.AddArg("-txreconciliation", strprintf("Enable transaction reconciliations per BIP 330 (default: %d)", DEFAULT_TXRECONCILIATION_ENABLE), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CONNECTION); - argsman.AddArg("-port=", strprintf("Listen for connections on (default: %u, testnet3: %u, testnet4: %u, signet: %u, regtest: %u). Not relevant for I2P (see doc/i2p.md). If set to a value x, the default onion listening port will be set to x+1.", defaultChainParams->GetDefaultPort(), testnetChainParams->GetDefaultPort(), testnet4ChainParams->GetDefaultPort(), signetChainParams->GetDefaultPort(), regtestChainParams->GetDefaultPort()), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::CONNECTION); + argsman.AddArg("-port=", strprintf("Listen for connections on (default: %u, testnet4: %u, signet: %u, regtest: %u). Not relevant for I2P (see doc/i2p.md). If set to a value x, the default onion listening port will be set to x+1.", defaultChainParams->GetDefaultPort(), testnet4ChainParams->GetDefaultPort(), signetChainParams->GetDefaultPort(), regtestChainParams->GetDefaultPort()), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::CONNECTION); const std::string proxy_doc_for_value = #ifdef HAVE_SOCKADDR_UN "[:]|unix:"; @@ -678,7 +676,7 @@ void SetupServerArgs(ArgsManager& argsman, bool can_listen_ipc) argsman.AddArg("-rpccookiefile=", "Location of the auth cookie. Relative paths will be prefixed by a net-specific datadir location. (default: data dir)", ArgsManager::ALLOW_ANY, OptionsCategory::RPC); argsman.AddArg("-rpccookieperms=", strprintf("Set permissions on the RPC auth cookie file so that it is readable by [owner|group|all] (default: owner [via umask 0077])"), ArgsManager::ALLOW_ANY, OptionsCategory::RPC); argsman.AddArg("-rpcpassword=", "Password for JSON-RPC connections", ArgsManager::ALLOW_ANY | ArgsManager::SENSITIVE, OptionsCategory::RPC); - argsman.AddArg("-rpcport=", strprintf("Listen for JSON-RPC connections on (default: %u, testnet3: %u, testnet4: %u, signet: %u, regtest: %u)", defaultBaseParams->RPCPort(), testnetBaseParams->RPCPort(), testnet4BaseParams->RPCPort(), signetBaseParams->RPCPort(), regtestBaseParams->RPCPort()), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::RPC); + argsman.AddArg("-rpcport=", strprintf("Listen for JSON-RPC connections on (default: %u, testnet4: %u, signet: %u, regtest: %u)", defaultBaseParams->RPCPort(), testnet4BaseParams->RPCPort(), signetBaseParams->RPCPort(), regtestBaseParams->RPCPort()), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::RPC); argsman.AddArg("-rpcservertimeout=", strprintf("Timeout during HTTP requests (default: %d)", DEFAULT_HTTP_SERVER_TIMEOUT), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::RPC); argsman.AddArg("-rpcthreads=", strprintf("Set the number of threads to service RPC calls (default: %d)", DEFAULT_HTTP_THREADS), ArgsManager::ALLOW_ANY, OptionsCategory::RPC); argsman.AddArg("-rpcuser=", "Username for JSON-RPC connections", ArgsManager::ALLOW_ANY | ArgsManager::SENSITIVE, OptionsCategory::RPC); @@ -930,11 +928,6 @@ bool AppInitParameterInteraction(const ArgsManager& args) return InitError(errors); } - // Testnet3 deprecation warning - if (chain == ChainType::TESTNET) { - LogInfo("Warning: Support for testnet3 is deprecated and will be removed in an upcoming release. Consider switching to testnet4.\n"); - } - // Warn if unrecognized section name are present in the config file. bilingual_str warnings; for (const auto& section : args.GetUnrecognizedSections()) { diff --git a/src/kernel/chainparams.cpp b/src/kernel/chainparams.cpp index 4e7c79f8..fe798e36 100644 --- a/src/kernel/chainparams.cpp +++ b/src/kernel/chainparams.cpp @@ -119,7 +119,7 @@ class CMainParams : public CChainParams { consensus.nMinimumChainWork = uint256{}; consensus.defaultAssumeValid = uint256{}; - consensus.nAuxpowChainId = 0x2222; + consensus.nAuxpowChainId = 0x2121; consensus.nAuxpowStartHeight = 0; consensus.fStrictChainId = true; consensus.nLegacyBlocksBefore = 0; @@ -149,9 +149,9 @@ class CMainParams : public CChainParams { // This is fine at runtime as we'll fall back to using them as an addrfetch if they don't support the // service bits we want, but we should get them updated to support all service bits wanted by any // release ASAP to avoid it where possible. - vSeeds.emplace_back("seed1.coordinate.mara.technology."); // Coordinate - vSeeds.emplace_back("seed2.coordinate.mara.technology."); // Coordinate - vSeeds.emplace_back("seed3.coordinate.mara.technology."); // Coordinate + vSeeds.emplace_back("seed1.mara.technology."); // Coordinate + vSeeds.emplace_back("seed2.mara.technology."); // Coordinate + vSeeds.emplace_back("seed3.mara.technology."); // Coordinate base58Prefixes[PUBKEY_ADDRESS] = std::vector(1,0); base58Prefixes[SCRIPT_ADDRESS] = std::vector(1,5); @@ -179,99 +179,6 @@ class CMainParams : public CChainParams { } }; -/** - * Testnet (v3): public test network which is reset from time to time. - */ -class CTestNetParams : public CChainParams { -public: - CTestNetParams() { - m_chain_type = ChainType::TESTNET; - consensus.signet_blocks = false; - consensus.signet_challenge.clear(); - consensus.nSubsidyHalvingInterval = 210000; - consensus.BIP34Height = 21111; - consensus.BIP34Hash = uint256{}; - consensus.BIP65Height = 1; - consensus.BIP66Height = 1; - consensus.CSVHeight = 1; - consensus.SegwitHeight = 0; - consensus.MinBIP9WarningHeight = 0; // segwit activation height + miner confirmation window - consensus.powLimit = uint256{"00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff"}; - consensus.nPowTargetTimespan = 1 * 1 * 60 * 60; // 1 hour - consensus.nPowTargetSpacing = 2 * 60; - consensus.fPowAllowMinDifficultyBlocks = true; - consensus.enforce_BIP94 = false; - consensus.fPowNoRetargeting = false; - consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28; - consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = Consensus::BIP9Deployment::NEVER_ACTIVE; - consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT; - consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].min_activation_height = 0; // No activation delay - consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].threshold = 27; // 75% - consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].period = 30; - - // Deployment of Taproot (BIPs 340-342) - consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].bit = 2; - consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nStartTime = 1619222400; // April 24th, 2021 - consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = 1628640000; // August 11th, 2021 - consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].min_activation_height = 0; // No activation delay - consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].threshold = 27; // 75% - consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].period = 30; - - consensus.nMinimumChainWork = uint256{}; - consensus.defaultAssumeValid = uint256{}; - - consensus.nAuxpowChainId = 0x2222; - consensus.nAuxpowStartHeight = 0; - consensus.fStrictChainId = true; - consensus.nLegacyBlocksBefore = 0; - - consensus.currentKeys = "7b2263757272656e745f61646472657373223a22746331713833756666786e707778713678366364777a7136346568383366653439703270657867656c3434796a716d6366617a773863677176333468616a222c22616c6c5f6b657973223a5b22303233383330313566643462356636383237306563363537343565326138303631386361303439333765643733393037633462613563326236356339366234373966222c22303331633633313236313831656236343065343263346264333132313831636632383366306561373639383936396538303434376136353137623264353961313931222c22303235333836393635633963323231313966616466373536333931396163626561653362366364656639353539356430366664663332353961613834303832366539225d7d"; - - pchMessageStart[0] = 0xb9; - pchMessageStart[1] = 0xbe; - pchMessageStart[2] = 0xb9; - pchMessageStart[3] = 0xd8; - nDefaultPort = 18333; - nPruneAfterHeight = 1000; - nAssetPruneAfterHeight = 3000; - m_assumed_blockchain_size = 200; - m_assumed_chain_state_size = 19; - - genesis = CreateGenesisBlock(1296688602, 414098458, 0x1d00ffff, 1, 0 * COIN, consensus.currentKeys); - consensus.hashGenesisBlock = genesis.GetHash(); - - vFixedSeeds.clear(); - vSeeds.clear(); - // nodes with support for servicebits filtering should be at the top - vSeeds.emplace_back("seed4.mara.technology."); // Coordinate - vSeeds.emplace_back("seed5.mara.technology."); // Coordinate - vSeeds.emplace_back("seed6.mara.technology."); // Coordinatenet.achownodes.xyz."); // Ava Chow, only supports x1, x5, x9, x49, x809, x849, xd, x400, x404, x408, x448, xc08, xc48, x40c - - base58Prefixes[PUBKEY_ADDRESS] = std::vector(1,111); - base58Prefixes[SCRIPT_ADDRESS] = std::vector(1,196); - base58Prefixes[SECRET_KEY] = std::vector(1,239); - base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF}; - base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94}; - - bech32_hrp = "tc"; - parent_bech32_hrp = "tb"; - - fDefaultConsistencyChecks = false; - m_is_mockable_chain = false; - - m_assumeutxo_data = { - {} - }; - - chainTxData = ChainTxData{ - 0, - 0, - 0, - }; - parentGenesisBlockHash = uint256{"00000000da84f2bafbbc53dee25a72ae507ff4914b867c565be350b0da8bf043"}; - parentPowLimit = uint256{"00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff"}; - } -}; /** * Testnet (v4): public test network which is reset from time to time. @@ -315,7 +222,7 @@ class CTestNet4Params : public CChainParams { consensus.nMinimumChainWork = uint256{}; consensus.defaultAssumeValid = uint256{}; - consensus.nAuxpowChainId = 0x2222; + consensus.nAuxpowChainId = 0x2121; consensus.nAuxpowStartHeight = 0; consensus.fStrictChainId = true; consensus.nLegacyBlocksBefore = 0; @@ -347,9 +254,9 @@ class CTestNet4Params : public CChainParams { vSeeds.clear(); // nodes with support for servicebits filtering should be at the top - vSeeds.emplace_back("seed7.mara.technology."); // Coordinate - vSeeds.emplace_back("seed8.mara.technology."); // Coordinate - vSeeds.emplace_back("seed9.mara.technology."); // Coordinatenet.achownodes. + vSeeds.emplace_back("seed4.mara.technology."); // Coordinate + vSeeds.emplace_back("seed5.mara.technology."); // Coordinate + vSeeds.emplace_back("seed6.mara.technology."); // Coordinatenet.achownodes. base58Prefixes[PUBKEY_ADDRESS] = std::vector(1,111); base58Prefixes[SCRIPT_ADDRESS] = std::vector(1,196); @@ -453,7 +360,7 @@ class SigNetParams : public CChainParams { consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].threshold = 1815; // 90% consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].period = 2016; - consensus.nAuxpowChainId = 0x2222; + consensus.nAuxpowChainId = 0x2121; consensus.nAuxpowStartHeight = 0; consensus.fStrictChainId = true; consensus.nLegacyBlocksBefore = 0; @@ -542,7 +449,7 @@ class CRegTestParams : public CChainParams consensus.nMinimumChainWork = uint256{}; consensus.defaultAssumeValid = uint256{}; - consensus.nAuxpowChainId = 0x2222; + consensus.nAuxpowChainId = 0x2121; consensus.nAuxpowStartHeight = 0; consensus.fStrictChainId = true; consensus.nLegacyBlocksBefore = 0; @@ -635,10 +542,6 @@ std::unique_ptr CChainParams::Main() return std::make_unique(); } -std::unique_ptr CChainParams::TestNet() -{ - return std::make_unique(); -} std::unique_ptr CChainParams::TestNet4() { @@ -659,15 +562,12 @@ std::vector CChainParams::GetAvailableSnapshotHeights() const std::optional GetNetworkForMagic(const MessageStartChars& message) { const auto mainnet_msg = CChainParams::Main()->MessageStart(); - const auto testnet_msg = CChainParams::TestNet()->MessageStart(); const auto testnet4_msg = CChainParams::TestNet4()->MessageStart(); const auto regtest_msg = CChainParams::RegTest({})->MessageStart(); const auto signet_msg = CChainParams::SigNet({})->MessageStart(); if (std::ranges::equal(message, mainnet_msg)) { return ChainType::MAIN; - } else if (std::ranges::equal(message, testnet_msg)) { - return ChainType::TESTNET; } else if (std::ranges::equal(message, testnet4_msg)) { return ChainType::TESTNET4; } else if (std::ranges::equal(message, regtest_msg)) { diff --git a/src/kernel/chainparams.h b/src/kernel/chainparams.h index 53997c8a..11fbe8c3 100644 --- a/src/kernel/chainparams.h +++ b/src/kernel/chainparams.h @@ -153,7 +153,6 @@ class CChainParams static std::unique_ptr RegTest(const RegTestOptions& options); static std::unique_ptr SigNet(const SigNetOptions& options); static std::unique_ptr Main(); - static std::unique_ptr TestNet(); static std::unique_ptr TestNet4(); protected: diff --git a/src/qt/guiconstants.h b/src/qt/guiconstants.h index 30ffa302..a92ce18b 100644 --- a/src/qt/guiconstants.h +++ b/src/qt/guiconstants.h @@ -49,7 +49,6 @@ static const int TOOLTIP_WRAP_THRESHOLD = 80; #define QAPP_ORG_NAME "Bitcoin" #define QAPP_ORG_DOMAIN "bitcoin.org" #define QAPP_APP_NAME_DEFAULT "Bitcoin-Qt" -#define QAPP_APP_NAME_TESTNET "Bitcoin-Qt-testnet" #define QAPP_APP_NAME_TESTNET4 "Bitcoin-Qt-testnet4" #define QAPP_APP_NAME_SIGNET "Bitcoin-Qt-signet" #define QAPP_APP_NAME_REGTEST "Bitcoin-Qt-regtest" diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index adf54953..357eb164 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -114,7 +114,6 @@ static std::string DummyAddress(const CChainParams ¶ms) addr = "bc1p35yvjel7srp783ztf8v6jdra7dhfzk5jaun8xz2qp6ws7z80n4tq2jku9f"; break; case ChainType::SIGNET: - case ChainType::TESTNET: case ChainType::TESTNET4: addr = "tb1p35yvjel7srp783ztf8v6jdra7dhfzk5jaun8xz2qp6ws7z80n4tqa6qnlg"; break; @@ -519,7 +518,7 @@ fs::path static StartupShortcutPath() ChainType chain = gArgs.GetChainType(); if (chain == ChainType::MAIN) return GetSpecialFolderPath(CSIDL_STARTUP) / "Bitcoin.lnk"; - if (chain == ChainType::TESTNET) // Remove this special case when testnet CBaseChainParams::DataDir() is incremented to "testnet4" + if (chain == ChainType::TESTNET4) // Remove this special case when testnet CBaseChainParams::DataDir() is incremented to "testnet4" return GetSpecialFolderPath(CSIDL_STARTUP) / "Bitcoin (testnet).lnk"; return GetSpecialFolderPath(CSIDL_STARTUP) / fs::u8path(strprintf("Bitcoin (%s).lnk", ChainTypeToString(chain))); } diff --git a/src/qt/networkstyle.cpp b/src/qt/networkstyle.cpp index d3f7c02d..63bd88fd 100644 --- a/src/qt/networkstyle.cpp +++ b/src/qt/networkstyle.cpp @@ -18,7 +18,6 @@ static const struct { const int iconColorSaturationReduction; } network_styles[] = { {ChainType::MAIN, QAPP_APP_NAME_DEFAULT, 0, 0}, - {ChainType::TESTNET, QAPP_APP_NAME_TESTNET, 70, 30}, {ChainType::TESTNET4, QAPP_APP_NAME_TESTNET4, 70, 30}, {ChainType::SIGNET, QAPP_APP_NAME_SIGNET, 35, 15}, {ChainType::REGTEST, QAPP_APP_NAME_REGTEST, 160, 30}, diff --git a/src/test/argsman_tests.cpp b/src/test/argsman_tests.cpp index e5953cd5..a4807ea3 100644 --- a/src/test/argsman_tests.cpp +++ b/src/test/argsman_tests.cpp @@ -643,10 +643,9 @@ BOOST_AUTO_TEST_CASE(util_GetArg) BOOST_AUTO_TEST_CASE(util_GetChainTypeString) { TestArgsManager test_args; - const auto testnet = std::make_pair("-testnet", ArgsManager::ALLOW_ANY); const auto testnet4 = std::make_pair("-testnet4", ArgsManager::ALLOW_ANY); const auto regtest = std::make_pair("-regtest", ArgsManager::ALLOW_ANY); - test_args.SetupArgs({testnet, testnet4, regtest}); + test_args.SetupArgs({testnet4, regtest}); const char* argv_testnet4[] = {"cmd", "-testnet4"}; const char* argv_regtest[] = {"cmd", "-regtest"}; @@ -761,8 +760,8 @@ struct ArgsMergeTestingSetup : public BasicTestingSetup { ForEachNoDup(conf_actions, SET, SECTION_NEGATE, [&] { for (bool soft_set : {false, true}) { for (bool force_set : {false, true}) { - for (const std::string& section : {ChainTypeToString(ChainType::MAIN), ChainTypeToString(ChainType::TESTNET), ChainTypeToString(ChainType::TESTNET4), ChainTypeToString(ChainType::SIGNET)}) { - for (const std::string& network : {ChainTypeToString(ChainType::MAIN), ChainTypeToString(ChainType::TESTNET), ChainTypeToString(ChainType::TESTNET4), ChainTypeToString(ChainType::SIGNET)}) { + for (const std::string& section : {ChainTypeToString(ChainType::MAIN), ChainTypeToString(ChainType::TESTNET4), ChainTypeToString(ChainType::SIGNET)}) { + for (const std::string& network : {ChainTypeToString(ChainType::MAIN), ChainTypeToString(ChainType::TESTNET4), ChainTypeToString(ChainType::SIGNET)}) { for (bool net_specific : {false, true}) { fn(arg_actions, conf_actions, soft_set, force_set, section, network, net_specific); } diff --git a/src/test/key_io_tests.cpp b/src/test/key_io_tests.cpp index 4fc30caa..d19ab6c6 100644 --- a/src/test/key_io_tests.cpp +++ b/src/test/key_io_tests.cpp @@ -152,7 +152,7 @@ BOOST_AUTO_TEST_CASE(key_io_invalid) std::string exp_base58string = test[0].get_str(); // must be invalid as public and as private key - for (const auto& chain : {ChainType::MAIN, ChainType::TESTNET, ChainType::SIGNET, ChainType::REGTEST}) { + for (const auto& chain : {ChainType::MAIN, ChainType::TESTNET4, ChainType::SIGNET, ChainType::REGTEST}) { SelectParams(chain); destination = DecodeDestination(exp_base58string); BOOST_CHECK_MESSAGE(!IsValidDestination(destination), "IsValid pubkey in mainnet:" + strTest); diff --git a/src/test/pow_tests.cpp b/src/test/pow_tests.cpp index 12390282..757e99d1 100644 --- a/src/test/pow_tests.cpp +++ b/src/test/pow_tests.cpp @@ -141,11 +141,6 @@ BOOST_AUTO_TEST_CASE(ChainParams_REGTEST_sanity) sanity_check_chainparams(*m_node.args, ChainType::REGTEST); } -BOOST_AUTO_TEST_CASE(ChainParams_TESTNET_sanity) -{ - sanity_check_chainparams(*m_node.args, ChainType::TESTNET); -} - BOOST_AUTO_TEST_CASE(ChainParams_TESTNET4_sanity) { sanity_check_chainparams(*m_node.args, ChainType::TESTNET4); diff --git a/src/test/versionbits_tests.cpp b/src/test/versionbits_tests.cpp index 9de57393..d0f9a740 100644 --- a/src/test/versionbits_tests.cpp +++ b/src/test/versionbits_tests.cpp @@ -443,7 +443,7 @@ BOOST_FIXTURE_TEST_CASE(versionbits_computeblockversion, BlockVersionTest) // check that any deployment on any chain can conceivably reach both // ACTIVE and FAILED states in roughly the way we expect - for (const auto& chain_type: {ChainType::MAIN, ChainType::TESTNET, ChainType::TESTNET4, ChainType::SIGNET, ChainType::REGTEST}) { + for (const auto& chain_type: {ChainType::MAIN, ChainType::TESTNET4, ChainType::SIGNET, ChainType::REGTEST}) { const auto chainParams = CreateChainParams(*m_node.args, chain_type); uint32_t chain_all_vbits{0}; for (int i = 0; i < (int)Consensus::MAX_VERSION_BITS_DEPLOYMENTS; ++i) { diff --git a/src/util/chaintype.cpp b/src/util/chaintype.cpp index 272466e7..b0862f51 100644 --- a/src/util/chaintype.cpp +++ b/src/util/chaintype.cpp @@ -13,8 +13,6 @@ std::string ChainTypeToString(ChainType chain) switch (chain) { case ChainType::MAIN: return "main"; - case ChainType::TESTNET: - return "test"; case ChainType::TESTNET4: return "testnet4"; case ChainType::SIGNET: @@ -29,8 +27,6 @@ std::optional ChainTypeFromString(std::string_view chain) { if (chain == "main") { return ChainType::MAIN; - } else if (chain == "test") { - return ChainType::TESTNET; } else if (chain == "testnet4") { return ChainType::TESTNET4; } else if (chain == "signet") { diff --git a/src/util/chaintype.h b/src/util/chaintype.h index 2fe734b6..b687245c 100644 --- a/src/util/chaintype.h +++ b/src/util/chaintype.h @@ -10,7 +10,6 @@ enum class ChainType { MAIN, - TESTNET, SIGNET, REGTEST, TESTNET4, diff --git a/src/validation.cpp b/src/validation.cpp index e6c8f24f..678092d1 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -855,7 +855,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws) if (tx.IsCoinBase()) return state.Invalid(TxValidationResult::TX_CONSENSUS, "coinbase"); - // Rather not work on nonstandard transactions (unless -testnet/-regtest) + // Rather not work on nonstandard transactions (unless -testnet4/-regtest) std::string reason; if (m_pool.m_opts.require_standard && !IsStandardTx(tx, m_pool.m_opts.max_datacarrier_bytes, m_pool.m_opts.permit_bare_multisig, m_pool.m_opts.dust_relay_feerate, reason)) { return state.Invalid(TxValidationResult::TX_NOT_STANDARD, reason);