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): add controller.terminateVat(vatID, reason) #9253

Open
wants to merge 1 commit into
base: warner/8928-terminate-vats-slowly
Choose a base branch
from

Conversation

warner
Copy link
Member

@warner warner commented Apr 18, 2024

This new API allows the host application to terminate any vat for which is knows the VatID (which must be gleaned manually from logs or the database). This might be useful if the normal vat code is unable or unwilling to terminate the vat, or if you need to trigger termination at some specific point in time.

closes #8687

Copy link

cloudflare-pages bot commented Apr 18, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 98c3e10
Status: ✅  Deploy successful!
Preview URL: https://d42913ee.agoric-sdk.pages.dev
Branch Preview URL: https://warner-8687-controller-termi.agoric-sdk.pages.dev

View logs

@warner
Copy link
Member Author

warner commented Apr 18, 2024

Security Considerations

The new API is powerful, and uses a trivially-forgeable vatID string, but is only available to the host application.

Scaling Considerations

As noted in the docstring, unless a runPolicy is used to rate-limit cleanups, all vat state will be terminated during the first controller.run() call after this new controller.terminateVat() is invoked. That state might be large, and deleting it all at once could be a problem. This PR is targeted to land on top of the #8928 rate-limited cleanup branch, to enable host applications to avoid this problem.

Documentation Considerations

Nothing here should be visible to userspace developers. The primary audience of this new feature is a specialized cosmic-swingset upgrade handler, which can call it during some future chain upgrade, to initiate deletion of the then-unused large price-feed vats, after they have been replaced by others. It's entirely possible that userspace will have a way to delete these vats by then, and we won't need the host-app to do it.

Testing Considerations

If/when we write that future upgrade handler to invoke this, we will need some kind of main-fork test to make sure it can initiate termination correctly. That will be part of the PR which modifies cosmic-swingset.

Upgrade Considerations

none

@warner warner added the SwingSet package: SwingSet label Apr 18, 2024
@warner warner requested a review from mhofman April 18, 2024 18:02
This new API allows the host application to terminate any vat for
which is knows the VatID (which must be gleaned manually from logs or
the database). This might be useful if the normal vat code is unable
or unwilling to terminate the vat, or if you need to trigger
termination at some specific point in time.

closes #8687
@warner warner force-pushed the warner/8687-controller-terminateVat branch from 2d621ee to 98c3e10 Compare April 23, 2024 19:03
@warner warner force-pushed the warner/8928-terminate-vats-slowly branch from c3299e5 to a31549a Compare April 23, 2024 19:03
Copy link
Member

@mhofman mhofman left a comment

Choose a reason for hiding this comment

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

This all seems reasonable, even though I'm not sure in which (non-test) circumstance we'd want to use this mechanism as I'd expect us to use bootstrap powers instead to terminate a vat during some core proposal.

@mhofman mhofman assigned warner and unassigned mhofman May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SwingSet package: SwingSet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants