Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync status refactoring #5450

Merged
merged 8 commits into from
Aug 26, 2024

Conversation

nazar-pc
Copy link
Contributor

As I was looking at the coupling between SyncingEngine, SyncingStrategy and individual strategies I noticed a few things that were unused, redundant or awkward.

The awkward change comes from paritytech/substrate#13700 where num_connected_peers property was added to SyncStatus struct just so it can be rendered in the informer. While convenient, the property didn't really belong there and was annoyingly set to 0 in some strategies and to num_peers in others. I have replaced that with a property on SyncingService that already stored necessary information internally.

Also ExtendedPeerInfo didn't have a working Clone implementation due to lack of perfect derive in Rust and while I ended up not using it in the refactoring, I included fixed implementation for it in this PR anyway.

While these changes are not strictly necessary for #5333, they do reduce coupling of syncing engine with syncing strategy, which I thought is a good thing.

Reviewing individual commits will be the easiest as usual.

@nazar-pc
Copy link
Contributor Author

@dmitry-markin another small one for you here

Copy link
Contributor

@dmitry-markin dmitry-markin left a comment

Choose a reason for hiding this comment

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

Looks good, thanks! Just make sure we don't report light peers to the informant, please.

substrate/client/network/sync/src/engine.rs Outdated Show resolved Hide resolved
substrate/client/informant/src/lib.rs Show resolved Hide resolved
@dmitry-markin dmitry-markin added the T0-node This PR/Issue is related to the topic “node”. label Aug 23, 2024
@nazar-pc
Copy link
Contributor Author

semver check is buggy, it found changes in polkadot-statement-table that is not modified in this PR 🤔

@dmitry-markin dmitry-markin requested a review from a team August 26, 2024 10:04
@dmitry-markin
Copy link
Contributor

semver check is buggy, it found changes in polkadot-statement-table that is not modified in this PR 🤔

@alvicsam can you look into this, please, or CC a more relevant person?

@dmitry-markin
Copy link
Contributor

Tried merging master, may be this will resolve the semver issue...

@nazar-pc
Copy link
Contributor Author

Tried merging master, may be this will resolve the semver issue...

Yep, it did. It seems to detect changes not just from this PR to master, but also from master to this PR too. So unless latest master was merged in it frequently hallucinates.

Copy link
Contributor

@lexnv lexnv left a comment

Choose a reason for hiding this comment

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

Nicely done here! Thanks for the quality work and for contributing once again! 🙏

@dmitry-markin dmitry-markin added this pull request to the merge queue Aug 26, 2024
Merged via the queue into paritytech:master with commit dd1aaa4 Aug 26, 2024
188 of 190 checks passed
@nazar-pc nazar-pc deleted the sync-status-refactoring branch August 26, 2024 17:14
ordian added a commit that referenced this pull request Aug 27, 2024
* master: (36 commits)
  Bump the ci_dependencies group across 1 directory with 2 updates (#5401)
  Remove deprecated calls in cumulus-parachain-system (#5439)
  Make the PR template a default for new PRs (#5462)
  Only log the propagating transactions when they are not empty (#5424)
  [CI] Fix SemVer check base commit (#5361)
  Sync status refactoring (#5450)
  Add build options to the srtool build step (#4956)
  `MaybeConsideration` extension trait for `Consideration` (#5384)
  Skip slot before creating inherent data providers during major sync (#5344)
  Add symlinks for code of conduct and contribution guidelines (#5447)
  pallet-collator-selection: correctly register weight in `new_session` (#5430)
  Derive `Clone` on `EncodableOpaqueLeaf` (#5442)
  Moving `Find FAIL-CI` check to GHA (#5377)
  Remove panic, as proof is invalid. (#5427)
  Reactive syncing metrics (#5410)
  [bridges] Prune messages from confirmation tx body, not from the on_idle (#5006)
  Change the chain to Rococo in the parachain template Zombienet config (#5279)
  Improve the appearance of crates on `crates.io` (#5243)
  Add initial version of `pallet_revive` (#5293)
  Update OpenZeppelin template documentation (#5398)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T0-node This PR/Issue is related to the topic “node”.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants