Stabilise the `UnstableBackend`
Closed this issue · 0 comments
jsdw commented
Nowadays, Substrate nodes support the chainHead_v1
RPCs which Subxt's UnstableBackend
relies on. Smoldot would need upgrading to 0.18 to support them, which has its own issues (eg #1749), but the lightclient feature is still unstable.
To stabilise the UnstableBackend
we should:
- Rename it to something like
ChainHeadBackend
- Add something like
ChainHeadBackendBuilder::build_with_background_driver()
which usestokio
or the WASM equivalent to spawn the background task which drives the driver. - Use this method instead of building a
LegacyBackend
inOnlineClient::from_insecure_url
etc. - Think about how errors are propagated to the user if this background task is hidden away. Currently, errors are emitted there only. We may need to tweak the FollowStreamDriver etc to pass errors on to the current subscriptions too, so they make it out to users where appropriate.
- Update Smoldot to 0.18 (if not already done) so that the light client feature will work with a default Subxt client, now that the default relies on chainHead_v1 APIs which we need 0.18 for.
All of the above should work both in WASM and native builds by default. This being true, we wouldn't need an additional feature flag or whatever I believe.