-
Notifications
You must be signed in to change notification settings - Fork 219
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
make Zoe durable #5997
make Zoe durable #5997
Conversation
575fd50
to
e989f7f
Compare
e989f7f
to
350b919
Compare
e63d04d
to
c3010a4
Compare
58d46cf
to
86dcfcc
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.
Review so far. I got through all of zcf and everything but zoe itself. Of course, zoe is where the action is, so it will still take significant time to complete.
High level comment so far: I don't understand why zcf needed such radical surgery, since coveredCall-durable.js
already demonstrates that zcf is upgradable. If we really were saving all the precious semantic state that the successor needs to revivify a working zcf, then the additional durable things seem like a distraction.
b5c2470
to
3a8498c
Compare
This is an important question. The original Zoe and ZCF shared some state using Promises and bags of functions. It's no longer possible for Zoe to hold onto a loose function, so some things that didn't have to be durable object for the ZCF upgrade case have to be durable In order for Zoe to hold onto them. |
eac2982
to
dc22548
Compare
This review pass done. |
7ebfd2d
to
8137369
Compare
8137369
to
2c41f06
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.
Just that one remaining issue in the declaration of BundleShape
.
LGTM!
packages/zoe/src/typeGuards.js
Outdated
export const BundleShape = M.and( | ||
M.partial({ moduleFormat: M.string() }), | ||
M.recordOf(M.string(), M.string()), | ||
); |
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 was more correct before literally taking @kriskowal 's advice.
- @Chris-Hibbert , We still need the
{ stringLengthLimit: Infinity }
to evade the limit check, right? - @kriskowal ,
M.partial
is deprecated in favor ofM.splitArray
andM.splitRecord
. - @kriskowal , By using
M.partial
you're saying thatmoduleFormat
is optional, as did the old code when the first argument tosplitRecord
washarden({})
. But your prose says it is mandatory. Assuming it is mandatory, I removed that first argument tosplitRecord
below.
So, does the following look right?
export const ModuleFormatBundleShape = M.splitRecord(
harden({ moduleFormat: M.any() }),
);
export const BundleShape = M.and(ModuleFormatBundleShape, SourceBundleShape);
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.
(just edited my suggested code from M.or
to M.and
)
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.
We still need the { stringLengthLimit: Infinity } to evade the limit check, right?
I believe so. It's still in SourceBundleShape
. I don't think it's necessary anywhere else.
export const SourceBundleShape = M.recordOf(
M.string(),
M.string({ stringLengthLimit: Infinity }),
);
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 pushed this change, and tests are passing now.
@kriskowal with your agreement that this change is correct, I'll merge this PR.
packages/zoe/src/typeGuards.js
Outdated
export const SourceBundleShape = M.recordOf( | ||
M.string(), | ||
M.string({ stringLengthLimit: Infinity }), | ||
); | ||
export const ModuleFormatBundleShape = M.splitRecord( | ||
harden({ moduleFormat: M.any() }), | ||
); | ||
export const BundleShape = M.and(ModuleFormatBundleShape, SourceBundleShape); |
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.
export const SourceBundleShape = M.recordOf( | |
M.string(), | |
M.string({ stringLengthLimit: Infinity }), | |
); | |
export const ModuleFormatBundleShape = M.splitRecord( | |
harden({ moduleFormat: M.any() }), | |
); | |
export const BundleShape = M.and(ModuleFormatBundleShape, SourceBundleShape); | |
export const BundleShape = M.and( | |
M.splitRecord(harden({ moduleFormat: M.string() })), | |
M.recordOf( | |
M.string(), | |
M.string(harden({ stringLengthLimit: Infinity })), | |
), | |
); |
How does splitRecord
differ from partial
? Is harden
necessary there in a way that would apply equally to M.string
’s arg?
The bundle shape described in this way applies equally well to source bundles and hash bundles, so the intermediate names are not useful. If we wish to cut finer distinctions, we’ll need shapes for SourceBundle
and HashBundle
that are the union of supported formats in each case. HashBundle is of the form { moduleFormat: 'endoZipBase64Sha512', endoZipBase64Sha512: string }
and SourceBundle is one of { moduleFormat: 'getExports', source: string }
, { moduleFormat: 'nestedEvaluate', source: string }
, or { moduleFormat: 'endoZipBase64', endoZipBase64: string, endoZipBase64Sha512?: string }
.
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 switched to this simplified BundleShape
, and used it in all the places BundleShape
or SourceBundleShape
appeared. I'll merge like this.
b0864f0
to
ad36f3c
Compare
closes: #4383
refs: #6502
Description
Make Zoe durable.
The prior version passed around many bundles of functions. Those had to be converted to durable facets to be passable.
Security Considerations
Pervasive
Documentation Considerations
seat notifiers (which notified on interim allocations) have been dropped and replaced with a subscriber that only notifies when the seat exits.
The way feeMintAccess is obtained changed.
The methods that allowed requests for internal allocation state (
getCurrentAllocationJig
) has been dropped. Many of the clients can usegetFinalAllocation()
instead.zoe.bindDefaultFeePurse
,zoe.makeFeePurse
, andzcf.assert()
were dropped.Testing Considerations
Test timing changed in some cases, since Promises can no longer be used.