nakamoto
nakamoto copied to clipboard
Prefer low-latency peers
Currently, peer latency is measured in the PingManager, but not used.
- We should keep track of latencies, persist them (either in the
client::peer::Cacheor 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::samplebeing biased towards low-latency peers, or by simply callingsample2-3 times and picking the peer with the lowest latency.