-
Notifications
You must be signed in to change notification settings - Fork 74
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(exo): revocables #1666
feat(exo): revocables #1666
Conversation
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.
Looking good so far.
0d66c97
to
cb3717e
Compare
Closing in favor of #1668 |
3ec9ea5
to
b015165
Compare
a7e3119
to
ee06fe5
Compare
ee06fe5
to
9324013
Compare
6853197
to
48c04da
Compare
@michaelfig @FUDCo @warner , now that Chip is back, we should talk about this. In particular, the major design choice: should the unit of revocation be the facet or the cohort of facets? |
48c04da
to
b561076
Compare
@FUDCo and I discussed the main controversy, and decided that revoking a facet revokes just the facet, not the cohort. This PR does not yet reflect that decision. |
f39f187
to
2636eca
Compare
7035ea0
to
905bf51
Compare
It does now. |
323a28f
to
0ea5cb5
Compare
Reviewers, ping. @kriskowal is gearing up to make a new endo release. I'd like to get this in there, because agoric-sdk needs to be able to depend on it in order to proceed with the work there to support the same feature for virtual/durable exos. Thanks. |
0ea5cb5
to
7ccc14e
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.
LGTM. Please choose between my two suggestions for more clearly specifying what you mean by object
.
7ccc14e
to
c9bcb8c
Compare
Background: Exos already have a level of indirection between the exposed method with the protective method guard vs the raw method. In order to enable prototype-based method sharing of the protective methods, they lookup the context from their
this
, which is the exo object itself. The context is then passed as thethis
to the raw method. Having paid for this level of indirection, we already use it for many benefits, like enforcing that the exposed methods cannot be applied to unrelated instances.An additional benefit we can obtain from this indirection is revocation. However, creating a revocable exo is the odd case. We don't want the normal case to pay an undue notational cost to accommodate the odd case, even if that raises the notational cost of the odd case a bit. We do so by allowing an additional
getRevoker
option, which is called with arevoke
function to be called with the exo to be revoked as an argument.This seems unduly higher order. But the
getRevoker
option is directly analogous to theexecutor
argument of the promise constructor, which is called with aresolve
function to be called with a resolution.This is motivated by the benefits of direct support for revocation for exos at the liveslots level, which needs a parallel implementation of exactly the same options with the same observable semantics. At the liveslots level, the benefits would be
Once this support is uniform across heap exos (from this PR) and virtual and durable exos ( Agoric/agoric-sdk#8020 , Agoric/agoric-sdk#8008 ), then perhaps zones can mirror this universal support. Further, zones themselves could conceivably absorb the revocation support, to provide batch revocation according to creating zone.