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

swingset's internal vats should be upgradable #5666

Closed
warner opened this issue Jun 24, 2022 · 1 comment
Closed

swingset's internal vats should be upgradable #5666

warner opened this issue Jun 24, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request Epic SwingSet package: SwingSet vaults_triage DO NOT USE
Milestone

Comments

@warner
Copy link
Member

warner commented Jun 24, 2022

Swingset has a number of internal vats:

The source code for these vats lives in packages/SwingSet/src/vats/. All but network are instantiated automatically by SwingSet unless you disable them with a config option (although the userspace-provided bootstrap function is still responsible for wiring them up). Our chain packages/vats/ creates a vat-network around the swingset-provided src/vats/network/ code.

We need all of these to be upgradable, so we don't find ourselves stuck later when we want to add a feature or fix a bug. That means replacing their Far objects with instances of a durable Kind.

As a side-effect, they will move a lot of their state to virtual+durable storage. This will reduce the memory concerns of long-running vats that could accumulate state, at the cost of performance (they'll be doing a lot of DB operations instead of simple in-RAM lookups).

comms is transcriptless, so it's already taken care of.

We might be able to defer writing code to actually trigger their upgrades, as long as we know the initial version is storing enough of its state in the DB to allow us to implement the upgrades (and the new versions to upgrade to) later. OTOH we can't really test their upgradeability without adding a knob for it.

These are all static vats. To trigger the upgrade of a static vat, we could either add that power to vat-admin, or we could introduce some sort of controller.upgradeStaticVat(vatID, newBundleID) API. The upgrade process itself is probably the same as for dynamic vats: processUpgradeVatEvent() performs a stopVat delivery, replaces the vat source bundleid DB key (which will be slightly different for a static vat, unless we find a nice way to unify them better), flushes the worker, then makes a new worker and sends it a startVat delivery.

@FUDCo
Copy link
Contributor

FUDCo commented Apr 20, 2023

These have all been completed except for the network vat work, which is in something of an indeterminate state for reasons unrelated to the upgradeability thing, and therefore the network vat as a whole may quite possibly get overhauled at some point in the post-Vaults future and render the work that's been done up until now on network vat upgradeability obsolete. (Though any such overhaul would almost certainly include making it durable/upgradeable in whatever its new form turns out to be.) So I'm going to close out this epic to keep it from blocking the vaults release even though the network vat task is not done. However, I'll leave the network vat task itself in place as a reminder that this will need to be addressed at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Epic SwingSet package: SwingSet vaults_triage DO NOT USE
Projects
None yet
Development

No branches or pull requests

4 participants