-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(swingset): comms: add importer tracking
To support `dispatch.retireImport` (the "downstream" retirement that happens when a Remotable is dropped, and downstream importers need to be informed of the loss), the comms vat needs to know a list of the kernel and/or remotes which have imported an object that the comms vat has exported. The kernel currently implements this in a simple and non-performant way, by reading every vat's c-list for a matching entry. This makes lookups (which happen only when an upstream export is deleted) `O(numVats)`, but has no space penalty. #3223 is about making this faster. For now, the comms vat uses a differently-non-ideal approach: for each lref, it maintains a key with a JSON-serialized list of remotes. Adding, removing, and querying the importers are all is `O(numImporters)`, with a space penalty of one key per object, and `O(numImporters)` space for the values. A faster approach is implemented, but commented out, which uses distinct keys for each (remoteID, lref) pair. This is `O(1)` for all operations, with a space penalty of one key per import (and a constant-size value). However, this approach would require a non-existent `syscall.vatstoreGetKeys()` API, to iterate over vatstore keys. This wouldn't be hard to add, but we should consider our storage model more carefully before deciding to commit to that feature.
- Loading branch information
Showing
3 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters