Open vgonkivs opened 4 months ago
Need to think about this more but sounds good from first thought.
This will also need a new error type on the protocol that peers can lie about. One can always say ErrNotSynced
to make other peers always retry it, even when it won't have it.
If we keep retrying other peers and backoff everyone independently of ErrNotSynced this problem disappears, but then the benefits of this separation disappear as well.
After pruning is finished + backward sync is introduced, our ErrNoFound will have 2 meanings: 1) The Node is still syncing and hasn't synced to the requested height yet; 2) The node does not have this height and will not sync on it in the future;
As it will confuse us and users, we should agree and differentiate these two cases by introducing one more error for the first case ->
ErrNotSynced
.cc @renaynay