User defined kind handle to upgrade durable collection shapes #7525
Labels
enhancement
New feature or request
liveslots
requires vat-upgrade to deploy changes
stores
SwingSet
package: SwingSet
What is the Problem Being Solved?
Originally virtual collections had no customizable behavior, so when we introduced durability, durable collections used a kind handle internally defined by liveslots.
Then we introduced
keyShape
andvalueShape
to virtual collections. However because there are no user handles to manage or redefined these durable collections during upgrade, the user code has no way to change these shapes and upgrade the collection, unlike for a durable object's state (see #7407).In #7337 (comment) it was brought that an upgradability mechanism would apply to durable collections as well, but without an admin handle to the collection, there is no path for the user code to exercise it.
Description of the Design
Allow user land to create a durable collection providing it own kind handle.
On upgrade these durable collection instances would have to be explicitly redefined during
buildRootObject
.We may want to enforce that usage of collection shapes requires an explicit kind handle.
Unlike values which can be lazy migrated, key shapes might require a "compatibility" check to enforce that the new shape is a superset of the previous shape (similar to the original description of #7337
Security Considerations
None?
Scaling Considerations
How do we transition current durable collections with implicit kind handles and shapes defined? It may be possible to iterate and move regular collections, but not weak ones. Maybe we could introduce a wrapper that defines a new collection, and wraps access so that it checks the old collection instance if the entry isn't found in the new collection, and lazily performs migration on access?
Test Plan
TBD
The text was updated successfully, but these errors were encountered: