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

State machines that perform runtime calls should delegate call to API user #1517

Open
2 of 4 tasks
tomaka opened this issue Dec 26, 2023 · 1 comment
Open
2 of 4 tasks

Comments

@tomaka
Copy link
Contributor

tomaka commented Dec 26, 2023

The library has several state machines that require providing a HostVmPrototype as part of their configuration, and that drive one or more runtime calls.

However, given that there are several ways to serve the state behind runtime calls, I think that this design was a mistake.

Instead, these state machines should only ask the API user to perform the call:

  • Transactions validation
  • Block execution
  • Authoring a block
  • Building chain information

I'm not completely sure what to do with the warp syncing state machine, as it does something kind of similar. At the moment I think it could be left as is.

@tomaka
Copy link
Contributor Author

tomaka commented Dec 27, 2023

One issue related to block execution and block authoring is the fact that there's a "new runtime compilation" step.
If the block being verified or authored modifies the code or heappages, we compile the new runtime as one of the steps.

If we change the state machines as proposed by this issue, the API user would either need to do that manually or would need to provide the storage diff to the state machine, neither of which are great solutions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant