While testing #20018, I noticed that we sometimes make an AddrFetch connection to a node a DNS seed resolves to (if we have a -proxy set), but then disconnect them because we don't like their services. The same could happen for a manually added -seednode.
However, we only want addresses from these peers, which are not related to any of the current service flags, so I don't see a point in aborting an AddrFetch attempt due to undesirable services.
p2p: Don't require services from `ADDR_FETCH` peers #26343
pull mzumsande wants to merge 1 commits into bitcoin:master from mzumsande:202210_addrfetch_servicebits changing 1 files +1 −1-
mzumsande commented at 7:35 PM on October 19, 2022: contributor
-
b39f471f8f
p2p: Don't require services from AddrFetch peers
We only want a GETADDR response from them, which is not related to any of the current service flags, so there is no point in disconnecting them for undesirable services.
- DrahtBot added the label P2P on Oct 19, 2022
-
DrahtBot commented at 9:50 PM on October 19, 2022: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
No conflicts as of last run.
-
dergoegge commented at 12:11 PM on October 20, 2022: member
However, we only want addresses from these peers, which are not related to any of the current service flags, so I don't see a point in aborting an AddrFetch attempt due to undesirable services.
MayHaveUsefulAddressDBmakes me think we that we are assuming nodes signalingNODE_NETWORKorNODE_NETWORK_LIMITEDto have a useful addr db. -
mzumsande commented at 6:34 PM on October 20, 2022: contributor
MayHaveUsefulAddressDBmakes me think we that we are assuming nodes signalingNODE_NETWORKorNODE_NETWORK_LIMITEDto have a useful addr db.Interesting! I guess we could leave
ExpectServicesFromConnas is but check forMayHaveUsefulAddressDB()instead ofHasAllDesirableServiceFlags()for an AddrFetch connections when deciding whether to accept the peer.However, I'm not sure this would be ideal, for the following reasons:
MayHaveUsefulAddressDBis used to decide whether we want to connect to a feeler, and whether to process a received addr at all. In neither of these situations we particularly care about the peer's address db (we don't even request addrs from feelers), we care whether it is a (pruned or not) full node, so the function might better be namedIsFullNode().MayHaveUsefulAddressDBjust makes the assumption that SPV clients don't know about address relay when they can't serve blocks - that may be the case for most current software, but I don't see why a SPV node shouldn't implement addr relay.- When we do an AddrFetch connection, we usually don't have a bunch of alternative addrs (otherwise there would be no need to make such a connection in the first place) - we either manually specified this peer (
-seednode), it's a peer a DNS seed resolves to, or (if #26114 makes it in) it's a fixed seed. When we do make an AddrFetch connection and the peer doesn't deliver addrs, we disconnect them after a few minutes. So I can't see the hurt in trying, even if the service bits don't match, if we don't have a better alternative.
-
mzumsande commented at 8:04 PM on April 3, 2023: contributor
closing, there doesn't seem to be much interest and even though I still think it could make sense, it's certainly not critical.
- mzumsande closed this on Apr 3, 2023
- bitcoin locked this on Apr 2, 2024