smol-dot/smoldot

`chainHead_v1_followEvent` is not spec compliant

Closed this issue · 2 comments

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}}}}}}

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.

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 😅