Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(swingset)!: remove support for non-XS metering #3523

Merged
merged 1 commit into from
Jul 25, 2021

Conversation

warner
Copy link
Member

@warner warner commented Jul 24, 2021

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

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
@warner warner added SwingSet package: SwingSet metering charging for execution (was: package: tame-metering and transform-metering) labels Jul 24, 2021
@warner warner added this to the Testnet: Metering Phase milestone Jul 24, 2021
@warner warner requested review from michaelfig and FUDCo July 24, 2021 20:31
@warner warner self-assigned this Jul 24, 2021
Copy link
Contributor

@FUDCo FUDCo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Negative code days are the best.

Base automatically changed from 3518-disable-local-metering to master July 24, 2021 21:24
Copy link
Member

@michaelfig michaelfig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@warner warner merged commit 5b95638 into master Jul 25, 2021
@warner warner deleted the 3518-remove-local-metering branch July 25, 2021 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
metering charging for execution (was: package: tame-metering and transform-metering) SwingSet package: SwingSet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants