Conversation
Deploying agoric-sdk with
|
| Latest commit: |
6b41829
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c7aaa4c8.agoric-sdk.pages.dev |
| Branch Preview URL: | https://9449-membrane-vows.agoric-sdk.pages.dev |
be1b9e8 to
7aa206d
Compare
7aa206d to
7bf6edf
Compare
erights
left a comment
There was a problem hiding this comment.
Only reviewed asyncFlow changes so far. More soon...
| @@ -154,14 +154,9 @@ export const makeReplayMembrane = ({ | |||
| const passStyle = passStyleOf(h); | |||
There was a problem hiding this comment.
I love that we can now stop tolerating host promises and instead reject them with errors!
However, this leaves the doc-comment above and the function name tolerate* stale. Please revise to be consistent either with consistent rejection, or at least as the function which decides whether to tolerate or to reject. I don't have a name to suggest.
There was a problem hiding this comment.
Ok to fully remove tolerateHostPromiseToVow? I was trying to be surgical because I didn't know if you needed it to be there.
| export type GuestOf<F extends HostAsyncFuncWrapper> = F extends ( | ||
| ...args: infer A | ||
| ) => Vow<infer R> | ||
| ? (...args: A) => Promise<R> | ||
| : F; |
There was a problem hiding this comment.
Wow!
Thanks for translating all those type declarations into better .d.ts types.
There was a problem hiding this comment.
tsc did the work! yarn prepack
0xpatrickdev
left a comment
There was a problem hiding this comment.
Nice work 👏
async-flow/src/types.d.ts#L118-L252 is foreign to me but seems like its mostly porting things from js to ts
| // XXX makeAccount returns a Promise for an exo but reserves being able to return a vow | ||
| // so we use heapVowE to shorten the promise path | ||
| // eslint-disable-next-line no-restricted-syntax -- will run in one turn | ||
| allVows([lcaP, heapVowE(lcaP).getAddress()]), |
There was a problem hiding this comment.
I'm surprised we need to reach for heapVowE here. Original E + pipelining should work, since lcaP is a Promise and not a Vow. There's a test demonstrating the behavior mentioned in: #9591 (comment)
Maybe we need to improve the ah allVows type?E doesn't understand PromiseVow. Still, seems like it's maybe a type issue and we shouldn't need heapVowE
There was a problem hiding this comment.
I tried to explain this in the comment. The value actually being returned is not a vow, but the return signature says it could be. @michaelfig wanted to reserve that option for the future. So this code should comply. (i.e. not to accelerate Hyrum's Law).
There was a problem hiding this comment.
That makes sense, thanks
| * in the {@link CurrentWalletRecord} in vstorage. | ||
| */ | ||
| getPublicTopics: () => Promise<TopicsRecord>; | ||
| getPublicTopics: () => Promise<Record<string, ResolvedPublicTopic<unknown>>>; |
There was a problem hiding this comment.
Nice. Consider exporting a ResolvedTopicsRecord from zoe/contractSupport/topics.js
| | 'Done'; | ||
|
|
||
| /** | ||
| * `T` defaults to `any`, not `Passable`, because unwrapped guests include |
There was a problem hiding this comment.
Realize this is an existing comment, but consider an @internal directive
There was a problem hiding this comment.
when I added it there was a jsdoc lint error the tag should be empty
There was a problem hiding this comment.
There was a problem hiding this comment.
#9690 fixes the lint error. I'm still not sure whether this should be @internal.
| type HostInterface<T> = { | ||
| [K in keyof T]: HostOf<T[K]>; | ||
| }; | ||
|
|
There was a problem hiding this comment.
Nice work on these. Do we also need a GuestInterface?
There was a problem hiding this comment.
When we define an interface it should be in the view of the guest.
| return watch(h); | ||
| const e = Error('where promise detected'); | ||
| console.error('vow expected, not promise', h, e); | ||
| throw e; |
| */ | ||
|
|
||
| /** | ||
| * A {PublicTopic} in which the `storagePath` is a string. |
There was a problem hiding this comment.
Maybe add a why to one of the Resolved* types
| * A {PublicTopic} in which the `storagePath` is a string. | |
| * A {PublicTopic} in which the `storagePath` is a string. | |
| * Useful when working with Vows and async-flow. |
There was a problem hiding this comment.
good idea. we can use more "what this is for"
| }); | ||
|
|
||
| /** @type {{ [name: string]: [description: string, valueShape: Pattern] }} */ | ||
| /** @type {{ [name: string]: [description: string, valueShape: Matcher] }} */ |
There was a problem hiding this comment.
Why change the type from Pattern to Matcher? Do you intend to exclude other patterns that are not themselves matchers, even if they contain matchers?
Likewise for other similar changes
There was a problem hiding this comment.
Why change the type from Pattern to Matcher?
because makeRecordKit accepts only a Matcher for the valueShape:
agoric-sdk/packages/zoe/src/contractSupport/recorder.js
Lines 148 to 149 in 4d54c56
Do you intend to exclude other patterns that are not themselves matchers, even if they contain matchers?
For now.
agoric-sdk/packages/zoe/src/contractSupport/recorder.js
Lines 261 to 271 in 4d54c56
There was a problem hiding this comment.
Pattern is no longer any (thanks to you IIRC)
@typedef {Exclude<Passable, Error | Promise>} Pattern
| }); | ||
|
|
||
| /** @type {{ [name: string]: [description: string, valueShape: Pattern] }} */ | ||
| /** @type {{ [name: string]: [description: string, valueShape: Matcher] }} */ |
now in packages/async-flow
86e05ae to
f10c9c1
Compare
|
@Mergifyio requeue main |
✅ The queue state of this pull request has been cleaned. It can be re-embarked automatically |
|
@Mergifyio queue main |
🛑 The pull request has been removed from the queue
|
|
@Mergifyio requeue main |
☑️ This pull request is already queued |
|
This is failing only on getting-started link-cli because of a |
mhofman
left a comment
There was a problem hiding this comment.
There is one behavioral change in this PR, and it is problematic
| const { remoteChainInfo, connectionInfo } = this.state; | ||
| const stakingDenom = remoteChainInfo.stakingTokens?.[0]?.denom; | ||
| if (!stakingDenom) { | ||
| return asVow(Fail`chain info lacks staking denom`); |
There was a problem hiding this comment.
This will not do what you expect, and throw an error instead of returning a rejected vow
There was a problem hiding this comment.
should have been this?
| return asVow(Fail`chain info lacks staking denom`); | |
| return asVow(() => Fail`chain info lacks staking denom`); |
There was a problem hiding this comment.
That would work but I'm not sure why this PR removed the surrounding asVow in the first place.
There was a problem hiding this comment.
I the assume bug is that Fail throws immediately here instead of propoagating as a vow?
What's a good way to catch this in a test? When reviewing this, I made similar edits to cosmos-orch-acct and didn't see any of these tests break:
agoric-sdk/packages/orchestration/test/examples/stake-ica.contract.test.ts
Lines 246 to 261 in 24528f1
The above does not go through the membrane, though. Would the membrane catch this? On my short list to test.
There was a problem hiding this comment.
didn't see any of these tests break
yeah, we need breaking tests. Addressing in #9696
follow up on #9449 ## Description #9685 unwrapped an `asVow()` to get the promise failure to propagate. This reverts that now that #9704 removed the need for it. ### Security Considerations none ### Scaling Considerations none ### Documentation Considerations none ### Testing Considerations CI ### Upgrade Considerations not yet deployed
closes: #9449
Description
Address all the FIXMEs about types and vows in Orchestration. To do so I moved some stuff down to async-flow and zoe packages. I also made some small fixes in smart-wallet.
I believe this ticks the last box of #9449.
Security Considerations
none
Scaling Considerations
none
Documentation Considerations
none
Testing Considerations
This adds type tests and I used
type-coverageto verify no regressions.Upgrade Considerations
orchestration and async-flow not yet deployed.
The changes in zoe and smart-wallet are just typedefs so safe to deploy anytime.