-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not an expert in the sync code, but looks good to me
client/network/src/protocol/sync.rs
Outdated
@@ -1542,11 +1557,33 @@ impl<B: BlockT> ChainSync<B> { | |||
} | |||
|
|||
/// Call when a peer has disconnected. | |||
pub fn peer_disconnected(&mut self, who: &PeerId) { | |||
/// Canceled block request may result in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfinished comment.
No, in case of parallel requests, as soon as we download a block all other requests are made obsolete. Normally when doing major sync, we don't issue parallel requests though. Duplicate requests come from issues 1 and 2. We try to download blocks that are already queued, and while the request was active, import queue made some progress. So a call to |
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Drain blocks on peer disconnect * Finish comment * Fixed test * Update client/network/src/protocol/sync.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Drain blocks on peer disconnect * Finish comment * Fixed test * Update client/network/src/protocol/sync.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Two issues fixed here: