-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Labels
featureNew feature or requestNew feature or request
Description
🚀 Feature
We need a few more pieced in order to tackle: #3580
Clients should make sure that they're communicating with the most advanced peers in order to always sync with the network.
Could we do something like the following, without breaking too many abstractions:
- We track a
last_height_seen
metric for each peer we connected to. - Whenever we save to disk, attempt to order the peers not just by reputation but also by the optional last seen height.
- Whenever we submit a
PeerResponse
infn peer_request
, attempt to order the peers by reputation and by the optional last seen height. Whenever we receive aPeerResponse
, insert in thepeer_pool
sorted by optionallast_height_seen
, so that when we fetchcandidate_peers
we choose:
a.num_deficient - 1
peers which have the highest last seen height (assuming honest reporting)
b. 1 peer randomly from the rest of the set (in order to protect against dishonest reporting)
kaimast
Metadata
Metadata
Assignees
Labels
featureNew feature or requestNew feature or request