diff options
author | Ava Chow <github@achow101.com> | 2024-01-31 15:24:48 -0500 |
---|---|---|
committer | Ava Chow <github@achow101.com> | 2024-01-31 15:33:57 -0500 |
commit | 3c63c2f324b839866ff90048759931dcad0bfeac (patch) | |
tree | 08eb249425088ce67f9d1433c6a84598bab2351f | |
parent | a01da41112387fd50553e8a5f203589f04f6e942 (diff) | |
parent | 0bef1042ce6c459acb1de965cbccd98867a417f1 (diff) |
Merge bitcoin/bitcoin#29347: net: enable v2transport by default
0bef1042ce6c459acb1de965cbccd98867a417f1 net: enable v2transport by default (Pieter Wuille)
Pull request description:
This enables BIP324's v2 transport by default (see #27634):
* Inbound connections will auto-sense whether v1 or v2 is in use.
* Automatic outbound connections will use v2 if `NODE_P2P_V2` was set in addr gossip, but retry with v1 if met with immediate failure.
* Manual outbound connections will default to v2, but retry with v1 if met with immediate failure.
It remains possible to run with `-v2transport=0` to disable all of these, and make all outbound and inbound connections v1. It also remains possible to specify the `v2transport` argument to the `addnode` RPC as `false`, to disable attempting a v2 connection for that particular added node.
ACKs for top commit:
stratospher:
ACK 0bef104.
josibake:
reACK https://github.com/bitcoin/bitcoin/pull/29347/commits/0bef1042ce6c459acb1de965cbccd98867a417f1
achow101:
ACK 0bef1042ce6c459acb1de965cbccd98867a417f1
naumenkogs:
ACK 0bef1042ce6c459acb1de965cbccd98867a417f1
theStack:
ACK 0bef1042ce6c459acb1de965cbccd98867a417f1
willcl-ark:
crACK 0bef1042ce6c459acb1de965cbccd98867a417f1
BrandonOdiwuor:
utACK 0bef1042ce6c459acb1de965cbccd98867a417f1
pablomartin4btc:
re ACK 0bef1042ce6c459acb1de965cbccd98867a417f1
kristapsk:
utACK 0bef1042ce6c459acb1de965cbccd98867a417f1
Tree-SHA512: 3f17a91e318b9304c40c74a7a5b231149f664ae684d13e9739a05be6c05ba9720f3c3c62da6a73ace0ae8ce733f1c8410b211f9fa15694e6a8d28999ab9882d8
-rw-r--r-- | src/net.h | 2 | ||||
-rwxr-xr-x | test/functional/test_framework/test_node.py | 11 |
2 files changed, 10 insertions, 3 deletions
@@ -97,7 +97,7 @@ static constexpr bool DEFAULT_FIXEDSEEDS{true}; static const size_t DEFAULT_MAXRECEIVEBUFFER = 5 * 1000; static const size_t DEFAULT_MAXSENDBUFFER = 1 * 1000; -static constexpr bool DEFAULT_V2_TRANSPORT{false}; +static constexpr bool DEFAULT_V2_TRANSPORT{true}; typedef int64_t NodeId; diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py index 58956a95f7..838dcba141 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -130,8 +130,15 @@ class TestNode(): # Default behavior from global -v2transport flag is added to args to persist it over restarts. # May be overwritten in individual tests, using extra_args. self.default_to_v2 = v2transport - if self.default_to_v2: - self.args.append("-v2transport=1") + if self.version_is_at_least(260000): + # 26.0 and later support v2transport + if v2transport: + self.args.append("-v2transport=1") + else: + self.args.append("-v2transport=0") + else: + # v2transport requested but not supported for node + assert not v2transport self.cli = TestNodeCLI(bitcoin_cli, self.datadir_path) self.use_cli = use_cli |