Skip to content

Conversation

@paritytech-release-backport-bot

Backport #10525 into stable2509 from voliva.

See the documentation on how to use this bot.

…sed (#10525)

# Description

Fixes polkadot-api/polkadot-api#1244

The current chainHead_v1 implementation is [not
spec-compliant](https://paritytech.github.io/json-rpc-interface-spec/api/chainHead_v1_follow.html),
as it states:

> - Generates an `initialized` notification
> - Generates one `newBlock` notification for each non-finalized block
> - Then a `bestBlockChanged` notification
> - When a new block arrives, generates a `newBlock` notification
> - When the node finalizes a block, generates a `finalized`
notification

And the current implemention only emits the `bestBlockChanged`
notification after initialized iif the best block is different from the
finalized block.

PAPI recently is using this part of the spec as an assumption. Most
chains are unaffected, but those that produce blocks on-demand (e.g.
manual-seal) then have polkadot-api hanging until there's a higher block
different than the finalized one.

## Integration

This PR doesn't change any of the APIs of the node. Upgrade should be
automatic.

## Review Notes

This PR removes that condition so that the `bestBlockChanged`
notification is always emited. All tests are updated to this new
behaviour

# Checklist

* [x] My PR includes a detailed description as outlined in the
"Description" and its two subsections above.
* [x] My PR follows the [labeling requirements](

https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CONTRIBUTING.md#Process
) of this project (at minimum one label for `T` required)
    * External contributors: Use `/cmd label <label-name>` to add labels
    * Maintainers can also add labels manually
* [x] I have made corresponding changes to the documentation (if
applicable)
* [x] I have added tests that prove my fix is effective or that my
feature works (if applicable)

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alexandru Vasile <[email protected]>
(cherry picked from commit 68c1250)
@github-actions github-actions bot added the A3-backport Pull request is already reviewed well in another branch. label Dec 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

This pull request is amending an existing release. Please proceed with extreme caution,
as to not impact downstream teams that rely on the stability of it. Some things to consider:

  • Backports are only for 'patch' or 'minor' changes. No 'major' or other breaking change.
  • Should be a legit fix for some bug, not adding tons of new features.
  • Must either be already audited or not need an audit.
Emergency Bypass

If you really need to bypass this check: add validate: false to each crate
in the Prdoc where a breaking change is introduced. This will release a new major
version of that crate and all its reverse dependencies and basically break the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A3-backport Pull request is already reviewed well in another branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants