8000 p2p/pex: `ensurePeers` should use a larger list of addresses to dial · Issue #3960 · cometbft/cometbft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
p2p/pex: ensurePeers should use a larger list of addresses to dial #3960
Open
@cason

Description

@cason

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:

  1. Render this pre-checks more comprehensive. For instance, we shouldn't dial peers configured as persistent peers.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0