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

Introduce easy runtime updates (loop?) #348

Closed
haerdib opened this issue Dec 1, 2022 · 3 comments · Fixed by #635
Closed

Introduce easy runtime updates (loop?) #348

haerdib opened this issue Dec 1, 2022 · 3 comments · Fixed by #635
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 1, 2022

Since #337 it's possible to update the runtime version and metadata. However, that currently needs to be done manually by the user. The way I'd imagine it, is that one listens to runtime upgrade events and then calls the update_runtime function.

This could be offered as a subscription function by the client itself, such that not every user needs to self-implement this.

Open question: Since we'd introduce mulithreading here, is a lock required? If so, is that possible in a no_std environment?

@haerdib haerdib added F7-enhancement Enhances an already existing functionality Q3-substantial labels Dec 1, 2022
@haerdib haerdib changed the title Introduce runtime update loop Introduce easy runtime updates (loop?) Dec 1, 2022
@haerdib haerdib added Q5-involved Will take some time to fix this and removed Q3-substantial labels Dec 1, 2022
@Niederb
Copy link
Contributor

Niederb commented Mar 28, 2023

Hmm, I think finding a nice solution to the locking issue is the main challenge. Some thoughts:

  • We could build a separate RuntimeUpdateSubscriber which would take a Mutex<Api<..>>. Creating the Mutex is the responsibility of the user. Not very nice from a user perspective.
  • The thread could just set an atomic bool (part of core) something like needs_runtime_upgrade. Then all the other functions would have to check the flag before doing anything. Not very nice, but I think this should work without Mutex
  • async support could probably provide a nicer solution

@masapr
Copy link
Collaborator

masapr commented Mar 28, 2023

so, let's first do the async support and then we look at this issue again? -> I adjusted the order in our backlog.

This feature is something, that has been asked for (see the comment by Paradox at our Kusama proposal), so it would be good to implement it within this proposal.

@Niederb Niederb linked a pull request Aug 4, 2023 that will close this issue
@Niederb
Copy link
Contributor

Niederb commented Aug 4, 2023

Closed by #635

@Niederb Niederb closed this as completed Aug 4, 2023
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
Development

Successfully merging a pull request may close this issue.

3 participants