-
Notifications
You must be signed in to change notification settings - Fork 221
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: save PSM adminFacet in bootstrap #6101
Conversation
Additionally, the contractGovernor will now make the adminFacet available.
@@ -40,6 +40,15 @@ const sanitizePathSegment = name => { | |||
return candidate; | |||
}; | |||
|
|||
/** | |||
* There's an obsolete version in utils.d.ts |
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.
please put these updates there instead so there's one correct one and no incorrect ones.
type AdminFacet = {
getVatShutdownPromise: () => Promise<any>; // Completion, which is currently any
upgradeContract: (contractBundleId: string, newPrivateArgs: any) => void;
restartContract: (newPrivateArgs: any) => void;
};
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.
done
const creatorFacet = E(governorFacets.creatorFacet).getCreatorFacet(); | ||
|
||
psmInstanceR.resolve(governedInstance); | ||
psmInstanceR.resolve(await E(governorFacets.creatorFacet).getInstance()); |
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.
with all these facets, consider having a single entity in the space that is the result of zoe.startInstance
.
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.
yeah; we tried that... ran into problems around promises or something... the answer isn't obvious, so we agreed to defer.
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.
This looks like it does what we need for now.
@@ -281,6 +282,7 @@ const start = async (zcf, privateArgs) => { | |||
voteOnApiInvocation, | |||
voteOnOfferFilter: voteOnFilter, | |||
getCreatorFacet: () => limitedCreatorFacet, | |||
getAdminFacet: () => adminFacet, |
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.
This gave me some pause... we talked it over with @erights and agreed it's appropriate.
closes: #6100
Description
Save the PSM adminFacet from bootstrap. Also, the contractGovernor will now make the adminFacet available when other contracts need it.
Security Considerations
The admin facet is very powerful. The bootstrap environment is considered a secure context in which to hold powerful facets for the Econ Committee's use.
Documentation Considerations
None.
Testing Considerations
deferred to #6099.