paritytech / json-rpc-interface-spec

30 stars 3 forks source link

Use the same method name for notification results #98

Closed lexnv closed 1 year ago

lexnv commented 1 year ago

Currently, there's a method suffixed with Event that generates JSON-RPC notifications (ie subscription results). For example, the subscription events generated by calling chainHead_unstable_follow are provided under "method": "chainHead_unstable_followEvent".

This PR aligns the method name of the subscription that generates notifications with the method called, keeping parity with Substrate (pub/sub model used). Also, it is not possible to configure this in jsonrpsee.

Would love to hear your thoughts 🙏

cc @tomaka @josepot @jsdw @paritytech/subxt-team

tomaka commented 1 year ago

This PR aligns the method name of the subscription that generates notifications with the method called, keeping parity with Substrate (pub/sub model used).

I'm not sure I understand, because this is not the case for the legacy API. For example, state_subscribeStorage generates events whose method is state_storage, author_submitAndWatchExtrinsic generates events whose method is author_extrinsicUpdate, and so on.

lexnv commented 1 year ago

Ops my bad! Indeed, they could be mapped to a different name, will rename them in substrate! Thanks 👍