So your proposal is something like:
- Add new BIP155 network types TRANSV2_IPV4, TRANSV2_IPV6 (and perhaps TRANSV2_TOR_V3, etc), corresponding to existing V1 transports on those networks (with similar IP/hash encoding).
- Allow nodes to support just v1, just v2, or both if done on separate ports.
- Drop the ability to create a v2 listener that can detect inbound v1 connections on the same port.
I do agree that’s somewhat cleaner as service flags aren’t a perfect match, but using separate networks has downsides too (roughly in decreasing order of severity):
- To avoid creating a heightened partition risk between v1 and v2, I think we need to expect that most nodes support both, at least on inbound, probably for a long time. And if that is the case, the introduction of new networks means effectively a doubling of addrv2 data rumoured on the network, as well as a duplication of addrman entries (or equivalent in other implementations).
- V2 address propagation will initially be hampered by being treated as unknown network by old nodes (a bootstrapping problem every new network has).
- Requiring every node to listen on two ports if they want to support v2 also means that in some instances, upgrading needs system administrator intervention to open ports.
- Special logic is needed so that if a node knows about a peer’s IP in both V1 and V2 networks, it can prefer the V2 one.
- Anti-DOS logic would need to be special cased to treat V1 and corresponding V2 networks as the same (as clearly control over a netrange in one implies control over the same netrange in the other).
So I think that using service flags is a nice workaround for these issues, as it naturally implies the V1 and V2 “entry” to a node will be thought of as a single entity for the purpose of address relay, even to old nodes. It does mean listeners for now need auto-detection logic to be able to serve both V1 and V2 on the same port, but I think that’s mostly an implementation issue.
The way to think about the service flags is that it is a hint to try V2 connections to a node. If the service flags incorrectly contains V2, the responder will almost certainly immediately disconnect, which the initiator interprets as a “retry as V1” per BIP324. Once a connection is established, using either V1 or V2, the initiator’s knowledge of the responder’s service flags will be corrected using the VERSION message, so even if the flags incorrectly say V1, the initiator can then still decide to reconnect as V2 (and if not, they will the next time a connection is established).
So it’s just a hint, and not a disaster if it’s wrong in either direction. It’s an optimistic optimization over just not having any service flag at all, and make every V2 initiator always try V2 first and fall back to V1 on every connection. Given a very effective P2P attacker which can “or in” the V2 flag to every rumoured service flag, the service flag approach effectively becomes identical to not having the flags in the first place.