-
Notifications
You must be signed in to change notification settings - Fork 208
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(base-zone):zone.watchPromise
#9321
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.
Thank you so so much. This is much cleaner.
I look forward to simplifying asyncFlow using this!
packages/vow/README.md
Outdated
The `@agoric/vat-data/vow.js` module allows Zones to integrate Agoric's vat | ||
upgrade mechanism. To create vow tools that deal with durable objects: |
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.
Is vat-data/vow.js
this still useful, or should one now only import from @agoric/base-zone and @agoric/vow ?
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've added @agoric/vow/vat.js
to take a direct dependency on @agoric/internal
(to identify SwingSet vat-upgrade promise rejections). Unfortunately, if @agoric/vow
becomes @endo/vow
, that will create a circular dependency with the Agoric SDK.
Any suggestions?
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.
Sigh. Not at the present time. I'd be happy to see this merged with this issue + a TODO and/or filed issue explaining it, and then to cross that bridge when we migrate it.
Deploying agoric-sdk with Cloudflare Pages
|
08be4b1
to
5da473f
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
@@ -79,6 +83,7 @@ export const makeVirtualZone = (baseLabel = 'virtualZone') => { | |||
subZone: wrapProvider(makeSubZone), | |||
|
|||
makeOnce, | |||
watchPromise, |
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 probably should put as a caveat that this implementation is not "virtual" in the sense that it will have a heap cost keeping the watcher in the heap. In theory this should use the liveslots provided watchPromise
, but there seems to be a bug there where providing a virtual watcher is not in fact supported.
refs: #9321 ## Description Update the preferred way of using SwingSet vat-compatible vows to import `@agoric/vow/vat.js`. Also, as a drive-by in `@agoric/vow`, avoid `import('./file.js').Type` in favour of the `@import {Type} from './file.js'` Typescript 5.5 syntax. ### Security Considerations Doesn't change any code semantics. ### Scaling Considerations n/a ### Documentation Considerations `@agoric/vat-data/vow.js` is still available, as an alias for `@agoric/vow/vat.js`. ### Testing Considerations n/a ### Upgrade Considerations No change in code functionality.
Staged on #9097 closes: #XXXX refs: #9231 #9321 #9329 #9097 ## Description Now that `watchPromise` is abstracted over zones and vows make use of that, we can simplify the test cases a lot. Should be a pure refactor with no externally observable effect. ### Security Considerations none ### Scaling Considerations none ### Documentation Considerations none ### Testing Considerations tests simpler. Otherwise, none ### Upgrade Considerations none
Staged on #9097 closes: #XXXX refs: #9231 #9321 #9329 #9097 ## Description Now that `watchPromise` is abstracted over zones and vows make use of that, we can simplify the test cases a lot. Should be a pure refactor with no externally observable effect. ### Security Considerations none ### Scaling Considerations none ### Documentation Considerations none ### Testing Considerations tests simpler. Otherwise, none ### Upgrade Considerations none
closes: #9231
Description
Make
zone.watchPromise
available for all zones, only overridden by the durable zone. This provides a way forzone.exo*
makers and methods to use awatchPromise
that is compatible with their backing zone.Security Considerations
Doesn't do anything already possible via
VatData.watchPromise
orE.when
.Scaling Considerations
Nothing outside of
VatData.watchPromise
andE.when
.Documentation Considerations
Zones need to be documented more thoroughly at some point, probably via TSDocs.
Testing Considerations
Will be tested as part of asyncFlow.
Upgrade Considerations
The usual.