Repository navigation
Closed
Description
test 2026-07-30T07:16:30.579942Z TestFramework (INFO): Checking that a private broadcast destination signaling relay=false gets disconnected
node0 2026-07-30T07:16:30.580107Z [http] [httpserver.cpp:1025] [MaybeDispatchRequestsFromClient] [http] Received a POST request for / from 127.0.0.1:45602 (id=0)
node0 2026-07-30T07:16:30.580143Z [http.00] [rpc/request.cpp:242] [parse] [rpc] ThreadRPCServer method=getblockchaininfo user=__cookie__ id=230
node0 2026-07-30T07:16:30.580204Z [http.00] [httpserver.cpp:616] [WriteReply] [http] HTTPResponse (status code: 200 size: 735) added to send buffer for client 127.0.0.1:45602 (id=0)
node0 2026-07-30T07:16:30.580221Z [http.00] [httpserver.cpp:1185] [MaybeSendBytesFromBuffer] [http] Sent 735 bytes to client 127.0.0.1:45602 (id=0)
node0 2026-07-30T07:16:30.580582Z [http] [httpserver.cpp:1025] [MaybeDispatchRequestsFromClient] [http] Received a POST request for / from 127.0.0.1:45602 (id=0)
node0 2026-07-30T07:16:30.580611Z [http.01] [rpc/request.cpp:242] [parse] [rpc] ThreadRPCServer method=sendrawtransaction user=__cookie__ id=231
node0 2026-07-30T07:16:30.580753Z [http.01] [txmempool.cpp:441] [check] [mempool] Checking mempool with 2 transactions and 2 inputs
node0 2026-07-30T07:16:30.580848Z [http.01] [net_processing.cpp:2494] [InitiateTxBroadcastPrivate] [privatebroadcast] Requesting 3 new connections due to txid=a9c1c601558eeb36efb16b03a1830c1fec9c94bf50d11d0dfb20de928c1c6006, wtxid=7dd5b6dd06dd68d4d8dd6231104023b479c46106808849d6f25dc609d7748502
node0 2026-07-30T07:16:30.580864Z [http.01] [httpserver.cpp:616] [WriteReply] [http] HTTPResponse (status code: 200 size: 212) added to send buffer for client 127.0.0.1:45602 (id=0)
node0 2026-07-30T07:16:30.580877Z [http.01] [httpserver.cpp:1185] [MaybeSendBytesFromBuffer] [http] Sent 212 bytes to client 127.0.0.1:45602 (id=0)
node0 2026-07-30T07:16:30.680027Z [privbcast] [addrman.cpp:767] [Select_] [addrman] Selected testonlyc377777777777777777777777777777777777777777q.b32.i2p:0 from new
node0 2026-07-30T07:16:30.680055Z [privbcast] [net.cpp:404] [ConnectNode] [net] trying v1 connection (private-broadcast) to testonlyc377777777777777777777777777777777777777777q.b32.i2p:0, lastseen=0.0hrs
node0 2026-07-30T07:16:30.680069Z [privbcast] [i2p.cpp:418] [CreateIfNotCreatedAlready] [i2p] Creating transient I2P SAM session e707c40180 with 127.0.0.1:1
node0 2026-07-30T07:16:30.680114Z [privbcast] [netbase.cpp:584] [LogConnectFailure] connect() to 127.0.0.1:1 failed after wait: Connection refused (111)
node0 2026-07-30T07:16:30.680155Z [privbcast] [i2p.cpp:275] [Connect] [i2p] Error connecting to testonlyc377777777777777777777777777777777777777777q.b32.i2p:0: Cannot connect to 127.0.0.1:1
node0 2026-07-30T07:16:30.680167Z [privbcast] [net.cpp:3364] [ThreadPrivateBroadcast] [privatebroadcast] Failed to connect to testonlyc377777777777777777777777777777777777777777q.b32.i2p:0, will retry to a different address; remaining connections to open: 9
node0 2026-07-30T07:16:30.782460Z [privbcast] [addrman.cpp:767] [Select_] [addrman] Selected 130.0.0.1:8333 from tried
node0 2026-07-30T07:16:30.782480Z [privbcast] [net.cpp:3364] [ThreadPrivateBroadcast] [privatebroadcast] Failed to connect to 130.0.0.1:8333 through the proxy at 127.0.0.1:41007, will retry to a different address; remaining connections to open: 9
node0 2026-07-30T07:16:30.815151Z [opencon] [net.cpp:2953] [ThreadOpenConnections] [net] Making feeler connection to [50::1]:8333
node0 2026-07-30T07:16:30.815179Z [opencon] [net.cpp:404] [ConnectNode] [net] trying v1 connection (feeler) to [50::1]:8333, lastseen=0.0hrs
node0 2026-07-30T07:16:30.815188Z [opencon] [net.cpp:489] [ConnectNode] [proxy] Using proxy: 127.0.0.1:41007 to connect to [50::1]:8333
node0 2026-07-30T07:16:30.815245Z [opencon] [netbase.cpp:396] [Socks5] [net] SOCKS5 connecting 50::1
node0 2026-07-30T07:16:30.815504Z [opencon] [netbase.cpp:434] [Socks5] [proxy] SOCKS5 sending username/password authentication
node0 2026-07-30T07:16:30.815572Z [opencon] [netbase.cpp:514] [Socks5] [net] SOCKS5 connected 50::1
test 2026-07-30T07:16:30.815593Z TestFramework.socks5 (DEBUG): Proxy: Socks5Command(1,3,bytearray(b'50::1'),8333,bytearray(b'0e7d197df7c908e0-20'),bytearray(b'0e7d197df7c908e0-20'))
node0 2026-07-30T07:16:30.815595Z [opencon] [net.cpp:4112] [CNode] [net] Added connection peer=20
node0 2026-07-30T07:16:30.819588Z [i2paccept] [i2p.cpp:418] [CreateIfNotCreatedAlready] [i2p] Creating persistent I2P SAM session 570dd11089 with 127.0.0.1:1
node0 2026-07-30T07:16:30.819634Z [i2paccept] [netbase.cpp:584] [LogConnectFailure] connect() to 127.0.0.1:1 failed after wait: Connection refused (111)
node0 2026-07-30T07:16:30.819663Z [i2paccept] [i2p.cpp:152] [Listen] [error] Couldn't listen: Cannot connect to 127.0.0.1:1
test 2026-07-30T07:16:30.821785Z TestFramework.p2p (DEBUG): Listening server on 127.0.0.1:41721 should be started
node0 2026-07-30T07:16:30.823560Z [msghand] [net.cpp:4180] [PushMessage] [net] sending version (114 bytes) peer=20
node0 2026-07-30T07:16:30.823594Z [msghand] [net_processing.cpp:1692] [PushNodeVersion] [net] send version message: version=70017, blocks=200, txrelay=0, peer=20
test 2026-07-30T07:16:30.872173Z TestFramework (DEBUG): Instructing the SOCKS5 proxy to redirect connection i=20 (private-broadcast) for [50::1]:8333 to 127.0.0.1:41721 (Python NoRelayP2PInterface)
test 2026-07-30T07:16:30.872270Z TestFramework.socks5 (DEBUG): Serving connection to [50::1]:8333, will redirect it to 127.0.0.1:41721 instead
test 2026-07-30T07:16:30.872561Z TestFramework.p2p (DEBUG): Connected: us=127.0.0.1:41721, them=127.0.0.1:57430
test 2026-07-30T07:16:30.872692Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:57430: msg_version(nVersion=70017 nServices=1033 nTime=Thu Jul 30 07:16:30 2026 addrTo=CAddress(nServices=9 net=IPv4 addr=0.0.0.1 port=8333) addrFrom=CAddress(nServices=1033 net=IPv4 addr=0.0.0.0 port=0) nNonce=0x5938FA4F8DCAC12B strSubVer=/Satoshi:31.99.0(testnode0)/ nStartingHeight=200 relay=0)
test 2026-07-30T07:16:30.872746Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:57430: msg_version(nVersion=70017 nServices=9 nTime=Thu Jul 30 07:16:30 2026 addrTo=CAddress(nServices=1 net=IPv4 addr=0.0.0.0 port=0) addrFrom=CAddress(nServices=1 net=IPv4 addr=0.0.0.0 port=0) nNonce=0x41FAEAEC489A927F strSubVer=/python-p2p-tester:0.0.3/ nStartingHeight=-1 relay=0)
test 2026-07-30T07:16:30.872786Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:57430: msg_wtxidrelay()
test 2026-07-30T07:16:30.872815Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:57430: msg_verack()
node0 2026-07-30T07:16:30.876367Z [msghand] [net_processing.cpp:3809] [ProcessMessage] [net] received: version (111 bytes) peer=20
node0 2026-07-30T07:16:30.876392Z [msghand] [net_processing.cpp:3928] [ProcessMessage] [net] receive version message: /python-p2p-tester:0.0.3/: version 70017, blocks=-1, us=0.0.0.0:0, txrelay=0, peer=20
node0 2026-07-30T07:16:30.876397Z [msghand] [net.cpp:4180] [PushMessage] [net] sending wtxidrelay (0 bytes) peer=20
node0 2026-07-30T07:16:30.876422Z [msghand] [net.cpp:4180] [PushMessage] [net] sending sendaddrv2 (0 bytes) peer=20
node0 2026-07-30T07:16:30.876435Z [msghand] [net.cpp:4180] [PushMessage] [net] sending verack (0 bytes) peer=20
node0 2026-07-30T07:16:30.876454Z [msghand] [addrman.cpp:657] [Good_] [addrman] Moved [50::1]:8333 to tried[171][20]
node0 2026-07-30T07:16:30.876459Z [msghand] [node/timeoffsets.cpp:31] [Add] [net] Added time offset +0s, total samples 11
node0 2026-07-30T07:16:30.876466Z [msghand] [net_processing.cpp:4043] [ProcessMessage] [net] feeler connection completed, disconnecting peer=20
node0 2026-07-30T07:16:30.876538Z [net] [net.cpp:567] [CloseSocketDisconnect] [net] Resetting socket for peer=20
node0 2026-07-30T07:16:30.876561Z [net] [net_processing.cpp:1848] [FinalizeNode] [net] Cleared nodestate for peer=20
test 2026-07-30T07:16:30.876661Z TestFramework.socks5 (DEBUG): Handler 20 removed
test 2026-07-30T07:16:30.876782Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:57430: msg_wtxidrelay()
test 2026-07-30T07:16:30.876829Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:57430: msg_sendaddrv2()
test 2026-07-30T07:16:30.876858Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:57430: msg_verack()
test 2026-07-30T07:16:30.876912Z TestFramework.p2p (DEBUG): Closed connection to: 127.0.0.1:57430
test 2026-07-30T07:16:30.882827Z TestFramework (ERROR): Unexpected exception:
Traceback (most recent call last):
File "/home/runner/work/bitcoin/bitcoin/test/functional/test_framework/test_framework.py", line 145, in main
self.run_test()
File "/home/runner/work/bitcoin/bitcoin/ci_build/test/functional/p2p_private_broadcast.py", line 399, in run_test
with tx_originator.assert_debug_log(expected_msgs=[disconnect_msg]):
File "/usr/lib/python3.12/contextlib.py", line 144, in __exit__
next(self.gen)
File "/home/runner/work/bitcoin/bitcoin/test/functional/test_framework/test_node.py", line 627, in assert_debug_log
self._raise_assertion_error(f'Expected message(s) {remaining_expected!s} '
File "/home/runner/work/bitcoin/bitcoin/test/functional/test_framework/test_node.py", line 228, in _raise_assertion_error
raise AssertionError(self._node_msg(msg))
AssertionError: [node 0] Expected message(s) ['Disconnecting: does not support transaction relay (connected in vain)'] not found in log:
- 2026-07-30T07:16:30.580582Z [http] [httpserver.cpp:1025] [MaybeDispatchRequestsFromClient] [http] Received a POST request for / from 127.0.0.1:45602 (id=0)
- 2026-07-30T07:16:30.580611Z [http.01] [rpc/request.cpp:242] [parse] [rpc] ThreadRPCServer method=sendrawtransaction user=__cookie__ id=231
- 2026-07-30T07:16:30.580753Z [http.01] [txmempool.cpp:441] [check] [mempool] Checking mempool with 2 transactions and 2 inputs
- 2026-07-30T07:16:30.580848Z [http.01] [net_processing.cpp:2494] [InitiateTxBroadcastPrivate] [privatebroadcast] Requesting 3 new connections due to txid=a9c1c601558eeb36efb16b03a1830c1fec9c94bf50d11d0dfb20de928c1c6006, wtxid=7dd5b6dd06dd68d4d8dd6231104023b479c46106808849d6f25dc609d7748502
- 2026-07-30T07:16:30.580864Z [http.01] [httpserver.cpp:616] [WriteReply] [http] HTTPResponse (status code: 200 size: 212) added to send buffer for client 127.0.0.1:45602 (id=0)
- 2026-07-30T07:16:30.580877Z [http.01] [httpserver.cpp:1185] [MaybeSendBytesFromBuffer] [http] Sent 212 bytes to client 127.0.0.1:45602 (id=0)
- 2026-07-30T07:16:30.680027Z [privbcast] [addrman.cpp:767] [Select_] [addrman] Selected testonlyc377777777777777777777777777777777777777777q.b32.i2p:0 from new
- 2026-07-30T07:16:30.680055Z [privbcast] [net.cpp:404] [ConnectNode] [net] trying v1 connection (private-broadcast) to testonlyc377777777777777777777777777777777777777777q.b32.i2p:0, lastseen=0.0hrs
- 2026-07-30T07:16:30.680069Z [privbcast] [i2p.cpp:418] [CreateIfNotCreatedAlready] [i2p] Creating transient I2P SAM session e707c40180 with 127.0.0.1:1
- 2026-07-30T07:16:30.680114Z [privbcast] [netbase.cpp:584] [LogConnectFailure] connect() to 127.0.0.1:1 failed after wait: Connection refused (111)
- 2026-07-30T07:16:30.680155Z [privbcast] [i2p.cpp:275] [Connect] [i2p] Error connecting to testonlyc377777777777777777777777777777777777777777q.b32.i2p:0: Cannot connect to 127.0.0.1:1
- 2026-07-30T07:16:30.680167Z [privbcast] [net.cpp:3364] [ThreadPrivateBroadcast] [privatebroadcast] Failed to connect to testonlyc377777777777777777777777777777777777777777q.b32.i2p:0, will retry to a different address; remaining connections to open: 9
- 2026-07-30T07:16:30.782460Z [privbcast] [addrman.cpp:767] [Select_] [addrman] Selected 130.0.0.1:8333 from tried
- 2026-07-30T07:16:30.782480Z [privbcast] [net.cpp:3364] [ThreadPrivateBroadcast] [privatebroadcast] Failed to connect to 130.0.0.1:8333 through the proxy at 127.0.0.1:41007, will retry to a different address; remaining connections to open: 9
- 2026-07-30T07:16:30.815151Z [opencon] [net.cpp:2953] [ThreadOpenConnections] [net] Making feeler connection to [50::1]:8333
- 2026-07-30T07:16:30.815179Z [opencon] [net.cpp:404] [ConnectNode] [net] trying v1 connection (feeler) to [50::1]:8333, lastseen=0.0hrs
- 2026-07-30T07:16:30.815188Z [opencon] [net.cpp:489] [ConnectNode] [proxy] Using proxy: 127.0.0.1:41007 to connect to [50::1]:8333
- 2026-07-30T07:16:30.815245Z [opencon] [netbase.cpp:396] [Socks5] [net] SOCKS5 connecting 50::1
- 2026-07-30T07:16:30.815504Z [opencon] [netbase.cpp:434] [Socks5] [proxy] SOCKS5 sending username/password authentication
- 2026-07-30T07:16:30.815572Z [opencon] [netbase.cpp:514] [Socks5] [net] SOCKS5 connected 50::1
- 2026-07-30T07:16:30.815595Z [opencon] [net.cpp:4112] [CNode] [net] Added connection peer=20
- 2026-07-30T07:16:30.819588Z [i2paccept] [i2p.cpp:418] [CreateIfNotCreatedAlready] [i2p] Creating persistent I2P SAM session 570dd11089 with 127.0.0.1:1
- 2026-07-30T07:16:30.819634Z [i2paccept] [netbase.cpp:584] [LogConnectFailure] connect() to 127.0.0.1:1 failed after wait: Connection refused (111)
- 2026-07-30T07:16:30.819663Z [i2paccept] [i2p.cpp:152] [Listen] [error] Couldn't listen: Cannot connect to 127.0.0.1:1
- 2026-07-30T07:16:30.823560Z [msghand] [net.cpp:4180] [PushMessage] [net] sending version (114 bytes) peer=20
- 2026-07-30T07:16:30.823594Z [msghand] [net_processing.cpp:1692] [PushNodeVersion] [net] send version message: version=70017, blocks=200, txrelay=0, peer=20
- 2026-07-30T07:16:30.876367Z [msghand] [net_processing.cpp:3809] [ProcessMessage] [net] received: version (111 bytes) peer=20
- 2026-07-30T07:16:30.876392Z [msghand] [net_processing.cpp:3928] [ProcessMessage] [net] receive version message: /python-p2p-tester:0.0.3/: version 70017, blocks=-1, us=0.0.0.0:0, txrelay=0, peer=20
- 2026-07-30T07:16:30.876397Z [msghand] [net.cpp:4180] [PushMessage] [net] sending wtxidrelay (0 bytes) peer=20
- 2026-07-30T07:16:30.876422Z [msghand] [net.cpp:4180] [PushMessage] [net] sending sendaddrv2 (0 bytes) peer=20
- 2026-07-30T07:16:30.876435Z [msghand] [net.cpp:4180] [PushMessage] [net] sending verack (0 bytes) peer=20
- 2026-07-30T07:16:30.876454Z [msghand] [addrman.cpp:657] [Good_] [addrman] Moved [50::1]:8333 to tried[171][20]
- 2026-07-30T07:16:30.876459Z [msghand] [node/timeoffsets.cpp:31] [Add] [net] Added time offset +0s, total samples 11
- 2026-07-30T07:16:30.876466Z [msghand] [net_processing.cpp:4043] [ProcessMessage] [net] feeler connection completed, disconnecting peer=20
- 2026-07-30T07:16:30.876538Z [net] [net.cpp:567] [CloseSocketDisconnect] [net] Resetting socket for peer=20
- 2026-07-30T07:16:30.876561Z [net] [net_processing.cpp:1848] [FinalizeNode] [net] Cleared nodestate for peer=20
Activity
fanquake commentedon Jul 30, 2026
cc @vasild @andrewtoth
151henry151 commentedon Aug 1, 2026
My brief analysis found this potentially useful information:
find_connection_type_in_debug_log()returns the firsttrying v. connection (...) to <addr>:<port>match in the whole log, so once addrman reuses an address the classification goes stale — here[50::1]:8333was picked up by[opencon] Making feeler connection, got labelledprivate-broadcastfrom an earlier attempt to the same address, and theNoRelayP2PInterfacewas attached to a feeler, which the node then dropped withfeeler connection completed, disconnecting peer=20instead of the expectedconnected in vainmessage.Taking the last match (or, more robustly, scanning only lines appended since the previous classification) might fix it.
maflcko commentedon Aug 2, 2026
Haven't looked here in detail, but is it possible to deterministically reproduce this issue somehow? E.g. with
src/addrdb.cpp: bool deterministic = HasTestOption(args, "addrman"); // use a deterministic addrman only for tests151henry151 commentedon Aug 2, 2026
Yes — I was able to reproduce this deterministically on every run (the CI hit still depends on feeler timing; this just removes that dependency).
The test already uses
-test=addrman, so I didn't need to add that; the lever was forcing a feeler to an address that had already been used for private-broadcast.From the log in the issue body:
My reading is that
find_connection_type_in_debug_log(), which decides which fake peer to attach, takes the first matching line for an address — so it picked up the 10-second-old private-broadcast line and the no-relay peer ended up on the feeler. The feeler disconnected immediately, the test's wait finished, and the expected "connected in vain" message never appeared, since no real private-broadcast peer was involved in that check. With-proxyset, private broadcast can also pick IPv4/IPv6, so it and feelers (and other automatic outbound) draw from the same clearnet pool, which makes this reuse fairly ordinary rather than a rare coincidence.The forced path: after a private-broadcast attempt to a clearnet address, wait for that address to disconnect (
addconnectionis a no-op while it's still connected), free an outbound slot by disconnecting a peer, then:That is enough to get the helper to mislabel the feeler as private-broadcast and attach the no-relay peer every time.
Reading the last matching line instead fixed it locally and still produced the real "connected in vain" disconnect, though it isn't airtight if two attempts to the same address overlap (narrower window than today, but not closed). Matching the Nth proxy request to the Nth log line for that address would be exact, as would the per-connection SOCKS5 auth token, but the latter needs the token passed into the test helper and logged next to the connection type. I can open a PR for last-match or the Nth-request pairing.
Reproduction script (throwaway)
Run with:
andrewtoth commentedon Aug 2, 2026
Thanks @151henry151 I've confirmed your reproducer causes the issue and reading the last match fixes it. I would encourage you to open a PR with the fix.
The Nth-request pairing that you suggest is more complex, and probably for little gain. But, up to you if you want to fix it that way as well.
pinheadmz commentedon Aug 12, 2026
https://github.com/bitcoin/bitcoin/actions/runs/31608186992/job/94152458843?pr=35730#step:10:3809
Merge bitcoin#35867: test: classify SOCKS5 peers via getpeerinfo addr…