feat(state-sync): show download/apply parts progress in sync status#15391
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #15391 +/- ##
==========================================
- Coverage 69.02% 69.00% -0.02%
==========================================
Files 934 934
Lines 209214 209222 +8
Branches 209214 209222 +8
==========================================
- Hits 144405 144372 -33
- Misses 58823 58862 +39
- Partials 5986 5988 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds per-part progress reporting to shard state sync statuses so RPC status output can show incremental progress (e.g. apply in progress (42/100)) during long-running state part download/apply phases.
Changes:
- Extend
ShardSyncStatusvariants for “download parts” and “apply in progress” to carry{ done, total }. - Update state sync shard logic to incrementally update the status as parts finish downloading/applying.
- Update metrics reporting to use
ShardSyncStatus::repr()instead of casting the enum.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
chain/client/src/sync/state/shard.rs |
Tracks and publishes per-part progress while downloading and applying state parts. |
chain/client/src/sync/state/mod.rs |
Updates shard sync stage metric emission to use repr() for the now-data-carrying enum. |
chain/client-primitives/src/types.rs |
Extends ShardSyncStatus to include progress counters and renders them into the RPC-facing string. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| metrics::STATE_SYNC_STAGE | ||
| .with_label_values(&[&shard_id.to_string()]) | ||
| .set(status as i64); | ||
| .set(status.repr() as i64); |
There was a problem hiding this comment.
I just hope we are not grouping by this metric somewhere in grafana
There was a problem hiding this comment.
I guess we are actually, but the call to repr here returns the expected 0, 1, 2, 3, value
Add per-part progress to the
StateDownloadPartsandStateApplyInProgresssync status so that the RPC status endpoint shows e.g."apply in progress (42/100)"instead of just"apply in progress". This makes it easier to monitor state sync progress during the (often slow) apply phase.