-
Notifications
You must be signed in to change notification settings - Fork 105
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
refactor(core-backend): Type-safe memory accesses #3846
Conversation
This reverts commit 398903f.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall PR lgtm. Left a few totally minor comments except some general thoughts.
Requesting changes due to one thing I'm missing from your explanation IRL: there's still possibility (and not only by accident, but it's general flow) to call host func more than once.
What I propose to you (at least for fallible syscalls):
- Mark constructor for registry unsafe and throw it manually as closures arg in syscalls. It will pay our attention if we create it twice within the same call, for example for reading value etc (there is comment above about accepting ref isntead of creation - so you can ignore it if this idea will be implemented)
- Once registry created it should register write of err result immediately, and only then passed into syscalls defining closure, where it will be destructed into IO. IO should be in any manner returned from fallible syscall closures as well as the value of the "final" externalities call. (Or something like this just to support codes simplicity)
Only in these two steps we gonna have only one host call per fallible syscall.
On the other side we're free to do nothing once fallible syscall returns Ok: not writing err (since it's supposed to be zero in user space), not charging for page access, but your point is still to be discussed. |
No description provided.