Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p2p: new dial scheduler #20592

Merged
merged 18 commits into from
Feb 13, 2020
Merged

p2p: new dial scheduler #20592

merged 18 commits into from
Feb 13, 2020

Commits on Jan 24, 2020

  1. p2p: new dial scheduler

    This change replaces the peer-to-peer dial scheduler with a new and
    improved implementation. The new code is better than the previous
    implementation in two key aspects:
    
    - The time between discovery of a node and dialing that node is
      significantly lower in the new version. The old dialState kept
      a buffer of nodes and launched a task to refill it whenever the buffer
      became empty. This worked well with the discovery interface we used to
      have, but doesn't really work with the new iterator-based discovery
      API.
    
    - Selection of static dial candidates (created by Server.AddPeer or
      through static-nodes.json) performs much better for large amounts of
      static peers. Connections to static nodes are now limited like dynanic
      dials and can no longer overstep MaxPeers or the dial ratio.
    fjl committed Jan 24, 2020
    Configuration menu
    Copy the full SHA
    0c3cd1a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    613ef8d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    59556bd View commit details
    Browse the repository at this point in the history
  4. p2p: remove peersetCh

    fjl committed Jan 24, 2020
    Configuration menu
    Copy the full SHA
    74208c5 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    53005af View commit details
    Browse the repository at this point in the history

Commits on Jan 28, 2020

  1. Configuration menu
    Copy the full SHA
    c55a42e View commit details
    Browse the repository at this point in the history
  2. p2p: remove blank line

    fjl committed Jan 28, 2020
    Configuration menu
    Copy the full SHA
    105ff6f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3c49d09 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6353685 View commit details
    Browse the repository at this point in the history
  5. p2p: improve dialTask docs

    Also increase log level for "Can't resolve node"
    fjl committed Jan 28, 2020
    Configuration menu
    Copy the full SHA
    8cefa07 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    323d2f5 View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2020

  1. Configuration menu
    Copy the full SHA
    28d1085 View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2020

  1. Configuration menu
    Copy the full SHA
    463842c View commit details
    Browse the repository at this point in the history
  2. p2p: fix maxDialedConns for maxpeers < dialRatio

    Always allocate at least one dial slot unless dialing is disabled using
    NoDial or MaxPeers == 0. Most importantly, this fixes MaxPeers == 1 to
    dedicate the sole slot to dialing instead of listening.
    fjl committed Feb 9, 2020
    Configuration menu
    Copy the full SHA
    af30b4d View commit details
    Browse the repository at this point in the history
  3. p2p: fix RemovePeer to disconnect the peer again

    Also make RemovePeer synchronous and add a test.
    fjl committed Feb 9, 2020
    Configuration menu
    Copy the full SHA
    92e1a62 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    325de0c View commit details
    Browse the repository at this point in the history
  5. p2p: clean up connection logging

    We previously logged outgoing connection failures up to three times.
    
    - in SetupConn() as "Setting up connection failed addr=..."
    - in setupConn() with an error-specific message and "id=... addr=..."
    - in dial() as "Dial error task=..."
    
    This commit ensures a single log message is emitted per failure and adds
    "id=... addr=... conn=..." everywhere (id= omitted when the ID isn't
    known yet).
    
    Also avoid printing a log message when a static dial fails but can't be
    resolved because discv4 is disabled. The light client hit this case all
    the time, increasing the message count to four lines per failed
    connection.
    fjl committed Feb 9, 2020
    Configuration menu
    Copy the full SHA
    df6ae09 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    a132830 View commit details
    Browse the repository at this point in the history