You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've committed to using xsnap for any computation that needs to be metered: the overhead of injected (Node.js) metering is pretty high, especially the initial translation/evaluation step, and we're committed to using xsnap anyways. We've removed some pieces of the old injected metering, but I'm running into a few small problems (typescript annotations) that would be easiest to solve if we just remove the vestigal remainders.
design
My plan is to delete the endowments (transformMetering, meterManager, replaceGlobalMeter) that get handed down from controller to kernel to local-vat-manager, which are used to support within-vat metering (transform functions granted through globals, getMeter supplied to the injected code but not userspace code via lexicals) and the supervisor-helper code that knows how to reset the global meter at the end of each crank.
Since "local" (Node.js) vats won't be able to do metering any more, I intend to have them assert that metered === false, to avoid any confusion.
Part of #3308 will be to change the dynamic vat default from metered: true to metered: false (because when that lands, metering will require a separately-constructed Meter object, making it awkward to offer a default with metering turned on). So I'll need to modify all current users of dynamic vats (Zoe's ZCF facet, the spawner, the tests/swingsetTests/ of treasury/sharing-service/governance/ERTP/zoe/spawner) to add metered: true. The assertion above means those test programs must also set config.defaultManagerType = 'xs-worker', since the default local worker will no longer accept metered: true. Applications which use metered dynamic vats will need to use xs-worker as well; our two primary applications (the chain, ag-solo) already do.
The text was updated successfully, but these errors were encountered:
Swingset will soon change from "all dynamic vats are metered" to "dynamic
vats are unmetered by default", so set "metered: true" to retain the current
behavior for ZCF vats.
In addition, metering is going to be removed from the "local" (Node.js)
vat-worker, so "metered: true" will require "xs-worker" (xsnap) instead. This
changes the `tests/swingsetTests` runners to use xs-worker.
Note that this upcoming change means any application which uses Zoe to spawn
ZCF vats must run with `config.defaultManagerType='xs-worker'`, otherwise vat
creation will fail when Zoe asks for a metered vat. Our two primary
applications (the chain and the solo machine) both do this already.
refs #3518
refs #3308
We no longer care about injected (Node.js) -based metering: XS is the only
platform where we can reasonably+efficiently meter code.
This removes support for passing `{ managerType: 'local', metered: true }` to
`createVat()`. Doing so will throw an exception when the vatManager is
invoked. Using just `{ metered: true }` is also an error when the swingset
`config.defaultManagerType` is not set to `xs-worker`. Applications that want
metered dynamic vats (i.e. all of them) should set `config.defaultManagerType
= 'xs-worker'` to avoid this.
This commit removes support throughout swingset:
* `transformMetering` is no longer passed from controller to kernel to the
local vatManager, and the transform is no longer applied to
`inescapableTransforms` to ensure sub-Compartments are also transformed
* `getMeter` is no longer placed on `inescapableLexicals`
* `replaceGlobalMeter` is no longer passed through to `supervisor-helper`,
where it was used to disable metering at the end of each crank
* the kernel `meterManager` facilities were removed
* all tests of metering non-XS workers are removed, including a test that
exercised sub-Compartments (which was specific to the injection approach)
Some tests have been modernized slightly, to use `controller.kpResolution`
instead of appending strings to testLog, and to use `prepare-test-env-ava`
instead of `@agoric/install-ses`.
Dependency updates:
Swingset no longer uses `@agoric/install-metering-and-ses`, or the
`tame-metering`/`transform-metering` packages. A vestigal dependency on
`babel-parser` (left over from the transform-tildot days) was removed.
Swingset still depends upon `babel-standalone`, to pre-load before `lockdown`
in `prepare-test-env-ava`.
closes#3518
What is the Problem Being Solved?
We've committed to using xsnap for any computation that needs to be metered: the overhead of injected (Node.js) metering is pretty high, especially the initial translation/evaluation step, and we're committed to using xsnap anyways. We've removed some pieces of the old injected metering, but I'm running into a few small problems (typescript annotations) that would be easiest to solve if we just remove the vestigal remainders.
design
My plan is to delete the endowments (
transformMetering
,meterManager
,replaceGlobalMeter
) that get handed down from controller to kernel to local-vat-manager, which are used to support within-vat metering (transform functions granted through globals,getMeter
supplied to the injected code but not userspace code via lexicals) and thesupervisor-helper
code that knows how to reset the global meter at the end of each crank.Since "local" (Node.js) vats won't be able to do metering any more, I intend to have them assert that
metered === false
, to avoid any confusion.Part of #3308 will be to change the dynamic vat default from
metered: true
tometered: false
(because when that lands, metering will require a separately-constructedMeter
object, making it awkward to offer a default with metering turned on). So I'll need to modify all current users of dynamic vats (Zoe's ZCF facet, the spawner, thetests/swingsetTests/
of treasury/sharing-service/governance/ERTP/zoe/spawner) to addmetered: true
. The assertion above means those test programs must also setconfig.defaultManagerType = 'xs-worker'
, since the defaultlocal
worker will no longer acceptmetered: true
. Applications which use metered dynamic vats will need to usexs-worker
as well; our two primary applications (the chain, ag-solo) already do.The text was updated successfully, but these errors were encountered: