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)!: make dynamic vats unmetered by default #3522

Merged
merged 1 commit into from
Jul 24, 2021

Conversation

warner
Copy link
Member

@warner warner commented Jul 24, 2021

When #3308 lands, the definition of "metering" will change. Previously, a
"metered dynamic vat" just meant that 1: each crank was limited to some fixed
amount of computrons, and 2: the low-level deliveryResult included the
number of computrons consumed by that delivery (but nobody paid attention to
the value).

In the new system, metering requires a Meter: an object with a remaining
capacity, which is deducted by the consumption of each delivery. Each metered
vat is associated with (exactly one) Meter. The presence of a Meter still
implies a per-crank limit: unmetered vats do not have a per-crank limit
either.

Previously, all dynamic vats were metered by default. Since the new metering
needs a Meter, it would be awkward to retain this default: we'd have to
allocate a new Meter during createVat without the caller's awareness, and
then there would be nobody to pay attention to it (or refill it when it runs
low).

So this commit changes the default to "false". Dynamic vats will be
unmetered (neither per-crank limits nor cumulative limits) by default.
Callers who want to retain the per-crank limits should add metered: true to
their createVat options. Such callers will need to create a Meter object
once #3308 is done.

The commit also updates swingset metering tests to add metered: true.

refs #3308

When #3308 lands, the definition of "metering" will change. Previously, a
"metered dynamic vat" just meant that 1: each crank was limited to some fixed
amount of computrons, and 2: the low-level `deliveryResult` included the
number of computrons consumed by that delivery (but nobody paid attention to
the value).

In the new system, metering requires a Meter: an object with a `remaining`
capacity, which is deducted by the consumption of each delivery. Each metered
vat is associated with (exactly one) Meter. The presence of a Meter still
implies a per-crank limit: unmetered vats do not have a per-crank limit
either.

Previously, all dynamic vats were metered by default. Since the new metering
needs a Meter, it would be awkward to retain this default: we'd have to
allocate a new Meter during `createVat` without the caller's awareness, and
then there would be nobody to pay attention to it (or refill it when it runs
low).

So this commit changes the default to "false". Dynamic vats will be
unmetered (neither per-crank limits nor cumulative limits) by default.
Callers who want to retain the per-crank limits should add `metered: true` to
their `createVat` options. Such callers will need to create a Meter object
once #3308 is done.

The commit also updates swingset metering tests to add `metered: true`.

refs #3308
@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 a review from FUDCo July 24, 2021 20:29
@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.

Could've been worse.

Base automatically changed from 3308-warmup to master July 24, 2021 21:23
@warner warner merged commit c73dd8d into master Jul 24, 2021
@warner warner deleted the 3518-disable-local-metering branch July 24, 2021 21:24
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.

2 participants