p2p_v2_misbehaving.py failed in a nightly OpenBSD 7.9 job at 5c4e8374074f1c247e88c4fc12fc5b8858e6ff6f:
417/506 - p2p_v2_misbehaving.py failed (exit code 1), Duration: 81 s
stdout:
2026-12-02T02:12:23.477717Z TestFramework (INFO): PRNG seed is: 3328574903851671092
2026-12-02T02:12:23.531410Z TestFramework (INFO): Initializing test directory /home/test_runner_₿_🏃_20261202_020103/p2p_v2_misbehaving_149
2026-12-02T02:12:23.967670Z TestFramework (INFO): Sending ellswift bytes in parts to ensure that response from responder is received only when
2026-12-02T02:12:23.967852Z TestFramework (INFO): ellswift bytes have a mismatch from the 16 bytes(network magic followed by "version\x00\x00\x00\x00\x00")
2026-12-02T02:12:23.969027Z TestFramework (INFO): Sending first 4 bytes of ellswift which match network magic
2026-12-02T02:12:23.969157Z TestFramework (INFO): If a response is received, assertion failure would happen in our custom data_received() function
2026-12-02T02:12:23.984643Z TestFramework (INFO): Sending remaining ellswift and garbage which are different from V1_PREFIX. Since a response is
2026-12-02T02:12:23.985191Z TestFramework (INFO): expected now, our custom data_received() function wouldn't result in assertion failure
2026-12-02T02:12:24.042652Z TestFramework (INFO): successful disconnection since modified ellswift was sent as response
2026-12-02T02:12:24.144615Z TestFramework (INFO): Expected disconnection for EXCESS_GARBAGE
2026-12-02T02:12:24.393441Z TestFramework (INFO): Expected disconnection for WRONG_GARBAGE_TERMINATOR
2026-12-02T02:12:24.636523Z TestFramework (INFO): Expected disconnection for WRONG_GARBAGE
2026-12-02T02:13:44.691653Z TestFramework (ERROR): Unexpected exception:
Traceback (most recent call last):
File "/home/bitcoin/test/functional/test_framework/test_framework.py", line 149, in main
self.run_test()
~~~~~~~~~~~~~^^
File "/home/build/test/functional/p2p_v2_misbehaving.py", line 134, in run_test
self.test_v2disconnection()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/build/test/functional/p2p_v2_misbehaving.py", line 177, in test_v2disconnection
with node0.assert_debug_log(expected_debug_message[test_type.value], timeout=5):
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/contextlib.py", line 148, in __exit__
next(self.gen)
~~~~^^^^^^^^^^
File "/home/bitcoin/test/functional/test_framework/test_node.py", line 666, in assert_debug_log
self._raise_assertion_error(f'Expected message(s) {remaining_expected!s} '
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
f'not found in log:\n\n{join_log(log)}\n\n')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/bitcoin/test/functional/test_framework/test_node.py", line 231, in _raise_assertion_error
raise AssertionError(self._node_msg(msg))
AssertionError: [node 0] Expected message(s) ['V2 transport error: packet decryption failure'] not found in log:
- 2026-12-02T02:12:24.646535Z (mocktime: 2026-12-02T02:12:28Z) [http] [httpserver.cpp:977] [Receive] [http] Received 349 bytes from 127.0.0.1:60530 (id=1): total=10992 buffered=349
- 2026-12-02T02:12:24.646914Z (mocktime: 2026-12-02T02:12:28Z) [http] [httpserver.cpp:1158] [TryReadRequestInternal] [http] Received a POST request for / from 127.0.0.1:60530 (id=1)
- 2026-12-02T02:12:24.647364Z (mocktime: 2026-12-02T02:12:28Z) [http.01] [rpc/request.cpp:247] [parse] [rpc] ThreadRPCServer method=setmocktime user=__cookie__ id=31
- 2026-12-02T02:12:24.648195Z (mocktime: 2026-12-02T02:12:24Z) [http.01] [httpserver.cpp:642] [Send] [http] HTTPResponse (status code: 200 size: 148) added to send buffer for client 127.0.0.1:60530 (id=1)
- 2026-12-02T02:12:24.648983Z (mocktime: 2026-12-02T02:12:24Z) [http.01] [httpserver.cpp:1319] [MaybeSendBytesFromBuffer] [http] Sent 148 bytes to client 127.0.0.1:60530 (id=1)
- 2026-12-02T02:12:24.652554Z (mocktime: 2026-12-02T02:12:24Z) [net] [net.cpp:4192] [CNode] [net] Added connection peer=7
- 2026-12-02T02:12:24.652758Z (mocktime: 2026-12-02T02:12:24Z) [net] [net.cpp:1903] [CreateNodeFromAcceptedSocket] [net] connection from 127.0.0.1:7056 accepted
- 2026-12-02T02:12:24.706483Z (mocktime: 2026-12-02T02:12:24Z) [net] [net.cpp:4192] [CNode] [net] Added connection peer=8
- 2026-12-02T02:12:24.706652Z (mocktime: 2026-12-02T02:12:24Z) [net] [net.cpp:1903] [CreateNodeFromAcceptedSocket] [net] connection from 127.0.0.1:10113 accepted
- 2026-12-02T02:12:24.789704Z (mocktime: 2026-12-02T02:12:24Z) [msghand] [net_processing.cpp:3834] [ProcessMessage] [net] received: version (111 bytes) peer=7
- 2026-12-02T02:12:24.789786Z (mocktime: 2026-12-02T02:12:24Z) [msghand] [net.cpp:4260] [PushMessage] [net] sending version (114 bytes) peer=7
- 2026-12-02T02:12:24.790189Z (mocktime: 2026-12-02T02:12:24Z) [msghand] [net_processing.cpp:1692] [PushNodeVersion] [net] send version message: version=70017, blocks=200, txrelay=1, peer=7
- 2026-12-02T02:12:24.791174Z (mocktime: 2026-12-02T02:12:24Z) [msghand] [net_processing.cpp:3953] [ProcessMessage] [net] receive version message: /python-p2p-tester:0.0.3/: version 70017, blocks=-1, us=127.0.0.1:12788, txrelay=1, peer=7
- 2026-12-02T02:12:24.791239Z (mocktime: 2026-12-02T02:12:24Z) [msghand] [net.cpp:4260] [PushMessage] [net] sending wtxidrelay (0 bytes) peer=7
- 2026-12-02T02:12:24.791765Z (mocktime: 2026-12-02T02:12:24Z) [msghand] [net.cpp:4260] [PushMessage] [net] sending sendaddrv2 (0 bytes) peer=7
- 2026-12-02T02:12:24.792224Z (mocktime: 2026-12-02T02:12:24Z) [msghand] [net.cpp:4260] [PushMessage] [net] sending verack (0 bytes) peer=7
- 2026-12-02T02:12:24.802169Z (mocktime: 2026-12-02T02:12:24Z) [msghand] [net_processing.cpp:3834] [ProcessMessage] [net] received: wtxidrelay (0 bytes) peer=7
- 2026-12-02T02:12:24.802425Z (mocktime: 2026-12-02T02:12:24Z) [msghand] [net_processing.cpp:3834] [ProcessMessage] [net] received: verack (0 bytes) peer=7
- 2026-12-02T02:12:24.802656Z (mocktime: 2026-12-02T02:12:24Z) [msghand] [net_processing.cpp:4097] [ProcessMessage] [net] New inbound peer connected: transport: v2, version: 70017, peer=7
- 2026-12-02T02:12:24.803062Z (mocktime: 2026-12-02T02:12:24Z) [msghand] [net.cpp:4260] [PushMessage] [net] sending sendcmpct (9 bytes) peer=7
- 2026-12-02T02:12:24.803589Z (mocktime: 2026-12-02T02:12:24Z) [msghand] [net.cpp:4260] [PushMessage] [net] sending ping (8 bytes) peer=7
- 2026-12-02T02:12:24.804059Z (mocktime: 2026-12-02T02:12:24Z) [msghand] [net.cpp:4260] [PushMessage] [net] sending getheaders (645 bytes) peer=7
- 2026-12-02T02:12:24.804508Z (mocktime: 2026-12-02T02:12:24Z) [msghand] [net_processing.cpp:6148] [SendMessages] [net] initial getheaders (199) to peer=7
- 2026-12-02T02:12:24.804892Z (mocktime: 2026-12-02T02:12:24Z) [msghand] [net.cpp:4260] [PushMessage] [net] sending feefilter (8 bytes) peer=7
- 2026-12-02T02:12:24.805303Z (mocktime: 2026-12-02T02:12:24Z) [msghand] [net_processing.cpp:3834] [ProcessMessage] [net] received: getaddr (0 bytes) peer=7
- 2026-12-02T02:12:24.833696Z (mocktime: 2026-12-02T02:12:24Z) [msghand] [net_processing.cpp:3834] [ProcessMessage] [net] received: ping (8 bytes) peer=7
- 2026-12-02T02:12:24.833864Z (mocktime: 2026-12-02T02:12:24Z) [msghand] [net.cpp:4260] [PushMessage] [net] sending pong (8 bytes) peer=7
- 2026-12-02T02:12:24.834220Z (mocktime: 2026-12-02T02:12:24Z) [msghand] [net_processing.cpp:3834] [ProcessMessage] [net] received: ping (8 bytes) peer=7
- 2026-12-02T02:12:24.834868Z (mocktime: 2026-12-02T02:12:24Z) [msghand] [net.cpp:4260] [PushMessage] [net] sending pong (8 bytes) peer=7
- 2026-12-02T02:12:24.835375Z (mocktime: 2026-12-02T02:12:24Z) [msghand] [net_processing.cpp:3834] [ProcessMessage] [net] received: pong (8 bytes) peer=7
- 2026-12-02T02:12:24.841430Z (mocktime: 2026-12-02T02:12:24Z) [http] [httpserver.cpp:977] [Receive] [http] Received 339 bytes from 127.0.0.1:60530 (id=1): total=11331 buffered=339
- 2026-12-02T02:12:24.841876Z (mocktime: 2026-12-02T02:12:24Z) [http] [httpserver.cpp:1158] [TryReadRequestInternal] [http] Received a POST request for / from 127.0.0.1:60530 (id=1)
- 2026-12-02T02:12:24.842356Z (mocktime: 2026-12-02T02:12:24Z) [http.00] [rpc/request.cpp:247] [parse] [rpc] ThreadRPCServer method=getpeerinfo user=__cookie__ id=32
- 2026-12-02T02:12:24.843932Z (mocktime: 2026-12-02T02:12:24Z) [http.00] [httpserver.cpp:642] [Send] [http] HTTPResponse (status code: 200 size: 5425) added to send buffer for client 127.0.0.1:60530 (id=1)
- 2026-12-02T02:12:24.844615Z (mocktime: 2026-12-02T02:12:24Z) [http.00] [httpserver.cpp:1319] [MaybeSendBytesFromBuffer] [http] Sent 5425 bytes to client 127.0.0.1:60530 (id=1)
- 2026-12-02T02:12:24.847366Z (mocktime: 2026-12-02T02:12:24Z) [http] [httpserver.cpp:977] [Receive] [http] Received 272 bytes from 127.0.0.1:60530 (id=1): total=11603 buffered=272
- 2026-12-02T02:12:24.848176Z (mocktime: 2026-12-02T02:12:24Z) [http] [httpserver.cpp:977] [Receive] [http] Received 77 bytes from 127.0.0.1:60530 (id=1): total=11680 buffered=77
- 2026-12-02T02:12:24.848440Z (mocktime: 2026-12-02T02:12:24Z) [http] [httpserver.cpp:1158] [TryReadRequestInternal] [http] Received a POST request for / from 127.0.0.1:60530 (id=1)
- 2026-12-02T02:12:24.848788Z (mocktime: 2026-12-02T02:12:24Z) [http.01] [rpc/request.cpp:247] [parse] [rpc] ThreadRPCServer method=setmocktime user=__cookie__ id=33
- 2026-12-02T02:12:24.849111Z (mocktime: 2026-12-02T02:12:28Z) [http.01] [httpserver.cpp:642] [Send] [http] HTTPResponse (status code: 200 size: 148) added to send buffer for client 127.0.0.1:60530 (id=1)
- 2026-12-02T02:12:24.849506Z (mocktime: 2026-12-02T02:12:28Z) [http.01] [httpserver.cpp:1319] [MaybeSendBytesFromBuffer] [http] Sent 148 bytes to client 127.0.0.1:60530 (id=1)
- 2026-12-02T02:12:24.870174Z (mocktime: 2026-12-02T02:12:28Z) [net] [net.cpp:2085] [InactivityCheck] [net] socket no message in first 3 seconds, never sent to peer, disconnecting peer=8
- 2026-12-02T02:12:24.870211Z (mocktime: 2026-12-02T02:12:28Z) [net] [net.cpp:584] [CloseSocketDisconnect] [net] Resetting socket for peer=8
- 2026-12-02T02:12:24.870299Z (mocktime: 2026-12-02T02:12:28Z) [net] [net_processing.cpp:1853] [FinalizeNode] [net] Cleared nodestate for peer=8
- 2026-12-02T02:13:08.911100Z (mocktime: 2026-12-02T02:12:28Z) [scheduler] [net.cpp:2516] [StartExtraBlockRelayPeers] [net] enabling extra block-relay-only peers
2026-12-02T02:13:44.781652Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later.
2026-12-02T02:13:44.781927Z TestFramework (WARNING): Not cleaning up dir /home/test_runner_₿_🏃_20261202_020103/p2p_v2_misbehaving_149
2026-12-02T02:13:44.782065Z TestFramework (ERROR): Test failed. Test logging available at /home/test_runner_₿_🏃_20261202_020103/p2p_v2_misbehaving_149/test_framework.log
2026-12-02T02:13:44.782486Z TestFramework (ERROR):
2026-12-02T02:13:44.782859Z TestFramework (ERROR): Hint: Call /home/bitcoin/test/functional/combine_logs.py '/home/test_runner_₿_🏃_20261202_020103/p2p_v2_misbehaving_149' to consolidate all logs
2026-12-02T02:13:44.783005Z TestFramework (ERROR):
2026-12-02T02:13:44.783101Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2026-12-02T02:13:44.783285Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
2026-12-02T02:13:44.783461Z TestFramework (ERROR):
stderr:
[node 0] Cleaning up leftover process
A clanker's diff that reproduces the issue on Linux:
--- a/test/functional/p2p_v2_misbehaving.py
+++ b/test/functional/p2p_v2_misbehaving.py
@@ -8,7 +8,7 @@ import time
from enum import Enum
from test_framework.messages import MAGIC_BYTES
-from test_framework.p2p import P2PInterface
+from test_framework.p2p import NetworkThread, P2PInterface
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import random_bitflip
from test_framework.v2_p2p import (
@@ -123,6 +123,12 @@ class MisbehavingV2Peer(P2PInterface):
else:
super().data_received(t)
+ def send_raw_message(self, raw_message_bytes):
+ if self.test_type == TestType.SEND_NO_AAD:
+ NetworkThread.network_event_loop.call_later(1, lambda: self.is_connected and super(MisbehavingV2Peer, self).send_raw_message(raw_message_bytes))
+ else:
+ super().send_raw_message(raw_message_bytes)
+
class EncryptedP2PMisbehaving(BitcoinTestFramework):
def set_test_params(self):