What changed, and why it matters
This commit only updates Bitcoin Core's internal Python test framework to recognize a new P2P protocol version (70017) and a new 'FEATURE' message type as part of BIP 434 support. It does not change the actual Bitcoin node software, network rules, or consensus behavior. There is no security issue here.
No security action needed. Review as normal test-framework maintenance if BIP 434 implementation is being tracked.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies two functional test files. In test_framework/p2p.py, the test framework’s advertised P2P protocol version is bumped from 70016 to 70017 and a comment notes this supports ‘feature’. In p2p_leak.py, the test is updated to expect that a ‘FEATURE’ message is now an acceptable pre-verack feature-negotiation message, adding assertions and handler plumbing for it. This is purely test infrastructure alignment with a proposed BIP; no C++/node code is touched.
Changed components
test/functional/test_framework/p2p.pytest/functional/p2p_leak.pyInspect captured patch +9 / −3
diff --git a/test/functional/p2p_leak.py b/test/functional/p2p_leak.py
index ec7b9dc2..71046edb 100755
--- a/test/functional/p2p_leak.py
+++ b/test/functional/p2p_leak.py
@@ -5,7 +5,7 @@
"""Test message sending before handshake completion.
Before receiving a VERACK, a node should not send anything but VERSION/VERACK
-and feature negotiation messages (WTXIDRELAY, SENDADDRV2).
+and feature negotiation messages (WTXIDRELAY, SENDADDRV2, FEATURE).
This test connects to a node and sends it a few messages, trying to entice it
into sending us something it shouldn't."""
@@ -39,6 +39,7 @@ class LazyPeer(P2PInterface):
self.ever_connected = False
self.got_wtxidrelay = False
self.got_sendaddrv2 = False
+ self.got_feature = False
def bad_message(self, message):
self.unexpected_msg = True
@@ -70,6 +71,7 @@ class LazyPeer(P2PInterface):
def on_blocktxn(self, message): self.bad_message(message)
def on_wtxidrelay(self, message): self.got_wtxidrelay = True
def on_sendaddrv2(self, message): self.got_sendaddrv2 = True
+ def on_feature(self, message): self.got_feature = True
# Peer that sends a version but not a verack.
@@ -119,7 +121,7 @@ class P2PLeakTest(BitcoinTestFramework):
no_verack_idle_peer = self.nodes[0].add_p2p_connection(NoVerackIdlePeer(), wait_for_verack=False)
# Pre-wtxidRelay peer that sends a version but not a verack and does not support feature negotiation
- # messages which start at nVersion == 70016
+ # messages which start at nVersion >= 70016
pre_wtxidrelay_peer = self.nodes[0].add_p2p_connection(NoVerackIdlePeer(), send_version=False, wait_for_verack=False)
pre_wtxidrelay_peer.send_without_ping(self.create_old_version(70015))
@@ -145,14 +147,17 @@ class P2PLeakTest(BitcoinTestFramework):
assert not no_version_idle_peer.unexpected_msg
assert not no_version_idle_peer.got_wtxidrelay
assert not no_version_idle_peer.got_sendaddrv2
+ assert not no_version_idle_peer.got_feature
assert not no_verack_idle_peer.unexpected_msg
assert no_verack_idle_peer.got_wtxidrelay
assert no_verack_idle_peer.got_sendaddrv2
+ #assert no_verack_idle_peer.got_feature ## uncomment once a feature message is supported
assert not pre_wtxidrelay_peer.unexpected_msg
assert not pre_wtxidrelay_peer.got_wtxidrelay
assert not pre_wtxidrelay_peer.got_sendaddrv2
+ assert not pre_wtxidrelay_peer.got_feature
# Expect peers to be disconnected due to timeout
assert not no_version_idle_peer.is_connected
diff --git a/test/functional/test_framework/p2p.py b/test/functional/test_framework/p2p.py
index c6e3280d..80319479 100755
--- a/test/functional/test_framework/p2p.py
+++ b/test/functional/test_framework/p2p.py
@@ -100,7 +100,8 @@ logger = logging.getLogger("TestFramework.p2p")
MIN_P2P_VERSION_SUPPORTED = 60001
# The P2P version that this test framework implements and sends in its `version` message
# Version 70016 supports wtxid relay
-P2P_VERSION = 70016
+# Version 70017 supports feature
+P2P_VERSION = 70017
# The services that this test framework offers in its `version` message
P2P_SERVICES = NODE_NETWORK | NODE_WITNESS
# The P2P user agent string that this test framework sends in its `version` message
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.