Fixed sync target detection#11817
Conversation
|
I also forgot #11705 exists. From sync POV all blocks added to the import queue are considered to be "synced". If there's a error with a block import at later stage, the sync process is reset. So I think using |
|
related issue: paritytech/polkadot#5771 |
…best-block-metric
| .peers | ||
| .values() | ||
| .filter_map(|p| { | ||
| if p.best_number > self.best_queued_number { |
There was a problem hiding this comment.
Doesn't this again gives another node the possibility to force you into major sync mode?
We should move this to the end of the function and do a max() with between the best number and the selected number in the range.
There was a problem hiding this comment.
Or rather return None if the median is in the past.
|
bot merge |
|
This PR cannot be merged at the moment due to: 5 of 12 required status checks are expected. processbot expects that the problem will be solved automatically later and so the auto-merge process will be started. You can simply wait for now. |
|
|
…best-block-metric
|
bot merge |
|
Waiting for commit status. |
* Fixed sync target detection * Always report sync_target metric * Clamp median across all peers
* Fixed sync target detection * Always report sync_target metric * Clamp median across all peers
This fixes sync target detection. With the current mean selection method it is possible for this function to return a block that's lower than our best block. This PR changes the mean selection to only consider peers that are ahead.
See #11547
Fixes https://github.com/paritytech/devops/issues/1767