-
Notifications
You must be signed in to change notification settings - Fork 207
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
liveslots+vatManager must provide secondary-storage API to vats as global #1867
Labels
Comments
proposal: const { vatGlobals, dispatch, setBuildRootObject } = makeLiveslots(syscall, state, ..);
const ns = await importBundle(bundle, .. vatGlobals);
setBuildRootObject(ns.buildRootObject); // calls buildRootObject() once before returning
return dispatch; It would be a "this should never happen" error for the kernel to invoke any |
Note that maybe vats should consume these global objects via a "ponyfill" package ( |
warner
added a commit
that referenced
this issue
Oct 21, 2020
This splits up `makeLiveslots` so that the `buildRootObject` function is provided later, after it returns. This makes it possible to delay the import of the vat code until after liveslots has provided globals to put into its Compartment. This does not yet provide any globals (the `vatGlobals` which `makeLiveslots` returns is empty). Nor does it change the vat managers to use the `vatGlobals` in any way. But these changes should be a lot easier now. Closes #1867.
warner
added a commit
that referenced
this issue
Oct 21, 2020
This splits up `makeLiveslots` so that the `buildRootObject` function is provided later, after it returns. This makes it possible to delay the import of the vat code until after liveslots has provided globals to put into its Compartment. This does not yet provide any globals (the `vatGlobals` which `makeLiveslots` returns is empty). Nor does it change the vat managers to use the `vatGlobals` in any way. But these changes should be a lot easier now. refs #1867
warner
added a commit
that referenced
this issue
Oct 21, 2020
Liveslots does not yet provide any `vatGlobals`, but this ensures that any ones it does provide in the future will be added to the `endowments` on the vat's Compartment. We'll use this to populate `makeExternalStore` -type functions, which want to be globals (because threading them from `vatPowers` into modules that need them would be too annoying), but must also be in cahoots with closely-held WeakMaps and "Representative" state management code from liveslots, as described in #455 and #1846. closes #1867
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the Problem Being Solved?
As described in #1846 (comment) , we're going to need to provide some secondary-storage "container" / Representative APIs to get handed to vats. The tricky part is that we want to provide them as globals, rather than as properties of the
vatPowers
argument we give tobuildRootObject()
.This is challenging because of the way vats are built:
importBundle
to evaluate the vat code, returning the exportedbuildRootObject
functionmakeLiveslots(buildRootObject)
, to get back thedispatch
object which will handle deliveriesFor this task,
makeLiveslots
is also creating the container APIs, because they must share the marshalling tables which liveslots manages (vatToSlot
and friends). That's a problem, because we need these APIs to be available well before we callmakeLiveslots
.So there's a cycle that needs breaking.
The text was updated successfully, but these errors were encountered: