Fix edge case where state sync is not triggered#5635
Merged
dmitry-markin merged 6 commits intoparitytech:masterfrom Sep 10, 2024
Merged
Fix edge case where state sync is not triggered#5635dmitry-markin merged 6 commits intoparitytech:masterfrom
dmitry-markin merged 6 commits intoparitytech:masterfrom
Conversation
Pure refactoring, zero logical changes.
cbaa95b to
ddfcf2d
Compare
There is an edge case where the finalized block notification is received, but the conditions required to initiate the state sync are not fully met. In such cases, state sync would fail to start as expected and remain stalled. This fixes it by storing the pending attempt and trying to start it later.
ddfcf2d to
3672c34
Compare
dmitry-markin
approved these changes
Sep 9, 2024
Contributor
dmitry-markin
left a comment
There was a problem hiding this comment.
Nicely done, thank you!
Co-authored-by: Dmitry Markin <dmitry@markin.tech>
bkchr
approved these changes
Sep 10, 2024
auto-merge was automatically disabled
September 10, 2024 08:11
Head branch was pushed to by a user without write access
Contributor
Author
|
@bkchr Please click the button again, fmt wasn't good in the applied suggestion :( |
nazar-pc
pushed a commit
to autonomys/polkadot-sdk
that referenced
this pull request
Sep 27, 2024
This PR addresses an issue where state sync may fail to start if the conditions required for its initiation are not met when a finalized block notification is received. `pending_state_sync_attempt` is introduced to trigger the state sync later when the conditions are satisfied. This issue was spotted when I worked on paritytech#5406, specifically, `queue_blocks` was not empty when the finalized block notification was received, and then the state sync was stalled. cc @dmitry-markin --------- Co-authored-by: Dmitry Markin <dmitry@markin.tech> Co-authored-by: Bastian Köcher <git@kchr.de> (cherry picked from commit 8236718)
1 task
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses an issue where state sync may fail to start if the conditions required for its initiation are not met when a finalized block notification is received.
pending_state_sync_attemptis introduced to trigger the state sync later when the conditions are satisfied.This issue was spotted when I worked on #5406, specifically,
queue_blockswas not empty when the finalized block notification was received, and then the state sync was stalled. cc @dmitry-markin