-
Notifications
You must be signed in to change notification settings - Fork 212
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
add vatPowers.disavow(presence) #2636
Comments
I spoke with @erights who didn't recoil in horror, but also wanted to make sure this didn't become an attractice nuisance. So I'm going to make the following changes:
In general I'm going to consider |
The new `vatPowers.disavow` doesn't do anything yet, but is at least exercised by test-liveslots.js The `enableDisavow` option is only available for static vats. The `endow` function cannot be enabled on dynamic vats. refs #2636, but won't close it until #2635 is implemented and `disavow()` routes into `syscall.dropImports()`
Vat code can now use `vatPowers.disavow(presence)` (if enabled for that vat), which will invoke `syscall.dropImports`. The kernel will delete the entry from the vat's c-list, however no further reference-count management will occur (that is scheduled for #2646). This should be enough to allow work to proceed on liveslots (using WeakRef and FinalizationRegistry) in parallel with kernel-side improvements. Note that referencing a disavowed object is vat-fatal, either as the target of a message, the argument of a message, or the resolution of a promise. closes #2635 closes #2636
The new `vatPowers.disavow` doesn't do anything yet, but is at least exercised by test-liveslots.js The `enableDisavow` option is only available for static vats. The `endow` function cannot be enabled on dynamic vats. refs #2636, but won't close it until #2635 is implemented and `disavow()` routes into `syscall.dropImports()`
Vat code can now use `vatPowers.disavow(presence)` (if enabled for that vat), which will invoke `syscall.dropImports`. The kernel will delete the entry from the vat's c-list, however no further reference-count management will occur (that is scheduled for #2646). This should be enough to allow work to proceed on liveslots (using WeakRef and FinalizationRegistry) in parallel with kernel-side improvements. Note that referencing a disavowed object is vat-fatal, either as the target of a message, the argument of a message, or the resolution of a promise. closes #2635 closes #2636
The new `vatPowers.disavow` doesn't do anything yet, but is at least exercised by test-liveslots.js The `enableDisavow` option is only available for static vats. The `endow` function cannot be enabled on dynamic vats. refs #2636, but won't close it until #2635 is implemented and `disavow()` routes into `syscall.dropImports()`
Vat code can now use `vatPowers.disavow(presence)` (if enabled for that vat), which will invoke `syscall.dropImports`. The kernel will delete the entry from the vat's c-list, however no further reference-count management will occur (that is scheduled for #2646). This should be enough to allow work to proceed on liveslots (using WeakRef and FinalizationRegistry) in parallel with kernel-side improvements. Note that referencing a disavowed object is vat-fatal, either as the target of a message, the argument of a message, or the resolution of a promise. closes #2635 closes #2636
What is the Problem Being Solved?
In #2635 I'll be adding a
syscall.dropImports([vrefs])
feature, initially a no-op, to enable more of the #2615 GC work to proceed in parallel. To test this feature across all vat runners (including XS, which doesn't support "raw"setup()
-based vats), I need a way for normal vat code to reliably trigger it.Description of the Design
I propose to add a
vatPowers.disavow(presence)
function. This would only appear invatPowers
if the vat was created withvatOptions.enableDisavow = true
, otherwise the function is omitted, and vats have no more authority than they did before.Calling
disavow(presence)
causes the following:syscall.dropImports([vref])
for the Presence's object ID.Presence was disavowed
(If this facility is not removed after we finish the GC task, a likely improvement would be to let
disavow
accept a non-default Error too, so real users could provide a hint as to why the Presence was disavowed).The mechanism I have in mind is for
disavow
to do the following:valToSlot
, throw error if not present.valToSlot
andslotToVal
entries.presence -> error
mapping in a new WeakMap, probably calleddisavowedPresences
fulfilledHandler
created duringmakeImportedPresence
, use theo
argument to look up the Presence indisavowedPresences
, if present, throw the error instead of callingqueueMessage
convertValToSlot
, after checkingvalToSlot
, and before callingexportPassByPresence
, we checkdisavowedPresences
, and throw the error if present.The primary purpose of this feature is for testing, but I'm wondering if it might be useful for something else long-term. It's sort of a complement to the object revocation feature (#2070), except on imports instead of exports. It has the same non-ocap-ish authority problem, except worse, because at least for object revocation there's a specific point at which the object was created (when we invoke
Far
), which gives us a place to return a revocation authority that's distinct from the reference/invocation authority you get by receiving theFar
/Remotable
/Presence
. To disavow an incomingPresence
, there's no obvious place where one party has any better claim than anyone else. So for lack of any better place to put it,vatPowers
seems like the least-wrong location (and it's disabled by default, the creator of the vat must opt the vat into having this thing).@erights I'd love to know how much this makes you cringe :) . If we decided it was too horrible to contemplate, I could test
syscall.dropImports
with a rawsetup
-style vat, at the cost of not having test coverage on the XS runner (and maybe manually hack something together as a one-off to get it working there). Once we get to the later stage of GC in which finalizers are working,syscall.dropImports
will be exercised by the GC tests. So we could either implementdisavow
now and then remove it once the finalizers are usable, or not implementdisavow
and survive with limited test coverage until that same point.cc @dtribble
The text was updated successfully, but these errors were encountered: