paritytech / trappist-extra

Apache License 2.0
38 stars 6 forks source link

Use the new JSON-RPC API #18

Open stiiifff opened 1 year ago

stiiifff commented 1 year ago

When executing the app, Smoldot logs the following warning about the use of the legacy JSON-RPC API:

[WARN] The JSON-RPC client has just called a JSON-RPC function from the legacy JSON-RPC API (chain_subscribeNewHeads).
Legacy JSON-RPC functions have loose semantics and cannot be properly implemented on a light client.
You are encouraged to use the new JSON-RPC API <https://github.com/paritytech/json-rpc-interface-spec/> instead.
The legacy JSON-RPC API functions will be deprecated and removed in the distant future.

As recommended, we should use the new JSON-RPC API instead. So, instead of the old chain_subscribeNewHeads API, use the new chainHead_unstable_follow API (see its usage in the spec).

Daanvdplas commented 1 year ago

This new API doesn't provide any blocknumber, only the hash of an encoded block header (new block / new best block) or multiple (new finalized block(s) + pruned block(s)). Would this change then still be desired?