nakamoto icon indicating copy to clipboard operation
nakamoto copied to clipboard

Prefer low-latency peers

Open cloudhead opened this issue 4 years ago • 0 comments

Currently, peer latency is measured in the PingManager, but not used.

  • We should keep track of latencies, persist them (either in the client::peer::Cache or some where else.
  • Use it to decide which peers to connect to
  • Use it to decide which peers to download headers/blocks from

Some notes:

  • We should generally not compromise geo-diveristy when looking for low-latency peers, but having a few low-latency peers is desired
  • Low-latency peer selection can either be via AddressManager::sample being biased towards low-latency peers, or by simply calling sample 2-3 times and picking the peer with the lowest latency.

cloudhead avatar Jan 23 '21 23:01 cloudhead