Skip to content
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): lightweight inter-facet rights amplification #1902

Merged
merged 2 commits into from
Dec 31, 2023

Conversation

erights
Copy link
Contributor

@erights erights commented Dec 18, 2023

towards: Agoric/agoric-sdk#8664
refs: #1666

Description

Adds a receiveAmplifier option to definedExoClassKit to parallel the existing receiveRevoker. The amplifier function you receive is a two argument function of aFacet and a facetName. If aFacet is an unrevoked facet instance of a cohort of that exo class kit, and facetName is the name of a facet column of that exo class kit, then the named element of aFacet's cohort is returned.

See Agoric/agoric-sdk#8664 for more explanation.

This PR does not by itself finish Agoric/agoric-sdk#8664 . Rather, we need to wait for an endo release incorporating this PR followed by an agoric-sdk-endo sync before we can get started implementing this same feature for virtual and durable class kits.

Security Considerations

As explained at Agoric/agoric-sdk#8664 , this makes one particular pattern of rights amplification easier to express, and more auditable when expressed in this manner.

This is in contrast to systems like JS's or Joe-E class-private instance variables, where inter-instance intra-class amplification is implicit and easy to overlook in a review.

Scaling Considerations

As explained at Agoric/agoric-sdk#8664 , this avoids the need for the additional weak store that would otherwise be needed to express such rights amplification, without losing the explicitness of the separate weak store.

Documentation Considerations

Yet another thing to document. But should probably wait until Agoric/agoric-sdk#8664 is closed, i.e., until the feature is available for virtual and durable exo kits. Probably should wait until revocability is as well, and then both should be documented together.

Testing Considerations

Should enable more secure "jig" testing, where an exo class kit also defines a facet to be used for privileged testing/debugging, and the testing framework is, somehow, endowed with the needed amplifier. We would still need to figure out how to wire that up so the amplifier cannot otherwise be obtained or used.

Upgrade Considerations

Assuming that implementing this feature for virtual and durable exos is similar and as straightforward, this PR should not cause any change to virtual or durable state, enabling exo class kit instance state defined without amplifiers (likewise revokers) to be upgraded into an exo class kit which does.

@erights erights requested review from kriskowal and mhofman December 18, 2023 22:14
@erights erights self-assigned this Dec 18, 2023
@erights erights force-pushed the markm-8664-receive-amplifier branch from d6e9229 to cd9ae8c Compare December 18, 2023 22:22
@erights erights force-pushed the markm-8664-receive-amplifier branch from cd9ae8c to ee02840 Compare December 19, 2023 01:26
Copy link
Member

@kriskowal kriskowal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rely on @mhofman’s review since he has a better grasp of the acceptance criteria. I read this closely enough to grasp what it does and I don’t see defects.

packages/exo/test/test-amplify-heap-class-kits.js Outdated Show resolved Hide resolved
packages/exo/test/test-amplify-heap-class-kits.js Outdated Show resolved Hide resolved
@erights
Copy link
Contributor Author

erights commented Dec 20, 2023 via email

@erights erights force-pushed the markm-8664-receive-amplifier branch from c630268 to bf29a3a Compare December 21, 2023 03:25
@erights erights merged commit 3e9e0dd into master Dec 31, 2023
14 checks passed
@erights erights deleted the markm-8664-receive-amplifier branch December 31, 2023 01:47
@mhofman
Copy link
Contributor

mhofman commented Jan 2, 2024

In the kernel meeting a couple weeks ago, we discussed having the shape of this rights amplification function be a simple function that accepts a facet, and returns the cohort. I think I preferred that shape vs taking a facet name, but I do realize I didn't capture that feedback in this pull request.

@erights
Copy link
Contributor Author

erights commented Jan 3, 2024

In the kernel meeting a couple weeks ago, we discussed having the shape of this rights amplification function be a simple function that accepts a facet, and returns the cohort. I think I preferred that shape vs taking a facet name, but I do realize I didn't capture that feedback in this pull request.

Quite right. See #1924

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants