JSON-RPC: chainHead_v1_follow
Subscription Sends newBlock
events with unannounced parentBlockHash
#5761
Labels
I10-unconfirmed
Issue might be valid, but it's not yet known.
The
chainHead_v1_follow
subscription is not compliant with the specification because it sometimes sendsnewBlock
events where theparentBlockHash
has not been previously announced. According to the specification:Issue Details
While testing against the endpoint
wss://sys.dotters.network/paseo
, we observed that some blocks are missing from thenewBlock
events sequence. Specifically:#3012893
with hash0x2b8cbe6887a3e2869d462920d784b604a4683751aea1f2e10f02f97c9333abae
is announced.#3012896
with hash0x0e95ce16ed5cbf2008bf00c5e1a65736a8cd00c6dcf08da17126d216f79605d9
.The two missing blocks are:
#3012894
with hash0x5c7ed91698a589a1b2ec120b6bea82db88ef0ecc4abc7c25d491d9a10b165841
#3012895
with hash0x84654e06c8a6d4f0793b377c84cd80d5e802e227636a6b7bc52f1088863447f7
As a result, the
parentBlockHash
of block#3012896
refers to an unannounced block, which violates the specification's guarantee.This issue causes the PAPI client to crash.
Logs
I've attached the logs capturing this behavior: pre.log
Steps to Reproduce
Install Bun:
curl -fsSL https://bun.sh/install | bash
Set up the project:
mkdir paseo-test cd paseo-test bun init -y bun install polkadot-api bun papi add -w wss://sys.dotters.network/paseo pas
Create a file named
paseo.ts
with the following content:Run the script:
Impact
This issue disrupts the integrity of the block sequence received via the subscription, making it challenging to process data accurately. It hinders our ability to maintain a consistent view of the blockchain state, as we rely on the guarantee provided by the specification regarding
parentBlockHash
.Expected Behavior
Each
newBlock
event'sparentBlockHash
should either be:newBlock
event.Actual Behavior
The
newBlock
event for block#3012896
references aparentBlockHash
that was neither finalized nor previously announced via anewBlock
event.Request
Please investigate why the
chainHead_v1_follow
subscription is emittingnewBlock
events withparentBlockHash
values that have not been previously announced.cc: @jsdw @lexnv
The text was updated successfully, but these errors were encountered: