Skip to content

Latest commit

 

History

History

peer-discovery

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Peer Discovery Research

Peer Discovery Mechanisms

Substrate

Substrate's Network Layer (post by tomaka)

Currently, nodes join the peer-to-peer network using bootstrap nodes (addresses are hardcoded in the chainspec).

  • vulnerable to man-in-the-middle attacks
  • useful for development purposes (because of simple testing and setup)

Each node maintains a topology consistsing of the set of nodes that are known to be part of the network. Each topology is cached on the local disk and loaded upon startup.

Every node tracks the reputation of its peers locally according to iterative Kademlia queries on random node IDs. See current reputation algorithm here.

There are a few problems with Kademlia in the context of Substrate:

  • network control centralizes in very few (maybe 20) nodes
    • The libp2p Kademlia system has a two additional messages, ADD_PROVIDER and GET_PROVIDER, which entail querying the peers closest to a key (in this case, the hash of the chain identifier) to store the topology.
  • bootstrap nodes can only connect to a limited number of other nodes
    • A freshly-created node with an empty topology needs to be able to connect to boostrap nodes; otherwise it is incapable of joining the network. If all bootstrap nodes are full, such a node would be denied entry.
  • Kademlia discovery mechanism is vulnerable to Eclipse Attacks (similar to Ethereum)

Possibly two approaches to solving these problems (according to the aforementioned post in Parity forum)

  1. establish strong, trusted, durable links between nodes
    • more easy to attack, but purportedly necessary for Polkadot to function
  2. weak short-lived anonymous links based on randomness

Discovery Mechanism

The Discovery Protocol enables us to build a partial view of the network that we'll use for gossiping.

To Explore Further

  1. A discovery mechanism for the nodes of the global network.
  2. A gossiping system for nodes to notify when they want to join or leave a specific network. This lets each node build a partial view of the chains it wants to be connected to.
  3. An overlay-network-building gossiping system for each per-chain network.

More Reading