You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(swingset-liveslots): Support adding optional top-level fields to stateShape records (#11216)
Fixes#10200
## Description
Updates the liveslots virtual object manager (VOM) to allow a new incarnation to add top-level fields to an existing kind stateShape, as long as they are clearly optional (consisting of a ["match:or" Pattern](https://endojs.github.io/endo/interfaces/_endo_patterns.PatternMatchers.html#or) in which at least one alternative is `undefined`) and regardless of `allowStateShapeChanges` configuration (i.e., they are allowed even when that setting is false, because they are backwards compatible).
### Security Considerations
Any code specifying a stateShape in which a field can be undefined is responsible for accommodating old values in which that field _is_ undefined.
The VOM state record field accessors are also updated to tolerate values missing in the backing store, but such a change is safe because those accessors only exist for known fields.
### Scaling Considerations
`buildRootObject` will be slower when the new stateShape does not match the old, because we will now be deserializing the old and serializing the old and new patterns for comparison. But stateShape records are not expected to be large.
### Documentation Considerations
None known.
### Testing Considerations
packages/swingset-liveslots/test/virtual-objects/state-shape.test.js should provide sufficient coverage, although exo-specific testing could also be added.
### Upgrade Considerations
New vat code can only take advantage of this with an updated liveslots, which should happen as part of vat upgrade anyway.
0 commit comments