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

Improve ease of use of api client in no_std #391

Closed
haerdib opened this issue Dec 22, 2022 · 5 comments · Fixed by #580
Closed

Improve ease of use of api client in no_std #391

haerdib opened this issue Dec 22, 2022 · 5 comments · Fixed by #580
Assignees
Labels
F7-enhancement Enhances an already existing functionality Q5-involved Will take some time to fix this

Comments

@haerdib
Copy link
Contributor

haerdib commented Dec 22, 2022

After solving #279, with a no_std compatible Api, one could theoretically use the api-client with most features inside a no_std environment. But practically, a lot of workarounds are needed, because many types from substrate (Header, Block ,.. .) do not implement Serialize / Deserialize in no_std.

Improvement Ideas:

  1. If parity allows it: Implement serde derivations also in no_std paritytech/substrate#12994
  2. Provide most important types (Header, Block,..) with (de)serialization implementations, just like in Make Api no_std compatible #377
  3. Do only enforce Serialization for types that are actually requested (for now, at least the full FrameSystemConfig is enforced, no matter what is actually requested via RPC) (not sure if that is possible, would need to be evaluated)
@haerdib haerdib changed the title Improve ease of use of Api client in no_std Improve ease of use of api client in no_std Dec 22, 2022
@haerdib haerdib added F7-enhancement Enhances an already existing functionality Q5-involved Will take some time to fix this labels Dec 22, 2022
@haerdib
Copy link
Contributor Author

haerdib commented Dec 23, 2022

Green light from parity, so lets try to go with 1.

@haerdib haerdib self-assigned this Dec 23, 2022
@haerdib
Copy link
Contributor Author

haerdib commented Dec 29, 2022

PR on parity side: paritytech/substrate#13027

@haerdib
Copy link
Contributor Author

haerdib commented Jan 26, 2023

Marked as blocked. No response from parity for two weeks, even after asking further questions. Maybe we'll have to go for a different solution.

@haerdib
Copy link
Contributor Author

haerdib commented Apr 11, 2023

So, the PR has been stalled once again for quite some time. So I guess it's time for a workaround, as I don't think the current solution is the way to go for much longer.

Ideas:

  1. Rename the implemented substrate types to clearly distinguish between these types
  2. For self implemented functions needing the serialization wrappers, we could map the types after serialization to the original substrate type and only then return it.

@haerdib
Copy link
Contributor Author

haerdib commented May 2, 2023

Yey. Got once again an update from the Substrate side: paritytech/substrate#13027 (comment)

Seems like this will be a basic feature for them any ways, so there's a good chance that this PR will finally be accepted... eventually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F7-enhancement Enhances an already existing functionality Q5-involved Will take some time to fix this
Projects
None yet
1 participant