Skip to content

Commit

Permalink
Fix edge case where state sync is not triggered (paritytech#5635)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
3 people authored Sep 10, 2024
1 parent 7c90f51 commit 8236718
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 66 deletions.
13 changes: 13 additions & 0 deletions prdoc/pr_5635.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
title: Fix edge case where state sync is not triggered

doc:
- audience: Node Dev
description: |
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 patch addresses it by storing the pending attempt and trying to start the state sync later when the conditions
are satisfied.

crates:
- name: sc-network-sync
bump: patch
Loading

0 comments on commit 8236718

Please sign in to comment.