This proposes two things:
-
Make AddrFetch connections to fixed seeds instead of just adding them to AddrMan (suggested in #25678 (comment)) When adding fixed seeds, we currently add them to AddrMan and then make regular full outbound connections to them. If many new nodes use the fixed seeds for this, it will result in them getting a lot of peers requiring IBD, which will create a lot of traffic for them. With an AddrFetch connection, we will only use them to get addresses from other peers and disconnect afterwards. This PR proposes to attempt making AddrFetch connections to 10 peers for better diversity (some may be offline anyway). The fixed seeds will still be added to Addrman as before, but only after a delay of 2 minutes, after which they will hopefully no longer be the only entries in AddrMan.
-
Move the logic of adding fixed seeds out of
ThreadOpenConnections
intoThreadDNSAddressSeed
(which is being renamed toThreadAddressSeed
). I think this makes sense in general because adding the fixed seeds is in many ways analogous to querying the DNS seeds, and ThreadOpenConnections, which is there to actually open the connections is already quite complex. Also, it makes the changes from 1) easier if we don’t have to worry about interfering with the automatic connection making logic.
One way to test this is to start without peers.dat
and run with -nodnsseed -blocksonly -debug=net
and monitor the debug log and bitcoin-cli -netinfo
behavior.