-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3594: Propagate unreliable peers upwards from the trie accumulator to the block synchronizer r=alsrdn a=alsrdn The trie accumulator uses a snapshot of the peer list provided by the block synchronizer through the global state synchronizer in order to get the required tries. Because we didn't provide the block synchronizer any feedback on what the peers that dind't have the global state data were, the block synchronizer may re-issue the global state sync request with the same peer set as for the previous failed attempt. This may lead to delays in getting the global state data. This PR adds: * the ability to propagate the unreliable peers (that didn't have the requested data) upwards to the global state synchronizer and then to the block synchronizer. This gives feedback that the original peer list provided should be changed if another global sync request is made. * block synchronizer now demotes the peers unreliable received from the global state synchronizer * a test to verify that the peer list is changed based on the feedback from the global state sync components. * slight change into how `PeerQuality` is handled when demoting and promoting peers; now peers with `Reliable` or `Unreliable` quality will not be set as `Unknown` when demoting or promoting respectively. These changes reduce the risk that the global state synchronizer gets stuck asking the same peers all over again. Further potential improvements that can be made: * Promote peers that were successful when downloading global state. We only demote the peers now. * Use a reputation based peer list (similar to the one used in the block synchronizer) in the trie accumulator rather than going through peers one by one. Fixes: #3563 Co-authored-by: Alexandru Sardan <alexandru@casperlabs.io>
- Loading branch information
Showing
13 changed files
with
584 additions
and
79 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
#[cfg(test)] | ||
mod tests; | ||
|
||
use std::{ | ||
collections::HashMap, | ||
fmt::{Display, Formatter}, | ||
|
7 changes: 7 additions & 0 deletions
7
node/src/components/block_synchronizer/block_builder/tests.rs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use super::*; | ||
|
||
impl BlockBuilder { | ||
pub(crate) fn peer_list(&self) -> &PeerList { | ||
&self.peer_list | ||
} | ||
} |
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
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
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
Oops, something went wrong.