Skip to content

chainHead/follow: Provide multiple finalized block hashes by the Initialized event#136

Merged
lexnv merged 13 commits into
mainfrom
lexnv/chain-head-fin-blocks
Feb 21, 2024
Merged

chainHead/follow: Provide multiple finalized block hashes by the Initialized event#136
lexnv merged 13 commits into
mainfrom
lexnv/chain-head-fin-blocks

Conversation

@lexnv

@lexnv lexnv commented Feb 14, 2024

Copy link
Copy Markdown
Contributor

This PR extends the Initialized event of the chainHead_follow subscription.

Now, the event provides multiple finalized block hashes. This information allows clients that are disconnected, and that want to reconnect, to not lose information about the state of the chain.

At the moment, the spec encourages servers to provide at least 1 minute of finalized blocks (~10 blocks). The users are responsible for unpinning these blocks at a later time.

Closes: #81

cc @paritytech/subxt-team

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@lexnv lexnv self-assigned this Feb 14, 2024
Comment thread src/api/chainHead_unstable_follow.md Outdated
Comment thread src/api/chainHead_unstable_follow.md Outdated
@tomaka

tomaka commented Feb 14, 2024

Copy link
Copy Markdown
Contributor

Also a block -> blocks missing near the start of the The withRuntime parameter section
And the Pinning section also needs small adjustments

lexnv and others added 4 commits February 14, 2024 16:41
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Comment thread src/api/chainHead.md Outdated
jsdw
jsdw previously approved these changes Feb 15, 2024

@jsdw jsdw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM overall and love the change :)

Just a nit about the use of currentFinalizedBlock

Co-authored-by: James Wilson <james@jsdw.me>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Comment thread src/api/chainHead.md Outdated
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Comment thread src/api/chainHead.md Outdated
Comment thread src/api/chainHead.md Outdated
jsdw
jsdw previously approved these changes Feb 21, 2024

@jsdw jsdw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor suggestions but looks good to me!

Co-authored-by: James Wilson <james@jsdw.me>
jsdw
jsdw previously approved these changes Feb 21, 2024

@jsdw jsdw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One other minor thing left but LGTM

Co-authored-by: James Wilson <james@jsdw.me>
@lexnv lexnv merged commit 60df114 into main Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chainHead_follow: allow optional resuming from given block hash

3 participants