Skip to content

Commit

Permalink
Merge branch 'auxpow-28.x' into 28.x
Browse files Browse the repository at this point in the history
  • Loading branch information
domob1812 committed Dec 23, 2024
2 parents 50ff9d9 + e15e5e3 commit a12097e
Show file tree
Hide file tree
Showing 20 changed files with 136 additions and 52 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ AC_PREREQ([2.69])
define(_CLIENT_VERSION_MAJOR, 28)
define(_CLIENT_VERSION_MINOR, 1)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_RC, 1)
define(_CLIENT_VERSION_RC, 2)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2024)
define(_COPYRIGHT_HOLDERS,[The %s developers])
Expand Down
6 changes: 3 additions & 3 deletions doc/man/namecoin-cli.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH NAMECOIN-CLI "1" "December 2024" "namecoin-cli v28.1.0rc1" "User Commands"
.TH NAMECOIN-CLI "1" "December 2024" "namecoin-cli v28.1.0rc2" "User Commands"
.SH NAME
namecoin-cli \- manual page for namecoin-cli v28.1.0rc1
namecoin-cli \- manual page for namecoin-cli v28.1.0rc2
.SH SYNOPSIS
.B namecoin-cli
[\fI\,options\/\fR] \fI\,<command> \/\fR[\fI\,params\/\fR] \fI\,Send command to Namecoin Core\/\fR
Expand All @@ -15,7 +15,7 @@ namecoin-cli \- manual page for namecoin-cli v28.1.0rc1
.B namecoin-cli
[\fI\,options\/\fR] \fI\,help <command> Get help for a command\/\fR
.SH DESCRIPTION
Namecoin Core RPC client version v28.1.0rc1
Namecoin Core RPC client version v28.1.0rc2
.SH OPTIONS
.HP
\-?
Expand Down
13 changes: 7 additions & 6 deletions doc/man/namecoin-qt.1
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH NAMECOIN-QT "1" "December 2024" "namecoin-qt v28.1.0rc1" "User Commands"
.TH NAMECOIN-QT "1" "December 2024" "namecoin-qt v28.1.0rc2" "User Commands"
.SH NAME
namecoin-qt \- manual page for namecoin-qt v28.1.0rc1
namecoin-qt \- manual page for namecoin-qt v28.1.0rc2
.SH SYNOPSIS
.B namecoin-qt
[\fI\,command-line options\/\fR] [\fI\,URI\/\fR]
.SH DESCRIPTION
Namecoin Core version v28.1.0rc1
Namecoin Core version v28.1.0rc2
.PP
Optional URI is a Namecoin address in BIP21 URI format.
.SH OPTIONS
Expand Down Expand Up @@ -238,8 +238,8 @@ Default duration (in seconds) of manually configured bans (default:
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:8536=onion, testnet3: 127.0.0.1:18536=onion,
testnet4: 127.0.0.1:48536=onion, signet: 127.0.0.1:38536=onion,
(default: 127.0.0.1:8335=onion, testnet3: 127.0.0.1:18335=onion,
testnet4: 127.0.0.1:48334=onion, signet: 127.0.0.1:38335=onion,
regtest: 127.0.0.1:18445=onion)
.HP
\fB\-cjdnsreachable\fR
Expand Down Expand Up @@ -356,7 +356,8 @@ Support filtering of blocks and transaction with bloom filters (default:
.IP
Listen for connections on <port> (default: 8334, testnet3: 18334,
testnet4: 48333, signet: 38334, regtest: 18444). Not relevant for
I2P (see doc/i2p.md).
I2P (see doc/i2p.md). If set to a value x, the default onion
listening port will be set to x+1.
.HP
\fB\-proxy=\fR<ip:port|path>
.IP
Expand Down
6 changes: 3 additions & 3 deletions doc/man/namecoin-tx.1
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH NAMECOIN-TX "1" "December 2024" "namecoin-tx v28.1.0rc1" "User Commands"
.TH NAMECOIN-TX "1" "December 2024" "namecoin-tx v28.1.0rc2" "User Commands"
.SH NAME
namecoin-tx \- manual page for namecoin-tx v28.1.0rc1
namecoin-tx \- manual page for namecoin-tx v28.1.0rc2
.SH SYNOPSIS
.B namecoin-tx
[\fI\,options\/\fR] \fI\,<hex-tx> \/\fR[\fI\,commands\/\fR] \fI\,Update hex-encoded transaction\/\fR
.br
.B namecoin-tx
[\fI\,options\/\fR] \fI\,-create \/\fR[\fI\,commands\/\fR] \fI\,Create hex-encoded transaction\/\fR
.SH DESCRIPTION
Namecoin Core namecoin\-tx utility version v28.1.0rc1
Namecoin Core namecoin\-tx utility version v28.1.0rc2
.SH OPTIONS
.HP
\-?
Expand Down
6 changes: 3 additions & 3 deletions doc/man/namecoin-util.1
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH NAMECOIN-UTIL "1" "December 2024" "namecoin-util v28.1.0rc1" "User Commands"
.TH NAMECOIN-UTIL "1" "December 2024" "namecoin-util v28.1.0rc2" "User Commands"
.SH NAME
namecoin-util \- manual page for namecoin-util v28.1.0rc1
namecoin-util \- manual page for namecoin-util v28.1.0rc2
.SH SYNOPSIS
.B bitcoin-util
[\fI\,options\/\fR] [\fI\,commands\/\fR] \fI\,Do stuff\/\fR
.SH DESCRIPTION
Namecoin Core bitcoin\-util utility version v28.1.0rc1
Namecoin Core bitcoin\-util utility version v28.1.0rc2
.SH OPTIONS
.HP
\-?
Expand Down
6 changes: 3 additions & 3 deletions doc/man/namecoin-wallet.1
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH NAMECOIN-WALLET "1" "December 2024" "namecoin-wallet v28.1.0rc1" "User Commands"
.TH NAMECOIN-WALLET "1" "December 2024" "namecoin-wallet v28.1.0rc2" "User Commands"
.SH NAME
namecoin-wallet \- manual page for namecoin-wallet v28.1.0rc1
namecoin-wallet \- manual page for namecoin-wallet v28.1.0rc2
.SH DESCRIPTION
Namecoin Core namecoin\-wallet version v28.1.0rc1
Namecoin Core namecoin\-wallet version v28.1.0rc2
.PP
namecoin\-wallet is an offline tool for creating and interacting with Namecoin Core wallet files.
By default namecoin\-wallet will act on wallets in the default mainnet wallet directory in the datadir.
Expand Down
13 changes: 7 additions & 6 deletions doc/man/namecoind.1
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH NAMECOIND "1" "December 2024" "namecoind v28.1.0rc1" "User Commands"
.TH NAMECOIND "1" "December 2024" "namecoind v28.1.0rc2" "User Commands"
.SH NAME
namecoind \- manual page for namecoind v28.1.0rc1
namecoind \- manual page for namecoind v28.1.0rc2
.SH SYNOPSIS
.B namecoind
[\fI\,options\/\fR] \fI\,Start Namecoin Core\/\fR
.SH DESCRIPTION
Namecoin Core version v28.1.0rc1
Namecoin Core version v28.1.0rc2
.SH OPTIONS
.HP
\-?
Expand Down Expand Up @@ -236,8 +236,8 @@ Default duration (in seconds) of manually configured bans (default:
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:8536=onion, testnet3: 127.0.0.1:18536=onion,
testnet4: 127.0.0.1:48536=onion, signet: 127.0.0.1:38536=onion,
(default: 127.0.0.1:8335=onion, testnet3: 127.0.0.1:18335=onion,
testnet4: 127.0.0.1:48334=onion, signet: 127.0.0.1:38335=onion,
regtest: 127.0.0.1:18445=onion)
.HP
\fB\-cjdnsreachable\fR
Expand Down Expand Up @@ -354,7 +354,8 @@ Support filtering of blocks and transaction with bloom filters (default:
.IP
Listen for connections on <port> (default: 8334, testnet3: 18334,
testnet4: 48333, signet: 38334, regtest: 18444). Not relevant for
I2P (see doc/i2p.md).
I2P (see doc/i2p.md). If set to a value x, the default onion
listening port will be set to x+1.
.HP
\fB\-proxy=\fR<ip:port|path>
.IP
Expand Down
16 changes: 16 additions & 0 deletions doc/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ Notable changes

### P2P

- When the `-port` configuration option is used, the default onion listening port will now
be derived to be that port + 1 instead of being set to a fixed value (8334 on mainnet).
This re-allows setups with multiple local nodes using different `-port` and not using `-bind`,
which would lead to a startup failure in v28.0 due to a port collision.

Note that a `HiddenServicePort` manually configured in `torrc` may need adjustment if used in
connection with the `-port` option.
For example, if you are using `-port=5555` with a non-standard value and not using `-bind=...=onion`,
previously Bitcoin Core would listen for incoming Tor connections on `127.0.0.1:8334`.
Now it would listen on `127.0.0.1:5556` (`-port` plus one). If you configured the hidden service manually
in torrc now you have to change it from `HiddenServicePort 8333 127.0.0.1:8334` to `HiddenServicePort 8333
127.0.0.1:5556`, or configure bitcoind with `-bind=127.0.0.1:8334=onion` to get the previous behavior.
(#31223)
- #30568 addrman: change internal id counting to int64_t

### Key
Expand All @@ -59,6 +72,8 @@ Notable changes
### Test

- #31016 test: add missing sync to feature_fee_estimation.py
- #31448 fuzz: add cstdlib to FuzzedDataProvider
- #31419 test: fix MIN macro redefinition

### Doc

Expand All @@ -71,6 +86,7 @@ Notable changes
### Misc

- #31267 refactor: Drop deprecated space in `operator""_mst`
- #31431 util: use explicit cast in MultiIntBitSet::Fill()

Credits
=======
Expand Down
12 changes: 8 additions & 4 deletions share/examples/namecoin.conf
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@
# 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:8334=onion, testnet3: 127.0.0.1:18334=onion,
# testnet4: 127.0.0.1:48334=onion, signet: 127.0.0.1:38334=onion,
# (default: 127.0.0.1:8335=onion, testnet3: 127.0.0.1:18335=onion,
# testnet4: 127.0.0.1:48334=onion, signet: 127.0.0.1:38335=onion,
# regtest: 127.0.0.1:18445=onion)
#bind=<addr>[:<port>][=onion]

Expand Down Expand Up @@ -293,7 +293,8 @@

# Listen for connections on <port> (default: 8334, testnet3: 18334,
# testnet4: 48333, signet: 38334, regtest: 18444). Not relevant for
# I2P (see doc/i2p.md).
# I2P (see doc/i2p.md). If set to a value x, the default onion
# listening port will be set to x+1.
#port=<port>

# Connect through SOCKS5 proxy, set -noproxy to disable (default:
Expand Down Expand Up @@ -715,9 +716,12 @@
# Options for mainnet
[main]

# Options for testnet
# Options for testnet3
[test]

# Options for testnet4
[testnet4]

# Options for signet
[signet]

Expand Down
10 changes: 5 additions & 5 deletions src/chainparamsbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ std::unique_ptr<CBaseChainParams> CreateBaseChainParams(const ChainType chain)
{
switch (chain) {
case ChainType::MAIN:
return std::make_unique<CBaseChainParams>("", 8336, 8536);
return std::make_unique<CBaseChainParams>("", 8336);
case ChainType::TESTNET:
return std::make_unique<CBaseChainParams>("testnet3", 18336, 18536);
return std::make_unique<CBaseChainParams>("testnet3", 18336);
case ChainType::TESTNET4:
return std::make_unique<CBaseChainParams>("testnet4", 48336, 48536);
return std::make_unique<CBaseChainParams>("testnet4", 48336);
case ChainType::SIGNET:
return std::make_unique<CBaseChainParams>("signet", 38336, 38536);
return std::make_unique<CBaseChainParams>("signet", 38336);
case ChainType::REGTEST:
return std::make_unique<CBaseChainParams>("regtest", 18443, 18445);
return std::make_unique<CBaseChainParams>("regtest", 18443);
}
assert(false);
}
Expand Down
6 changes: 2 additions & 4 deletions src/chainparamsbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ class CBaseChainParams
public:
const std::string& DataDir() const { return strDataDir; }
uint16_t RPCPort() const { return m_rpc_port; }
uint16_t OnionServiceTargetPort() const { return m_onion_service_target_port; }

CBaseChainParams() = delete;
CBaseChainParams(const std::string& data_dir, uint16_t rpc_port, uint16_t onion_service_target_port)
: m_rpc_port(rpc_port), m_onion_service_target_port(onion_service_target_port), strDataDir(data_dir) {}
CBaseChainParams(const std::string& data_dir, uint16_t rpc_port)
: m_rpc_port(rpc_port), strDataDir(data_dir) {}

private:
const uint16_t m_rpc_port;
const uint16_t m_onion_service_target_port;
std::string strDataDir;
};

Expand Down
10 changes: 6 additions & 4 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ void SetupServerArgs(ArgsManager& argsman)
argsman.AddArg("-addnode=<ip>", 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=<file>", 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=<n>", strprintf("Default duration (in seconds) of manually configured bans (default: %u)", DEFAULT_MISBEHAVING_BANTIME), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
argsman.AddArg("-bind=<addr>[:<port>][=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)", defaultBaseParams->OnionServiceTargetPort(), testnetBaseParams->OnionServiceTargetPort(), testnet4BaseParams->OnionServiceTargetPort(), signetBaseParams->OnionServiceTargetPort(), regtestBaseParams->OnionServiceTargetPort()), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::CONNECTION);
argsman.AddArg("-bind=<addr>[:<port>][=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("-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=<ip>", "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);
Expand All @@ -558,7 +558,7 @@ void SetupServerArgs(ArgsManager& argsman)
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=<port>", strprintf("Listen for connections on <port> (default: %u, testnet3: %u, testnet4: %u, signet: %u, regtest: %u). Not relevant for I2P (see doc/i2p.md).", defaultChainParams->GetDefaultPort(), testnetChainParams->GetDefaultPort(), testnet4ChainParams->GetDefaultPort(), signetChainParams->GetDefaultPort(), regtestChainParams->GetDefaultPort()), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::CONNECTION);
argsman.AddArg("-port=<port>", strprintf("Listen for connections on <port> (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);
#ifdef HAVE_SOCKADDR_UN
argsman.AddArg("-proxy=<ip:port|path>", "Connect through SOCKS5 proxy, set -noproxy to disable (default: disabled). May be a local file path prefixed with 'unix:' if the proxy supports it.", ArgsManager::ALLOW_ANY | ArgsManager::DISALLOW_ELISION, OptionsCategory::CONNECTION);
#else
Expand Down Expand Up @@ -1882,6 +1882,8 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
const uint16_t default_bind_port =
static_cast<uint16_t>(args.GetIntArg("-port", Params().GetDefaultPort()));

const uint16_t default_bind_port_onion = default_bind_port + 1;

const auto BadPortWarning = [](const char* prefix, uint16_t port) {
return strprintf(_("%s request to listen on port %u. This port is considered \"bad\" and "
"thus it is unlikely that any peer will connect to it. See "
Expand All @@ -1906,7 +1908,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
const std::string network_type = bind_arg.substr(index + 1);
if (network_type == "onion") {
const std::string truncated_bind_arg = bind_arg.substr(0, index);
bind_addr = Lookup(truncated_bind_arg, BaseParams().OnionServiceTargetPort(), false);
bind_addr = Lookup(truncated_bind_arg, default_bind_port_onion, false);
if (bind_addr.has_value()) {
connOptions.onion_binds.push_back(bind_addr.value());
continue;
Expand Down Expand Up @@ -1942,7 +1944,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
} else if (!connOptions.vBinds.empty()) {
onion_service_target = connOptions.vBinds.front();
} else {
onion_service_target = DefaultOnionServiceTarget();
onion_service_target = DefaultOnionServiceTarget(default_bind_port_onion);
connOptions.onion_binds.push_back(onion_service_target);
}

Expand Down
1 change: 1 addition & 0 deletions src/test/fuzz/FuzzedDataProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <climits>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <initializer_list>
#include <limits>
Expand Down
4 changes: 2 additions & 2 deletions src/torcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -711,9 +711,9 @@ void StopTorControl()
}
}

CService DefaultOnionServiceTarget()
CService DefaultOnionServiceTarget(uint16_t port)
{
struct in_addr onion_service_target;
onion_service_target.s_addr = htonl(INADDR_LOOPBACK);
return {onion_service_target, BaseParams().OnionServiceTargetPort()};
return {onion_service_target, port};
}
2 changes: 1 addition & 1 deletion src/torcontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void StartTorControl(CService onion_service_target);
void InterruptTorControl();
void StopTorControl();

CService DefaultOnionServiceTarget();
CService DefaultOnionServiceTarget(uint16_t port);

/** Reply from Tor, can be single or multi-line */
class TorControlReply
Expand Down
2 changes: 1 addition & 1 deletion src/util/bitset.h
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ class MultiIntBitSet
if (count) {
unsigned i = 0;
while (count > LIMB_BITS) {
ret.m_val[i++] = ~I{0};
ret.m_val[i++] = I(~I{0});
count -= LIMB_BITS;
}
ret.m_val[i] = I(~I{0}) >> (LIMB_BITS - count);
Expand Down
Loading

0 comments on commit a12097e

Please sign in to comment.