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

fix(swingset): createVatDynamically option to disable metering #1309

Merged
merged 2 commits into from
Jul 24, 2020

Conversation

warner
Copy link
Member

@warner warner commented Jul 18, 2020

refs #1307

@warner warner added SwingSet package: SwingSet metering charging for execution (was: package: tame-metering and transform-metering) labels Jul 18, 2020
@warner warner requested a review from FUDCo July 18, 2020 06:31
@warner warner self-assigned this Jul 18, 2020
@warner warner force-pushed the 1307-unmetered-dynamic-vats branch from 56e7061 to fb07411 Compare July 19, 2020 17:53
@warner warner force-pushed the 1307-unmetered-dynamic-vats branch 5 times, most recently from 3e80484 to 016869c Compare July 24, 2020 21:28
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.

Looks good, modulo the qualification in my comment below.

* subject to a meter that limits the amount of computation and allocation
* that can occur during any given crank. Stack frames are limited as well.
* The meter is refilled between cranks, but if the meter ever underflows,
* the vat is terminated. If 'false', the vat is unmetered.
Copy link
Contributor

Choose a reason for hiding this comment

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

Presumably if the creating vat is itself metered it won't have the power to create new, unmetered vats, so this option is subject to being ignored. If that understanding is correct, then probably you should expand this comment to talk about that.

Or did we decide that a dynamic vat creator could always create an unmetered vat if it chose to and thus the control to be exercised was whether a vat was vested with this power at all? In that case the "you can create a vat but it has to be metered" case would be realized by logic inside the vat admin vat. If so, then probably that should be documented. However, it doesn't look to me like the vat admin vat code that's part of this PR implements such a control mechanism.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I'm going with the second option for now (anyone who can create a dynamic vat can also create a metered one, whether they're metered or not). I don't think we have a use-case for dynamic vats creating dynamic vats yet, so I don't think we need to build a facet that enforces a metered: true option yet. But you're right, I should document that to make it clear.

@warner warner force-pushed the 1307-unmetered-dynamic-vats branch from 016869c to 388af11 Compare July 24, 2020 21:55
@warner warner merged commit 8078ef0 into master Jul 24, 2020
@warner warner deleted the 1307-unmetered-dynamic-vats branch July 24, 2020 23:37
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