-
Notifications
You must be signed in to change notification settings - Fork 215
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
feat(SwingSet): add "reachable" flag to clist entries #3130
Conversation
a5610f0
to
b2d073d
Compare
b2d073d
to
54dc27e
Compare
Previously, these two wrappers didn't provide the same functionality as their underlying HostStorage: you couldn't use empty strings for the start/end to get more keys. Also, add type assertions to crankBuffer to detect non-string keys/values earlier than commitCrank.
The kernel-to-vat clist entry for `kref` is stored in the kernelDB under a key of `${vatID}.c.${kref}` . This changes the value at that key from `${vref}` to `${flag} ${vref}`, where `flag` is either `R` (for "reachable and recognizable") or `_` (for "recognizable but not reachable). The "neither reachable nor recognizable" state simply deletes the clist entry altogether. This adds vatKeeper methods to set and clear the flag on a given kref. These will be used by the GC syscall handlers for dropImport and friends. closes #3108
54dc27e
to
4b843a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is ok, but I find the commingling of mapping with fiddling with the reachable flag in mapVatSlotToKernelSlot
and mapKernelSlotToVatSlot
not 100% obvious. Which is to say, I think I follow the logic of what these functions are doing here, but I'm not deeply confident this aligns with what we want. The code in this PR implements the possibility of setting/altering/querying the flags but doesn't (yet) include anything that makes use of this possibility, so it's hard to tell if the automagic affordances provided by the mapping functions are the ones we actually want (I find it entirely plausible that they are, since this code wasn't conceived in a vacuum, but it's not immediately self evident).
Fair point. I think the next stage of GC work, which will invoke those functions, will teach us more about what they ought to provide.. they might need to change when we see what |
The kernel-to-vat clist entry for
kref
is stored in the kernelDB under akey of
${vatID}.c.${kref}
. This changes the value at that key from${vref}
to${flag} ${vref}
, whereflag
is eitherR
(for "reachableand recognizable") or
_
(for "recognizable but not reachable). The "neitherreachable nor recognizable" state simply deletes the clist entry altogether.
This adds vatKeeper methods to set and clear the flag on a given kref. These
will be used by the GC syscall handlers for dropImport and friends.
It also cleans up some inconsistencies in the wrappers we put around the HostStorage API.
closes #3108