Skip to content

Commit

Permalink
fix: add liveslots-provided globals to vat Compartments
Browse files Browse the repository at this point in the history
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
  • Loading branch information
warner committed Oct 21, 2020
1 parent bb5858a commit 3c79d51
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/SwingSet/src/kernel/vatManager/localVatManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export function makeLocalVatManagerFactory(tools) {

const endowments = harden({
...vatEndowments,
...ls.vatGlobals,
console: vatConsole,
});
const inescapableTransforms = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ parentPort.on('message', ([type, ...margs]) => {
const ls = makeLiveSlots(syscall, vatID, vatPowers, vatParameters);

const endowments = {
...ls.vatGlobals,
console: makeConsole(`SwingSet:vatWorker`),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ fromParent.on('data', ([type, ...margs]) => {
const ls = makeLiveSlots(syscall, vatID, vatPowers, vatParameters);

const endowments = {
...ls.vatGlobals,
console: makeConsole(`SwingSet:vatWorker`),
};

Expand Down

0 comments on commit 3c79d51

Please sign in to comment.