-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Currently, we launch vats via the Kernel.launchVat() method, which is called externally and passed a worker. We do not encapsulate the creation of the worker, but do it directly in the kernel's realm.
Instead, we should create a platform-agnostic abstraction that encapsulates the worker creation logic. Agoric has previously referred to such a thing as a "vat loader". I'm not partial to that name, because its referent is also responsible for unloading vats, and I'm not even sure if "loading" is the right verb.
The current Snaps implementation has a corresponding abstraction which is quite a mouthful: the ExecutionService. Some relevant files include:
Note
The execution service is a almost but not quite a controller, which is probably the most important pattern of MetaMask's architecture. I mention this so that implementers are not distracted by the controller boilerplate in the above files.
Using the execution service as a reference implementation, we should create our own "vat loader" abstraction, hopefully finding a better name for it than our forebears.