feat(wire): don't fetch peers from DNS on startup if we have enough#793
Conversation
|
I think it also makes sense to retry DNS requests if not fn maybe_ask_for_dns_peers(&mut self) {
if self.config.disable_dns_seeds {
return;
}
if !self.peers.is_empty() { // One peer is not enough
return;
}
// ... |
|
We can do this now |
0f5a37f to
2e2d60d
Compare
|
@JoseSK999 done |
Davidson-Souza
left a comment
There was a problem hiding this comment.
Where you say peers in address_man I think addresses make more sense. Peer is someone we are connected to
|
@Davidson-Souza those peer count values are just placeholders. Do you have any thoughts on them? |
2e2d60d to
16b2ab6
Compare
|
I think it would be useful to also decrease |
7791c36 to
e74ac48
Compare
e74ac48 to
4accae1
Compare
|
I actually think we shouldn't have |
018b3b6 to
f1a0ce9
Compare
f1a0ce9 to
1905cb1
Compare
…`AddressMan` - `get_addresses_by_service` will return all known addresses known by the `AddressMan`, filtered by `ServiceFlags`. - `enough_addresses` will return whether the `AddressMan` knows about anough addresses for regular node operation
0198e73 to
06baded
Compare
… populated - Skip fetching new addresses from DNS seeds if the `AddressMan` is well populated. - Rename `maybe_ask_for_dns_peers` to `maybe_ask_dns_seed_for_addresses`. - Reduce the interval for DNS address fetching from 5 to 2 minutes.
06baded to
c34c500
Compare
|
ACK c34c500 |
In getfloresta#793 we reduced the `DNS_SEED_REQUEST_INTERVAL` to two minutes. This tells how long do we wait before re-doing a request do the DNS seeds. The goal was to make sure we had enough peers to keep going. However, it doesn't seem like it worked as intended since DNS servers are currently bad at giving utreexo peers (and on signet they are also bad at giving CBS peers). This forces our node to retry DNS requests every two minutes. But since most users don't have their own recursive resolver (I don't), the previous result is almost always cached, so you get basically the same answer several times. This pollutes stdout for no good reason. Since getfloresta#781 we now are super aggressive about asking for addresses and checking whether they are alive and learning about their capabilities and getfloresta#865 will make it even better, since we can try several feeler connections at the same time. So I think DNS seeds should be only used to get us some starting peers, and then we build our local network view from the P2P net ourselves.
In getfloresta#793 we reduced the `DNS_SEED_REQUEST_INTERVAL` to two minutes. This tells how long do we wait before re-doing a request do the DNS seeds. The goal was to make sure we had enough peers to keep going. However, it doesn't seem like it worked as intended since DNS servers are currently bad at giving utreexo peers (and on signet they are also bad at giving CBS peers). This forces our node to retry DNS requests every two minutes. But since most users don't have their own recursive resolver (I don't), the previous result is almost always cached, so you get basically the same answer several times. This pollutes stdout for no good reason. Since getfloresta#781 we now are super aggressive about asking for addresses and checking whether they are alive and learning about their capabilities and getfloresta#865 will make it even better, since we can try several feeler connections at the same time. So I think DNS seeds should be only used to get us some starting peers, and then we build our local network view from the P2P net ourselves.
In getfloresta#793 we reduced the `DNS_SEED_REQUEST_INTERVAL` to two minutes. This tells how long do we wait before re-doing a request do the DNS seeds. The goal was to make sure we had enough peers to keep going. However, it doesn't seem like it worked as intended since DNS servers are currently bad at giving utreexo peers (and on signet they are also bad at giving CBS peers). This forces our node to retry DNS requests every two minutes. But since most users don't have their own recursive resolver (I don't), the previous result is almost always cached, so you get basically the same answer several times. This pollutes stdout for no good reason. Since getfloresta#781 we now are super aggressive about asking for addresses and checking whether they are alive and learning about their capabilities and getfloresta#865 will make it even better, since we can try several feeler connections at the same time. So I think DNS seeds should be only used to get us some starting peers, and then we build our local network view from the P2P net ourselves.
In getfloresta#793 we reduced the `DNS_SEED_REQUEST_INTERVAL` to two minutes. This tells how long do we wait before re-doing a request do the DNS seeds. The goal was to make sure we had enough peers to keep going. However, it doesn't seem like it worked as intended since DNS servers are currently bad at giving utreexo peers (and on signet they are also bad at giving CBS peers). This forces our node to retry DNS requests every two minutes. But since most users don't have their own recursive resolver (I don't), the previous result is almost always cached, so you get basically the same answer several times. This pollutes stdout for no good reason. Since getfloresta#781 we now are super aggressive about asking for addresses and checking whether they are alive and learning about their capabilities and getfloresta#865 will make it even better, since we can try several feeler connections at the same time. So I think DNS seeds should be only used to get us some starting peers, and then we build our local network view from the P2P net ourselves.
0ceeb59 chore(wire): increase the dns seed grace period time (Davidson Souza) Pull request description: ### Description and Notes In #793 we reduced the `DNS_SEED_REQUEST_INTERVAL` to two minutes. This tells how long do we wait before re-doing a request do the DNS seeds. The goal was to make sure we had enough peers to keep going. However, it doesn't seem like it worked as intended since DNS servers are currently bad at giving utreexo peers (and on signet they are also bad at giving CBS peers). This forces our node to retry DNS requests every two minutes. But since most users don't have their own recursive resolver (I don't), the previous result is almost always cached, so you get basically the same answer several times. This pollutes stdout for no good reason. Since #781 we now are super aggressive about asking for addresses and checking whether they are alive and learning about their capabilities and #865 will make it even better, since we can try several feeler connections at the same time. So I think DNS seeds should be only used to get us some starting peers, and then we build our local network view from the P2P net ourselves. ACKs for top commit: luisschwab: ACK 0ceeb59 JoseSK999: ACK 0ceeb59 Tree-SHA512: a3529e147ca18ba18eab7b59918b17521a70addf9de7c37750612e58b6aea9f3173869672454126f516b2e38bd3d7f597d5e3731b850d2b86201982b8e14eae7
Closes #784.
This PR adds some logic to skip fetching peers from DNS if we have enough in the
AddressMan. The actual values are still up for discussion.I'll rebase once #790 is merged.