Files
tendermint/p2p
Erik Grinaker 96215a06ed p2p: add prototype peer lifecycle manager (#5882)
This adds a prototype peer lifecycle manager, `peerManager`, which stores peer data in an internal `peerStore`. The overall idea here is to have methods for peer lifecycle events which exchange a very narrow subset of peer data, and to keep all of the peer metadata (i.e. the `peerInfo` struct) internal, to decouple this from the router and simplify concurrency control. See `peerManager` GoDoc for more information.

The router is still responsible for actually dialing and accepting peer connections, and routing messages across them, but the peer manager is responsible for determining which peers to dial next, preventing multiple connections being established for the same peer (e.g. both inbound and outbound), and making sure we don't dial the same peer several times in parallel. Later it will also track retries and exponential backoff, as well as peer and address quality. It also assumes responsibility for peer updates subscriptions.

It's a bit unclear to me whether we want the peer manager to take on the responsibility of actually dialing and accepting connections as well, or if it should only be tracking peer state for the router while the router is responsible for all transport concerns. Let's revisit this later.
2021-01-18 19:56:13 +01:00
..
2021-01-04 11:25:20 +01:00
2021-01-04 11:25:20 +01:00
2020-10-13 10:22:53 +02:00
2021-01-08 15:32:11 +00:00
2021-01-04 11:25:20 +01:00
2021-01-06 11:53:18 -05:00
2021-01-06 11:53:18 -05:00
2021-01-06 11:53:18 -05:00
2021-01-04 11:25:20 +01:00
2021-01-04 11:25:20 +01:00
2021-01-08 15:32:11 +00:00
2020-02-07 12:53:28 +01:00
2021-01-06 11:53:18 -05:00
2021-01-06 11:53:18 -05:00
2021-01-04 11:25:20 +01:00
2021-01-08 15:32:11 +00:00

p2p

The p2p package provides an abstraction around peer-to-peer communication.

Docs:

  • Connection for details on how connections and multiplexing work
  • Peer for details on peer ID, handshakes, and peer exchange
  • Node for details about different types of nodes and how they should work
  • Pex for details on peer discovery and exchange
  • Config for details on some config option