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

Fix #787: Connectivity fixes #792

Merged
merged 4 commits into from
May 27, 2019
Merged

Fix #787: Connectivity fixes #792

merged 4 commits into from
May 27, 2019

Commits on May 27, 2019

  1. Fix #787: Connectivity fixes

    Currently, unless doing Join() (--bootstrap), we do not connect to any peers on startup.
    
    We however loaded up the peerstore file and Raft will automatically connect
    older peers to figure out who is the leader etc. DHT bootstrap, after Raft
    was working, did the rest.
    
    For CRDTs we need to connect to people on a normal boot as otherwise, unless
    bootstrapping, this does not happen, even if the peerstore contains known peers.
    
    This introduces a number of changes:
    
    * Move peerstore file management back inside the Cluster component, which was
    already in charge of saving the peerstore file.
    * We keep saving all "known addresses" but we load them with a non permanent
    TTL, so that there will be clean up of peers we're not connected to for long.
    * "Bootstrap" (connect) to a small number of peers during Cluster component creation.
    * Bootstrap the DHT asap after this, so that other cluster components can
    initialize with a working peer discovery mechanism.
    * CRDT Trust() method will now:
      * Protect the trusted Peer ID in the conn manager
      * Give top priority in the PeerManager to that Peer (see below)
      * Mark addresses as permanent in the Peerstore
    
    The PeerManager now attaches priorities to peers when importing them and is
    able to order them according to that priority. The result is that peers with
    high priority are saved first in the peerstore file. When we load the peerstore
    file, the first entries in it are given the highest priority.
    
    This means that during startup we will connect to "trusted peers" first
    (because they have been tagged with priority in the previous run and saved at
    the top of the list). Once connected to a small number of peers, we let the
    DHT bootstrap process in the background do the rest and discover the network.
    
    All this makes the peerstore file a "bootstrap" list for CRDTs and we will attempt
    to connect to peers on that list until some of those connections succeed.
    hsanjuan committed May 27, 2019
    Configuration menu
    Copy the full SHA
    196aa23 View commit details
    Browse the repository at this point in the history
  2. Fix: ipfsproxy: fix test failing with empty multiaddresses

    This is a recent change in the multiaddress library to disallow
    empty addresses.
    hsanjuan committed May 27, 2019
    Configuration menu
    Copy the full SHA
    99be078 View commit details
    Browse the repository at this point in the history
  3. CRDT: Fix protecting of nodes before loading the peerstore

    Addresses comments from review #792
    hsanjuan committed May 27, 2019
    Configuration menu
    Copy the full SHA
    2a2f8c0 View commit details
    Browse the repository at this point in the history
  4. Fix: sharness: do not use latest master

    latest master breaks (see #797)
    hsanjuan committed May 27, 2019
    Configuration menu
    Copy the full SHA
    d5cef9d View commit details
    Browse the repository at this point in the history