-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(swingset): replay dynamic vats properly
This saves the dynamic vat data (source bundle or bundleName, dynamicOptions) to the kernel state DB when the vat is first created. Then, during replay, we reload the dynamic vat from that data. This refactors dynamic vat creation slightly, to merge create-by-bundle and create-by-bundle-name into a single function that takes a `source` argument which contains either `{ bundle }` or `{ bundleName }`. By passing `source` to `createVatDynamically`, rather than first converting it into a full bundle, we have enough information to store the much smaller bundleName in the DB. Userspace code still sees the same API (`vatAdminSvc~.createVat(bundle)` or `vatAdminSvc~.createVatByName(bundleName)`), but the kernel internals and the vat-admin device endowments have changed. We add a new `vat.dynamicIDs` entry to the kernelKeeper, which contains a single JSON-encoded Array of dynamic vatIDs. This isn't great, but it's expedient, and our DB doesn't really support enumerating anything more clever anyways. We also add a pair of keys to the vatKeeper for each dynamic vat: `v$NN.source` and `v$NN.options`, to record the bundle/bundleName and dynamicOptions that were used the first time around, so we can use them on subsequent calls too. `createVatDynamically` normally sends a message (to the vatAdminVat) when the new vat is ready, so it can inform the original caller and give them the new root object. We suppress this message when reloading the kernel, because it was already delivered the first time around. One side-effect is that failures to reload the dynamic vat must panic the kernel, because there is nobody ready to report the error to. This could happen if the new host application failed to configure the same source bundles as the previous one did. At some point we'll want to store all these bundles in the DB, which should remove this failure mode. closes #1480
- Loading branch information
Showing
6 changed files
with
125 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters