diff --git a/packages/SwingSet/docs/static-vats.md b/packages/SwingSet/docs/static-vats.md index 2f741f24a19..53a7207a0e2 100644 --- a/packages/SwingSet/docs/static-vats.md +++ b/packages/SwingSet/docs/static-vats.md @@ -63,8 +63,6 @@ A few vats do not use liveslots. The main one is the "comms vat", which performs Static vats currently receive the following objects in their `buildRootObject()`'s sole `vatPowers` argument: -* `Remotable` -* `getInterfaceOf` * `makeGetMeter` * `transformMetering` * `transformTildot` @@ -73,14 +71,6 @@ Static vats currently receive the following objects in their `buildRootObject()` (dynamic vats do not get `makeGetMeter` or `transformMetering`) -### marshalling: `Remotable` and `getInterfaceOf` - -Messages sent between vats include arguments (and return values) which are serialized with `@agoric/marshal`. This marshalling library makes a distinction between plain data, and "remotable objects". Data is merely copied, but remotables arrive as a *Presence*, to which messages can be sent, with e.g. `counter~.increment()`. - -Objects which are frozen, and whose enumerable properties are all functions, will automatically qualify as remotable. In addition, vats can use `Remotable()` to create new remotable objects with a particular "interface" name, as well as other properties. The interface name can be retrieved with `getInterfaceOf`. - -This functionality is still in development. See https://github.com/Agoric/agoric-sdk/issues/804 for details. - ### metering: `makeGetMeter`, `transformMetering` Static vats are, for now, allowed to apply metering enforcement within their own walls. These vat powers provide the tools they need to do this. `makeGetMeter` returns a new `getMeter` function and a collection of functions to check and refill the meter it wraps. `transformMetering` takes a string of code and returns a new string into which metering code has been injected. By including `getMeter` in the `endowments` of a new `Compartment`, and adding `transformMetering` in the `transforms` of that compartment, vats can impose metering limits on other code evaluated inside the new compartment. When the meter runs out, the code subject to that meter starts throwing exceptions (which it cannot catch itself), and keeps throwing them until the meter is refilled. diff --git a/packages/SwingSet/src/kernel/kernel.js b/packages/SwingSet/src/kernel/kernel.js index 5a39590625e..6ea24bb3d49 100644 --- a/packages/SwingSet/src/kernel/kernel.js +++ b/packages/SwingSet/src/kernel/kernel.js @@ -1,4 +1,3 @@ -import { Remotable, getInterfaceOf } from '@agoric/marshal'; import { assert, details as X } from '@agoric/assert'; import { importBundle } from '@agoric/import-bundle'; import { assertKnownOptions } from '../assertOptions'; @@ -188,17 +187,13 @@ export default function buildKernel( // These will eventually be provided by the in-worker supervisor instead. - // We need to give the vat the correct Remotable and getKernelPromise so - // that they can access our own @agoric/marshal, not a separate instance in - // a bundle. TODO: ideally the powerless ones (Remotable, getInterfaceOf, - // maybe transformMetering) are imported by the vat, not passed in an - // argument. The powerful one (makeGetMeter) should only be given to the - // root object, to share with (or withhold from) other objects as it sees - // fit. TODO: makeGetMeter and transformMetering will go away + // TODO: ideally the powerless ones (maybe transformMetering) are imported + // by the vat, not passed in an argument. The powerful one (makeGetMeter) + // should only be given to the root object, to share with (or withhold + // from) other objects as it sees fit. TODO: makeGetMeter and + // transformMetering will go away const allVatPowers = harden({ - Remotable, - getInterfaceOf, makeGetMeter: meterManager.makeGetMeter, transformMetering: (...args) => meterManager.runWithoutGlobalMeter(transformMetering, ...args), diff --git a/packages/SwingSet/src/kernel/liveSlots.js b/packages/SwingSet/src/kernel/liveSlots.js index 6d0b352f28b..b4992f4e774 100644 --- a/packages/SwingSet/src/kernel/liveSlots.js +++ b/packages/SwingSet/src/kernel/liveSlots.js @@ -2,8 +2,6 @@ import { Remotable, - Far, - getInterfaceOf, passStyleOf, REMOTE_STYLE, makeMarshal, @@ -669,9 +667,6 @@ export function makeLiveSlots( ) { const allVatPowers = { ...vatPowers, - getInterfaceOf, - Remotable, - Far, makeMarshal, }; const r = build(syscall, forVatID, cacheSize, allVatPowers, vatParameters); diff --git a/packages/SwingSet/src/kernel/vatManager/manager-local.js b/packages/SwingSet/src/kernel/vatManager/manager-local.js index 775998adb29..d03a4629658 100644 --- a/packages/SwingSet/src/kernel/vatManager/manager-local.js +++ b/packages/SwingSet/src/kernel/vatManager/manager-local.js @@ -19,8 +19,6 @@ export function makeLocalVatManagerFactory(tools) { const { makeGetMeter, refillAllMeters, stopGlobalMeter } = meterManager; const { WeakRef, FinalizationRegistry } = gcTools; const baseVP = { - Remotable: allVatPowers.Remotable, - getInterfaceOf: allVatPowers.getInterfaceOf, makeMarshal: allVatPowers.makeMarshal, transformTildot: allVatPowers.transformTildot, }; diff --git a/packages/SwingSet/src/kernel/vatManager/supervisor-nodeworker.js b/packages/SwingSet/src/kernel/vatManager/supervisor-nodeworker.js index ccfaf9f628a..e7e740dbde8 100644 --- a/packages/SwingSet/src/kernel/vatManager/supervisor-nodeworker.js +++ b/packages/SwingSet/src/kernel/vatManager/supervisor-nodeworker.js @@ -6,7 +6,7 @@ import anylogger from 'anylogger'; import { assert, details as X } from '@agoric/assert'; import { importBundle } from '@agoric/import-bundle'; -import { Remotable, getInterfaceOf, makeMarshal } from '@agoric/marshal'; +import { makeMarshal } from '@agoric/marshal'; import { WeakRef, FinalizationRegistry } from '../../weakref'; import { waitUntilQuiescent } from '../../waitUntilQuiescent'; import { makeLiveSlots } from '../liveSlots'; @@ -95,8 +95,6 @@ parentPort.on('message', ([type, ...margs]) => { // transformTildot should be async and outsourced to the kernel // process/thread. const vatPowers = { - Remotable, - getInterfaceOf, makeMarshal, testLog, }; diff --git a/packages/SwingSet/src/kernel/vatManager/supervisor-subprocess-node.js b/packages/SwingSet/src/kernel/vatManager/supervisor-subprocess-node.js index 13d48aca82d..a44936457a5 100644 --- a/packages/SwingSet/src/kernel/vatManager/supervisor-subprocess-node.js +++ b/packages/SwingSet/src/kernel/vatManager/supervisor-subprocess-node.js @@ -6,7 +6,7 @@ import fs from 'fs'; import { assert, details as X } from '@agoric/assert'; import { importBundle } from '@agoric/import-bundle'; -import { Remotable, getInterfaceOf, makeMarshal } from '@agoric/marshal'; +import { makeMarshal } from '@agoric/marshal'; import { WeakRef, FinalizationRegistry } from '../../weakref'; import { arrayEncoderStream, arrayDecoderStream } from '../../worker-protocol'; import { @@ -115,8 +115,6 @@ fromParent.on('data', ([type, ...margs]) => { // transformTildot should be async and outsourced to the kernel // process/thread. const vatPowers = { - Remotable, - getInterfaceOf, makeMarshal, testLog, }; diff --git a/packages/SwingSet/src/kernel/vatManager/supervisor-subprocess-xsnap.js b/packages/SwingSet/src/kernel/vatManager/supervisor-subprocess-xsnap.js index 0503f8e93f1..97e981db261 100644 --- a/packages/SwingSet/src/kernel/vatManager/supervisor-subprocess-xsnap.js +++ b/packages/SwingSet/src/kernel/vatManager/supervisor-subprocess-xsnap.js @@ -2,7 +2,7 @@ // @ts-check import { assert, details as X } from '@agoric/assert'; import { importBundle } from '@agoric/import-bundle'; -import { Remotable, getInterfaceOf, makeMarshal } from '@agoric/marshal'; +import { makeMarshal } from '@agoric/marshal'; // grumble... waitUntilQuiescent is exported and closes over ambient authority import { waitUntilQuiescent } from '../../waitUntilQuiescent'; @@ -210,8 +210,6 @@ function makeWorker(port) { }); const vatPowers = { - Remotable, - getInterfaceOf, makeMarshal, transformTildot, testLog: (...args) =>