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

vat upgrade should put vatParameters in an option bag #5345

Closed
warner opened this issue May 11, 2022 · 0 comments · Fixed by #5365
Closed

vat upgrade should put vatParameters in an option bag #5345

warner opened this issue May 11, 2022 · 0 comments · Fixed by #5365
Assignees
Labels
enhancement New feature or request SwingSet package: SwingSet
Milestone

Comments

@warner
Copy link
Member

warner commented May 11, 2022

What is the Problem Being Solved?

Vats are created with vatAdminService~.createVat(bundleCap, options), where options includes { vatParameters } and others.

Vats are upgraded with adminFacet~.upgrade(newBundleCap, newVatParameters).

We should change this to be upgrade(newBundleCap, { vatParameters }), for parallelism with the original creation API, and to start an options bag for later.

Note that we don't currently have any other options. Many of the options available during initial creation are not changable by upgrade (e.g. the managerType is fixed at creation time). I don't currently think any of those other options are worth changing during upgrade, or it would be difficult to allow them to be changed. But vatParameters is how we'll give a new contract bundlecap to ZCF, so it's important to be replaceable.

Description of the Design

Change the function signature.

Security Considerations

None

Test Plan

Update the existing unit tests

@warner warner added enhancement New feature or request SwingSet package: SwingSet labels May 11, 2022
@warner warner self-assigned this May 11, 2022
@warner warner added this to the Mainnet 1 milestone May 11, 2022
@Tartuffo Tartuffo removed this from the Mainnet 1 milestone May 11, 2022
warner added a commit that referenced this issue May 13, 2022
Previously, the parent vat did `E(adminFacet).upgrade(vatParameters)`

Now it does `E(adminFacet).upgrade(bundleCap, { vatParameters })`

This matches the way `vatParameters` are passed to the original
`createVat()` call.

All other options are rejected.

This changes the `adminFacet` API, but internally continues to send
`vatParameters` in their own argument to the underlying device
nodes. If/when we send actual options, we'll need to decide whether to
change the shape of the device node API by converting `vatParameters`
into `options`, or just add additional arguments.

closes #5345
@Tartuffo Tartuffo added this to the Mainnet 1 milestone May 16, 2022
warner added a commit that referenced this issue May 26, 2022
Previously, the parent vat did `E(adminFacet).upgrade(vatParameters)`

Now it does `E(adminFacet).upgrade(bundleCap, { vatParameters })`

This matches the way `vatParameters` are passed to the original
`createVat()` call.

All other options are rejected.

This changes the `adminFacet` API, but internally continues to send
`vatParameters` in their own argument to the underlying device
nodes. If/when we send actual options, we'll need to decide whether to
change the shape of the device node API by converting `vatParameters`
into `options`, or just add additional arguments.

closes #5345
warner added a commit that referenced this issue Jun 1, 2022
Previously, the parent vat did `E(adminFacet).upgrade(vatParameters)`

Now it does `E(adminFacet).upgrade(bundleCap, { vatParameters })`

This matches the way `vatParameters` are passed to the original
`createVat()` call.

All other options are rejected. The `options` argument itself is
optional.

This changes the `adminFacet` API, but internally continues to send
`vatParameters` in their own argument to the underlying device
nodes. If/when we send actual options, we'll need to decide whether to
change the shape of the device node API by converting `vatParameters`
into `options`, or just add additional arguments.

closes #5345
warner added a commit that referenced this issue Jun 1, 2022
Previously, the parent vat did `E(adminFacet).upgrade(vatParameters)`

Now it does `E(adminFacet).upgrade(bundleCap, { vatParameters })`

This matches the way `vatParameters` are passed to the original
`createVat()` call.

All other options are rejected. The `options` argument itself is
optional.

This changes the `adminFacet` API, but internally continues to send
`vatParameters` in their own argument to the underlying device
nodes. If/when we send actual options, we'll need to decide whether to
change the shape of the device node API by converting `vatParameters`
into `options`, or just add additional arguments.

closes #5345
@mergify mergify bot closed this as completed in #5365 Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request SwingSet package: SwingSet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants