Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Get the correct number of connected peers in SyncState #13700

Merged
merged 1 commit into from Mar 24, 2023

Conversation

altonen
Copy link
Contributor

@altonen altonen commented Mar 23, 2023

Protocol is not a reliable source for the information of connected peers because it does't have real-time information about the real connectivity state.

The way to address this properly would be to refactor SyncingEngine and ChainSync, remove duplicate peer counting and return a unified SyncState but I haven't found time for that refactoring yet, hopefully soon.

`Protocol` is not a reliable source for the information of connected
peers because it doesn't have real-time information of the actual
connectivity state because it's not resposible for accepting/rejecting
connections and gets that information with delay from `SyncinEngine`.
@altonen altonen added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit labels Mar 23, 2023
@altonen altonen requested a review from a team March 23, 2023 18:25
Copy link
Contributor

@melekes melekes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@bkchr bkchr merged commit 5766265 into master Mar 24, 2023
15 checks passed
@bkchr bkchr deleted the fix-incorrect-peer-count branch March 24, 2023 23:47
coderobe pushed a commit that referenced this pull request Apr 4, 2023
`Protocol` is not a reliable source for the information of connected
peers because it doesn't have real-time information of the actual
connectivity state because it's not resposible for accepting/rejecting
connections and gets that information with delay from `SyncinEngine`.
nathanwhit pushed a commit to nathanwhit/substrate that referenced this pull request Jul 19, 2023
…13700)

`Protocol` is not a reliable source for the information of connected
peers because it doesn't have real-time information of the actual
connectivity state because it's not resposible for accepting/rejecting
connections and gets that information with delay from `SyncinEngine`.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit
Projects
Status: Done
Status: done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants