An implementation of BIP155 addrv2 messages. To ease review it is split in a few logical changes and submitted as separate, smaller, PRs.
The current one for review is: #19954
Preparation changes
Commits:
test: add an edge case test for CSubNet(merged via #19351)net: improve encapsulation of CNetAddr(merged via #19360)net: document enum Network(merged via #19534)net: save the network type explicitly in CNetAddr(merged via #19534)
Change CNetAddr::ip to have flexible size
Commits:
net: change CNetAddr::ip to have flexible size(merged via #19628)
Implement addrv2 (un)serializing
Add support to serialize CNetAddr and CAddress in ADDRv2 format. Invoke that from CAddrMan serialization methods. Commits:
net: move HasPrefix() so it can be reused(merged via #19845)test: move HasReason() so it can be reused(merged via #19845)net: CNetAddr: add support to (un)serialize as ADDRv2(merged via #19845)net: recognize TORv3/I2P/CJDNS networks(merged via #19845)net: CAddress & CAddrMan: (un)serialize as ADDRv2(merged via #19954)
Advertise support
Advertise ADDRv2 support to peers, handle incoming ADDRv2 messages and send to peers in that format if they have advertised support. Commits:
net: advertise support for ADDRv2 via new message(merged via #19954)
All the steps to get Tor v3 support are outlined in issue#18884 Tor v3 support, this PR is one of them.
