This:
- Documents BIP155 support in doc/bips.md
- Restricts addrv2 relay to IPv4, IPv6, and Tor addresses. Relaying addresses in ranges that no network software has support for seems like a gratuitous spam vector.
This:
36@@ -37,7 +37,8 @@ BIPs that are implemented by Bitcoin Core (up-to-date up to **v0.21.0**):
37 * [`BIP 145`](https://github.com/bitcoin/bips/blob/master/bip-0145.mediawiki): getblocktemplate updates for Segregated Witness as of **v0.13.0** ([PR 8149](https://github.com/bitcoin/bitcoin/pull/8149)).
38 * [`BIP 147`](https://github.com/bitcoin/bips/blob/master/bip-0147.mediawiki): NULLDUMMY softfork as of **v0.13.1** ([PR 8636](https://github.com/bitcoin/bitcoin/pull/8636) and [PR 8937](https://github.com/bitcoin/bitcoin/pull/8937)), *buried* since **v0.19.0** ([PR #16060](https://github.com/bitcoin/bitcoin/pull/16060)).
39 * [`BIP 152`](https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki): Compact block transfer and related optimizations are used as of **v0.13.0** ([PR 8068](https://github.com/bitcoin/bitcoin/pull/8068)).
40-- [`BIP 158`](https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki): Compact Block Filters for Light Clients can be indexed as of **v0.19.0** ([PR #14121](https://github.com/bitcoin/bitcoin/pull/14121)).
41+* [`BIP 155`](https://github.com/bitcoin/bips/blob/master/bip-0155.mediawiki): The 'addrv2' and 'sendaddrv2' messages which enable relay of Tor V3 addresses and more are supported as of **v0.21.0** ([PR 19845](https://github.com/bitcoin/bitcoin/pull/19845)).
[PR 19954](https://github.com/bitcoin/bitcoin/pull/19954)
(or maybe 19031)
Concept ACK.
I wondered a little why the additional “should we relay this address?” logic is in RelayAddress()
instead in the caller along with the existing logic. (Edit: domain separation and/or more elegant code, I suppose. It’s certainly not a blocker.)
src/net_processing.cpp::L2660
0 bool fReachable = IsReachable(addr);
1 if (addr.nTime > nSince && !pfrom.fGetAddr && vAddr.size() <= 10 && addr.IsRoutable())
2 {
3 // Relay to a limited number of other nodes
4 RelayAddress(addr, fReachable, m_connman);
5 }
(post merge) ACK 56f9dba01
This patch achieves the same as the one at the bottom of #19954 (comment) and in addition the patch in this PR will relay I2P addresses if they become reachable in the future without needing an adjustment.
Given that the newly added function IsRelayable()
deals with a higher level logic of whether to relay or not, maybe it would be better if it lives somewhere in net_processing.cc
, next to RelayAddress()
instead of as a method of the lower level CNetAddr
class. But it works anyway and can be adjusted further if needed.
Thanks!