Files
tendermint/p2p
Erik Grinaker 81daaacae9 p2p: simplify PeerManager upgrade logic (#5962)
Follow-up from #5947, branched off of #5954.

This simplifies the upgrade logic by adding explicit eviction requests, which can also be useful for other use-cases (e.g. if we need to ban a peer that's misbehaving). Changes:

* Add `evict` map which queues up peers to explicitly evict.
* `upgrading` now only tracks peers that we're upgrading via dialing (`DialNext` → `Dialed`/`DialFailed`).
* `Dialed` will unmark `upgrading`, and queue `evict` if still beyond capacity.
* `Accepted` will pick a random lower-scored peer to upgrade to, if appropriate, and doesn't care about `upgrading` (the dial will fail later, since it's already connected).
* `EvictNext` will return a peer scheduled in `evict` if any, otherwise if beyond capacity just evict the lowest-scored peer.

This limits all of the `upgrading` logic to `DialNext`, `Dialed`, and `DialFailed`, making it much simplier, and it should generally do the right thing in all cases I can think of.
2021-01-25 17:51:14 +00: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-21 14:18:27 +00:00
2021-01-04 11:25:20 +01: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