Agoric / agoric-sdk

monorepo for the Agoric Javascript smart contract platform
Apache License 2.0
326 stars 206 forks source link

kernel storage scalability #513

Open warner opened 4 years ago

warner commented 4 years ago

The Swingset kernel must be able to handle millions of objects and messages. It should also be able to restart from saved state in a reasonable amount of time.

As described in https://github.com/Agoric/agoric-sdk/issues/54#issuecomment-567262976 , we have roughly 8 tables that will grow with the number of objects and/or messages that have ever been seen. This ticket tracks our progress towards moving all of these to disk, so our RAM footprint is proportional to the size of a single message, rather than the number of all objects that have ever been created (i.e. "1Z").

The kernel-side c-lists and tables will be addressed by #254 (switching to a HostDB at all) and #54, when the in-memory HostDB is replaced by a proper (synchronous) on-disk database. This will also take care of the storage space for the transcripts. However restart will still have to replay all of those messages, so it won't run "in a reasonable amount of time" until we also have heap snapshots (#511).

The vat-side Presences/Purses and Maps (Presence to/from import IDs, and Object to/from export IDs) may be addressed by #455 (hierarchical object IDs), but also require some form of not-yet-invented bulk storage API (#512) by which vats can ask the kernel (and/or some device) to hold key/value tables on disk.

The Comms Vat's c-lists will require that same bulk-storage API (#512).

warner commented 4 years ago

In addition to reducing the table entries that track callable objects, we must also delete entries for Promises that have been resolved. #675 tracks this one.