-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
find_node: Optimize parallelism factor for slow to respond peers (#220)
This PR introduces a `peer_timeout` to the `FIND_NODE` queries. - Queries make at most 3 (alpha / parallelism factor) request in parallel - Introduce a `peer_timeout` after which the pending request doesn't count towards the parallelism factor This prevents the query from getting stuck when a peer is slow or fails to respond within due time. The peer can still produce the response at a later time. Since most queries rely on the same primitives (candidates, pending, responses), we can abstract and adopt a shared wrapper for all queries. This would make the same feature available to the other queries, keeping the code simple and reusing the core functionality. However, that can come at a later time. cc @paritytech/networking --------- Signed-off-by: Alexandru Vasile <[email protected]>
- Loading branch information
Showing
1 changed file
with
102 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters