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

store Zoe state in durable/virtual objects/collections #4383

Closed
warner opened this issue Jan 25, 2022 · 5 comments · Fixed by #5997
Closed

store Zoe state in durable/virtual objects/collections #4383

warner opened this issue Jan 25, 2022 · 5 comments · Fixed by #5997
Assignees
Labels
enhancement New feature or request vaults_triage DO NOT USE Zoe package: Zoe

Comments

@warner
Copy link
Member

warner commented Jan 25, 2022

What is the Problem Being Solved?

To allow Zoe to maintain low RAM usage despite being involved in every contract, as well as to enable Zoe to be upgraded, we need it to store all long-term state using makeDurableKind and virtual/durable collections.

I don't know exactly what state Zoe uses. I know there are a lot of Offers and Seats and Invitations and stuff. As a first step, I'm guessing that each of these needs to be converted into a virtual-object Kind, and any collections of them need to be stored in a virtual-collection using something like makeBigWeakMap. Performing this translation/porting is probably the bulk of the work.

A small step is to then switch to Durable objects/collections instead of merely Virtual ones, for the state that needs to survive an upgrade.

Then a medium step is to record all the collection objects (and handles to the Kinds that must survive) in the #4325 "baggage", so the new Zoe version can retrieve it.

Another large design question is what state ought to survive the upgrade (kept in Durable storage), and what can be discarded (kept in Virtual storage). And what clients will experience during the process. The simplest approach is to just store everything in Durable, but @erights points out that vats and contracts should be more deliberate about their upgrade process.

Description of the Design

Security Considerations

Test Plan

@warner warner added enhancement New feature or request Zoe package: Zoe MN-1 labels Jan 25, 2022
@Tartuffo Tartuffo added the restival to be done before RUN Protocol Purple Team festival label Feb 7, 2022
@Tartuffo
Copy link
Contributor

Tartuffo commented Feb 7, 2022

@Chris-Hibbert Assigning to you per the conversation in today's Eng Sync, please put an estimate on it once you have scoped out the task.

@Tartuffo Tartuffo removed the MN-1 label Feb 7, 2022
@Chris-Hibbert
Copy link
Contributor

Here's a Catalog of Zoe's storage. It lists 1 WeakSet, 9 WeakStores, and 2 Native Sets. I see at least 3 objects (instanceAdmin, ZoeSeatAdmin, IssuerRecord) that must be converted to virtual objects. The other values to be stored may be handles or presences.

sumsByBrand is ephemeral and doesn't need to be persisted.

@dckc
Copy link
Member

dckc commented Feb 8, 2022

in #4324 (comment) , @warner writes:

This depends upon finishing #2004 and #4255, to provide the virtual/durable collections API in a form that Zoe/etc can use to hold Purses/Payments/other-high-cardinality-things on disk instead of in the heap.

(note that to allow these vats to be upgraded without losing their data, we also need #4325 and for Zoe/etc to store their durable collections in it)

@Tartuffo Tartuffo removed the restival to be done before RUN Protocol Purple Team festival label Feb 8, 2022
@Tartuffo
Copy link
Contributor

Tartuffo commented Feb 8, 2022

Per conversation with @dtribble Chris does not need to prioritize this for Restival.

@Tartuffo
Copy link
Contributor

Tartuffo commented Apr 6, 2022

Likely people to pick this up if @erights doesnt have the bandwidth to do this in the MN-1 timeframe: @Chris-Hibbert and @turadg

Chris-Hibbert added a commit that referenced this issue Oct 4, 2022
refs: #4383

The datastore diagram was created in Miro:
https://miro.com/app/board/uXjVPR6j4Nc=/?share_link_id=559329933746

The others are .puml rendered to png.

These diagrams show the state of Zoe and ZCF as of 2022/10/1. I expect
to update them as I finish the conversion to durability.

The datastore diagram shows which objects and stores are accessible to
Zoe or to ZCF, and which are shared.

The sequence diagrams show the order in which the various objects are
created, passed between the vats, and when promises are resolved.
mergify bot added a commit that referenced this issue Oct 19, 2022
…6389)

* docs: a set of diagrams on Zoe and Zcf datastores and initialization

refs: #4383

The datastore diagram was created in Miro:
https://miro.com/app/board/uXjVPR6j4Nc=/?share_link_id=559329933746

The others are .puml rendered to png.

These diagrams show the state of Zoe and ZCF as of 2022/10/1. I expect
to update them as I finish the conversion to durability.

The datastore diagram shows which objects and stores are accessible to
Zoe or to ZCF, and which are shared.

The sequence diagrams show the order in which the various objects are
created, passed between the vats, and when promises are resolved.

* docs: updates to Zoe-ZCF dataStores miro diagram

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
dtribble pushed a commit that referenced this issue Oct 24, 2022
…6389)

* docs: a set of diagrams on Zoe and Zcf datastores and initialization

refs: #4383

The datastore diagram was created in Miro:
https://miro.com/app/board/uXjVPR6j4Nc=/?share_link_id=559329933746

The others are .puml rendered to png.

These diagrams show the state of Zoe and ZCF as of 2022/10/1. I expect
to update them as I finish the conversion to durability.

The datastore diagram shows which objects and stores are accessible to
Zoe or to ZCF, and which are shared.

The sequence diagrams show the order in which the various objects are
created, passed between the vats, and when promises are resolved.

* docs: updates to Zoe-ZCF dataStores miro diagram

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
@rowgraus rowgraus added vaults_triage DO NOT USE and removed MUST-HAVE labels Dec 20, 2022
@mergify mergify bot closed this as completed in #5997 Dec 20, 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 vaults_triage DO NOT USE Zoe package: Zoe
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants