-
Notifications
You must be signed in to change notification settings - Fork 212
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
create addVat() device #24
Comments
.. as the index for kernel state data structures, instead of user-provided vatName/deviceName strings. This will make it easier to use key/value state storage (#144), since the keys will be more uniform (and shorter, and not vulnerable to people using the separator string in their vat name). Also it will make adding dynamic Vats easier (#19), as we'll just increment a counter instead of asking the user to discover a unique name. closes #146
.. as the index for kernel state data structures, instead of user-provided vatName/deviceName strings. This will make it easier to use key/value state storage (#144), since the keys will be more uniform (and shorter, and not vulnerable to people using the separator string in their vat name). Also it will make adding dynamic Vats easier (#19), as we'll just increment a counter instead of asking the user to discover a unique name. closes #146
.. as the index for kernel state data structures, instead of user-provided vatName/deviceName strings. This will make it easier to use key/value state storage (#144), since the keys will be more uniform (and shorter, and not vulnerable to people using the separator string in their vat name). They look like "vNN" and "dNN", where NN is a positive integer. This will also make adding dynamic Vats easier (#19), as we'll just increment a counter instead of asking the user to invent a unique name. closes #146
I'm working on design of a vat spawning device. Some assumptions:
kernel.js has I don't know how the spawner gets the source code. The genesis vats are all read statically from local files. I think it makes more sense to pass in a source-text string, but I'm willing to be convinced otherwise. Dean has talked about a large string vat/device so we don't have to pass strings all over the place, but that doesn't exist yet. |
From the app programmer's high level pov, the answer will be in terms of a loader/importer (defining an import namespace) and a module name (to be interpreted by that loader). No one loader is privileged, and so no one import namespace is. However, the normal app programmer will have a sensible default they won't think much about. Each loader is a distinct capability. Resource linkage integrity is, essentially, ensuring that remote loaders that are trying to be in agreement actually are, for example, by a hash of the full linkage graph. At a low level, this would all turn into an evaluable string only on engines like v8 where our security kernel is about safe evaluation of evaluable strings, and modules translate into those. On XS's SES, modules are as fundamental as evaluable strings, so the high level module-oriented answer must turn into a low level module-oriented answer. Figuring this out likely depends on settling with Moddable what our full safe-module API is. Despite all these qualifications, for what you're doing now, start with evaluable strings. @dtribble's thoughts about string devices are directly relevant to this. Perhaps the reification of a string as a string device can be unified with the idea of an installation as a reification of spawnable/runnable code. An instatiable fully-linked static module linkage graph might plausible be reified into the same notion of an installation. Many open question here. Attn @michaelfig @jfparadis. |
@Chris-Hibbert, please look at Zoe's and the contractHost's The |
Hi @michaelfig curious about your sense of how we transition from this to using our safe module system? Is there something we should do or not do when using |
As long as we always pass the |
A few notes from conversations with Chris:
Other options for this "code artifact" specification include:
|
More notes: We think there will be a Each dynamic Vat has two kinds of identifiers. The first is an integer allocated by the The
The
The device code handling The
Later, to terminate the vat, the caller can send a message to the (what actually happens when we terminate the vat is another large piece of work: the main question is how to cauterize the now-dangling references, and who is responsible for creating errors in response to messages sent on them. One thought is to have a special vat which just throws errors for any message it receives, and then change the routing of all dangling references to point at the error vat. This would keep the kernel out of the business of creating error messages. We might be able to use this trick for send-to-data errors too, which are currently built by the kernel.) |
@warner If you use |
Oh, and |
rename gallery demo markdown and put in a number of commands
…g a digit). This tests for that case and adds a digit if needed, and also errors if that still doesn't fix it. Eventually I'd like to change the actual algorithm but I don't understand the bit operations fully without diving in further. (Agoric#24)
Here are some more details on how the vat, kernel, and devices get tied together, and what functions rely on which others to get their work done. The main change from the previous description is that the vatAdmin Vat doesn't wait for a response from the device. It can construct the vat admin object immediately and return it with a promise for the root object. The outer device has functions that allow the kernel to register createDynamicVat with the inner device. The inner device remembers the mapping from adminID to vatID. It creates vats, terminates them, and can provide admin support. On creation, it only returns the new VatID to the vatAdminVat, and provides the root object in a follow-up reply. It has a function the kernel can use to notify it when vats have been created, but it doesn't have to register it, because the kernel will synthesize these calls. We expect a prompt reply to requests for statistics, so these will be returned immediately. Termination will be complicated The vatAdminVat will be closely held and only provided to things like Zoe and the re-purposed contract host. It will have functionality for creating and adminstering (including termination) dynamic vats. When a new vat is requested, it will promptly return an admin interface and a promise for the root object. The root object promise will be resolved some time later, but messages can be sent to it immediately. The admin interface just wraps the vatID, and makes it possible to request info from the kernel and terminate the vat. The kernel will have a method for creating new vats which will immediately return the new vat's ID. Once the new vat has been built, it will notify the vat creation device with a synthesized message passing the root object. The kernel will create the vat, then create the necessary entries in the kernel's tables so messages can be delivered. Inner Device has
Outer Device has
createVatFn is
vatAdminVat
Kernel provides
Calls registerVatCreationFunction to invoke the function that remembers createDynamicVat |
We implemented something slightly different, so here's a corrected reprise: The outer device has functions that allow the kernel to register createDynamicVat with the inner device. The inner device creates vats, terminates them, and can provide admin support. On creation, it only returns the new VatID to the vatAdminVat, and provides the root object in a follow-up reply. We expect a prompt reply to requests for statistics, so these will be returned immediately. Termination will be complicated The vatAdminVat will be closely held and only provided to things like Zoe and the re-purposed contract host. It will have functionality for creating and administering (including termination) dynamic vats. When a new vat is requested, it will promptly return an admin interface and a promise for the root object. The root object promise will be resolved some time later, but messages can be sent to it immediately. The admin interface just wraps the vatID, and makes it possible to request info from the kernel and terminate the vat. The kernel will have a function for creating new vats which will immediately return the new vat's ID. This function will be registered with the device. Once a new vat has been built, the kernel will notify the vat creation vat with a synthesized message passing the root object. The kernel will create the vat, then create the necessary entries in the kernel's tables so messages can be delivered. The inner device
The inner device has
|
Some Vats should have the ability to create new Vats. We should probably treat this authority as a "device", to provide it selectively to certain initial vats. This might also make it easier to provide certain authority over the new Vat: termination, migration, upgrade, and debugging.
The text was updated successfully, but these errors were encountered: