-
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.
This changes the raw vat API: instead of an object named `dispatch` with methods like `dispatch.deliver` and `dispatch.notify`, vats export a `dispatch()` *function* which always takes a `VatDeliveryObject`. This VDO contains a `type: 'message'` or `type: 'notify'` (among others). This paves the way for low-level vats to get control when their userspace code becomes quiescent, so they can perform GC activity at end-of-crank. The comms vat (our only non-liveslots "raw" vat) was changed to match. The various vat managers and supervisors were refactored around a "manager kit" and "supervisor kit", to centralize transcript replay and error handling. Each different type of manager is responsible for launching the worker and delivering VatDeliveryObjects / VatDeliveryResults over whatever form of "wire" they use, and likewise for VatSyscallObject / VatSyscallResults. But the `dispatch()` presented to the kernel (on one side), and the `dispatch`/`syscall` attached to the low-level vat (on the other) are both handled by common code, regardless of the type of manager. This removes a lot of boilerplate and should fix some of the accidental non-feature-parity between manager types. It should also help with the return of meter-consumed data from the worker, eventually. The manager-type -specific code no longer attempts to inspect/dissect/reassemble VatDeliveryObjects or VatSyscallObjects. The manager types are split into two categories: those for which syscalls can return data, and those which cannot. Local and XS workers can block until the kernel returns the syscall results, so they can use `syscall.invoke` and `syscall.vatstoreGet`, which are necessary for device calls and virtual objects, respectively. NodeWorker (i.e. threads) cannot block, and Node subprocess workers do not block (we could make them block, but it's more work than we care to invest). The creation of Vat Managers was shuffled to provide the `vatSyscallHandler` as an argument up-front, rather than passing it into a callback function later. We needed the old (and annoying) arrangement to deal with a cyclic dependency, but that was removed some time ago, so now we can finally clean it up. The transcript format was changed to include the VatDeliveryObject, VatSyscallObject, and VatSyscallResult objects more directly. Several syscall-handling paths were rewritten to do the same. This causes test-kernel.js to change slightly, in the parts which examine the transcript directly. A lot of typescript annotations were added (mostly in `src/types.js`), and many type-asserting functions were added to `src/message.js`. All unit tests that interacted with liveslots or the comms vat directly (using `dispatch.deliver()`) were changed to use `dispatch()`, along with helper functions to create the VatDeliveryObjects it now takes.
- Loading branch information
Showing
34 changed files
with
1,409 additions
and
1,129 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 was deleted.
Oops, something went wrong.
Oops, something went wrong.