-
Notifications
You must be signed in to change notification settings - Fork 226
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 bulk-storage API for vats #512
Comments
@FUDCo added These should be methods on the |
Strawman API: function buildRootObject(vatPowers) {
const { vatStore } = vatPowers;
function method(args) {
vatStore.set('key', 'value');
vatStore.delete('otherkey');
return vatStore.get('key2');
}
} strawman implementation (code added to liveSlots.js): // give user-level code access to a prefixed subset of the vatstore
function userKey(key) {
return `u.${key}`;
}
const vatStore = {
get: (key) => syscall.vatstoreGet(userKey(key)),
set: (key, value) => syscall.vatstoreSet(userKey(key), value),
delete: (key) => syscall.vatstoreDelete(userKey(key)),
};
const rootObject = buildRootObject(
harden({ D, exitVat, exitVatWithFailure, vatStore, ...vatPowers }),
harden(vatParameters),
); Questions:
|
This is made visible to (some) vats on I think that's enough to close this. Changes we might want to make in the future:
|
To move large Vat's storage needs from RAM to disk, it would be nice if Vats had some sort of storage API to the kernel. This could be a per-vat disk-resident key-value store provided directly by the kernel, or implemented in some device that vats can reach with existing syscalls.
(it's also worth considering simply running each vat in a separate process, and let the normal OS virtual-memory paging system take care of the problem, however Node.js frequently enforces a 1.5GB maximum heap size, which will limit our ability to use it)
I'm personally inclined to make this be a
get/set/delete
syscall API, specified to be persisted coherently with cranks/blocks by the kernel and host loops. But I know @dtribble felt it should be managed by a distinct device, rather than the kernel.In either case, the
get
API requires a synchronous return value in the syscall, which is a drag.The text was updated successfully, but these errors were encountered: