-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chainHead: Track reported blocks to capture notification gaps (#5856)
There are cases during warp sync or re-orgs, where we receive a notification with a block parent that was not reported in the past. This PR extends the tracking state to catch those cases and report a `Stop` event to the user. This PR adds a new state to the RPC-v2 chainHead to track which blocks have been reported. In the past we relied on the pinning mechanism to provide us details if a block is pinned or not. However, the pinning state keeps the minimal information around for pinning. Therefore, unpinning a block will cause the state to disappear. Closes: #5761 --------- Signed-off-by: Alexandru Vasile <[email protected]> Co-authored-by: Sebastian Kunert <[email protected]>
- Loading branch information
Showing
3 changed files
with
218 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 | ||
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json | ||
|
||
title: Extend state tracking of chainHead to capture notification gaps | ||
|
||
doc: | ||
- audience: Node Dev | ||
description: | | ||
This PR extends the state tracking of the RPC-v2 chainHead methods. | ||
ChainHead tracks the reported blocks to detect notification gaps. | ||
This state tracking ensures we can detect `NewBlock` events for | ||
which we did not report previously the parent hash. | ||
|
||
crates: | ||
- name: sc-rpc-spec-v2 | ||
bump: minor | ||
|
This file contains 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
This file contains 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