Splitting more block, addr and tx classes of network traffic

38 views
Skip to first unread message

Antoine Riard

unread,
Dec 4, 2025, 6:16:52 PM (2 days ago) Dec 4
to Bitcoin Development Mailing List
Hi list,

Surfacing an old idea concerning the network-level and the current meddling of block,
tx and addr messages traffic generally all over one network link. Historically, for
example, if you consider bitcoin core by default connections are going to be FULL_RELAY.
Over the last years, there has been few improvements to separate network links by types
e.g with the introduction of dedicated outbound BLOCK-RELAY connections [1], without the
segregation at the network-level between the class of traffic really being pursued, or at
least more flexibility in network mechanisms to signal to a node's peers what categories
of messages will be processed on a given link.

Previously it has been shown that leveraging tx-relay's orphan mechanism can allow to map
a peer's network-topology [2] (sadly, one trick among others). Being able to infer a peer's
"likely" network topology from tx traffic, one can guess the peers used to carry block-relay
traffic. From the PoV of an economical node, dissimulating the block-relay traffic is a very
valuable to minimize the risks of escalation attacks based on network-topology (e.g for
lightning nodes [3]).

Segregating more network traffic by class of messages sounds to suppose 1) being able to signal
among the {ADDR, ADDRV2} service bits if block, addr or tx relay is supported on a link to be
opened for a pair of a (net_addr, port) or alternatively 2) if network link are open blindly
with peers, being to signal in the VERSION message or with a dedicated message what class of
message is supported. There is already a signaling mechanism in the VERSION message to
disable tx-relay (i.e `fRelay`), however there is no signaling to disable block-relay over a link.
Alternatively, it has been proposed in the past to add a new early message among all the other
handshake messages between the VERSION / VERACK flow, but it has never been implemented [4].

For bitcoin backbone, started to natively isolate each class of traffic in its own process, and
only strictly signaling what is needed in the VERSION message. Though, I'm starting to reach
the limit of the current network mechanisms, e.g I've an `archive_relayd` process to service "cold"
blocks, dissociate from the process doing full block-relay traffic, and this process is emitting versions
messages, with the NODE_NETWORK bit set and the others process would have
NODE_NETWORK_LIMITED. If you're asking the why of dissociating "cold" from "hot" block relay
servicing, that avoids wasting CPU cycles on a busy code path.

Anyway, for now I think I can come up with good hacks with the service field and experimental bit
services. One drawback, it's just one "logical" node might start to occupy multiple "physical" sockets
of its peers (one for tx-relay, one for block-relay), but network-wide this might not be the most
ressource-preserving approach, so I'm wondering if better mechanisms are worthy to muse about.

Cheers,
Antoine
OTS hash: 22f8cfbd2b1fd093f6bb8737f3ddcdb956f8dadb1b9436dab3c8491e4b5583fd

[0] https://github.com/bitcoin/bitcoin/blob/master/src/node/connection_types.h
[1] https://github.com/bitcoin/bitcoin/pull/15759
[2] https://discovery.ucl.ac.uk/id/eprint/10063352/1/txprobe_final.pdf
[3] https://arxiv.org/pdf/2006.01418
[4] https://github.com/bitcoin/bips/blob/master/bip-0338.mediawiki
Reply all
Reply to author
Forward
0 new messages