Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chainHead_v1_followEvent is not spec compliant #1789

Closed
josepot opened this issue Apr 26, 2024 · 2 comments · Fixed by #1792
Closed

chainHead_v1_followEvent is not spec compliant #1789

josepot opened this issue Apr 26, 2024 · 2 comments · Fixed by #1792

Comments

@josepot
Copy link
Contributor

josepot commented Apr 26, 2024

smoldot@2.0.24 stabilized the chainHead group of functions. However, the initialized event produced by the chainHead_v1_follow method is still reporting the "old" finalizedBlockHash property, when according to the spec it should report the list of finalizedBlockHashes.

Eg:

{"jsonrpc":"2.0","method":"chainHead_v1_followEvent","params":{"subscription":"8jWR4uVfEbSnDXCsCQYfQbiBvVq7iym6z5RfgdT8Kq9u","result":{"event":"initialized","finalizedBlockHash":"0x0d2fd62e133f65b452244f45b3328dc740238bb0eb44cb70e83e7c7603370f7c","finalizedBlockRuntime":{"type":"valid","spec":{"specName":"polkadot","implName":"parity-polkadot","specVersion":1002000,"implVersion":0,"transactionVersion":25,"apis":{"0xf78b278be53f454c":2,"0xed99c5acb25eedf5":3,"0xdf6acb689907609b":4,"0x40fe3ad401f8959a":6,"0xd2bc9897eed08f15":3,"0x18ef58a3b67ba770":1,"0x49eaaf1b548a0cb0":3,"0x91d5df18b0d2cf58":2,"0x2a5e924655399e60":1,"0x37c8bb1350a9a2a8":4,"0x37e397fc7c91f5e4":2,"0x17a6bc0d0062aeb3":1,"0xf3ff14d5ab527059":3,"0xbc9d89904f5b923f":1,"0xfbc577b9d747efd6":1,"0xcbca25e39f142387":2,"0xaf2c0297a23e6d3d":10,"0xab3c0572291feb8b":1,"0x687ad44ad37f03c2":1}}}}}}
@josepot josepot changed the title chainHead_v1_followEvent doesn't follow the spec chainHead_v1_followEvent is not spec compliant Apr 26, 2024
@tomaka
Copy link
Contributor

tomaka commented Apr 26, 2024

cc #1718

Shipping smoldot that includes only one hash is intentional (as the spec doesn't make it mandatory to include multiple hashes), but when doing so I didn't realize that the field got renamed and turned into an array.

@josepot
Copy link
Contributor Author

josepot commented Apr 26, 2024

cc #1718

Shipping smoldot that includes only one hash is intentional (as the spec doesn't make it mandatory to include multiple hashes), but when doing so I didn't realize that the field got renamed.

That's totally fair. However, please keep in mind that it's not just a rename, the shape of the payload has also changed (it's now an Array).

EDIT yep, you obviously were aware of that 😅

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 a pull request may close this issue.

2 participants