Open
Description
Motivated by #3371, which however does not provide a consistent solution for the problem.
The issue is that the ensurePeers
routine of the PEX reactor is run every 30 seconds, or when we receive a list of addresses from a configured seed node.
This routine computes how many peers the node should dial to, randomly select potential addresses from the address book, then dial them in parallel. A minimal set of checks is performed on the randomly selected addresses retrieved from the address book, in order to detect addresses whose dialing will likely fail.
The proposal here can be summarized in two parts:
- Render this pre-checks more comprehensive. For instance, we shouldn't dial peers configured as persistent peers.
- Collect a larger number of potential addresses to dial from the address book. Moreover, when dialing one of the selected addresses fails, consider dialing a second ("backup") address from this list.
The goal is speed up the process of establishing connections with an enough number of peers in the p2p network.