-
Notifications
You must be signed in to change notification settings - Fork 214
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: plumb icqConnection
through orchestrate
facade
#9927
Conversation
@@ -88,6 +89,8 @@ export interface Chain<CI extends ChainInfo> { | |||
makeAccount: () => Promise<OrchestrationAccount<CI>>; | |||
// FUTURE supply optional port object; also fetch port object | |||
|
|||
query: CI extends { icqEnabled: true } ? ICQQueryFunction : never; |
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.
never
is maybe not correct here since all chain objects will have .query()
. If it's called and icqEnabled = false
, it will throw
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 right to me. It's saying that if icqEnabled
then .query
should have type never
and so never be used.
2fa9230
to
a3319b8
Compare
a3319b8
to
1c7ec01
Compare
f2a2895
to
a513b30
Compare
05eb6f0
to
63f0294
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.
I did a review. I'll make the request changes too.
@@ -89,20 +85,17 @@ export const prepareICQConnectionKit = (zone, { watch, when }) => | |||
}, | |||
/** | |||
* @param {JsonSafe<RequestQuery>[]} msgs | |||
* @returns {Promise<JsonSafe<ResponseQuery>[]>} | |||
* @throws {Error} if packet fails to send or an error is returned |
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.
too badd there's no @rejects
or whatever. Shouldn't this doc still inform the user of that?
@@ -107,6 +108,9 @@ const prepareLocalChainFacadeKit = ( | |||
this.facets.makeAccountWatcher, | |||
); | |||
}, | |||
query() { | |||
return asVow(() => Fail`not yet implemented`); |
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.
return asVow(() => Fail`not yet implemented`); | |
// TODO https://github.com/Agoric/agoric-sdk/pull/9935 | |
return asVow(() => Fail`not yet implemented`); |
if (!icqEnabled) { | ||
throw Fail`Queries not available for chain ${chainId}`; | ||
} | ||
// if none exists, make one + still send the query in the handler |
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 reads like "make (one + …)". it's only two chars:
// if none exists, make one + still send the query in the handler | |
// if none exists, make one and still send the query in the handler |
|
||
return makeCosmosOrchestrationAccount( | ||
chainAddress, | ||
// @ts-expect-error stakingDenom already asserted |
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.
not in this scope. things can run in unexpected orders. better to assert again.
packages/vow/src/tools.js
Outdated
@@ -18,7 +18,7 @@ import { makeWhen } from './when.js'; | |||
* @param {object} [powers] | |||
* @param {IsRetryableReason} [powers.isRetryableReason] | |||
*/ | |||
export const prepareVowTools = (zone, powers = {}) => { | |||
export const prepareVowToolsForTesting = (zone, powers = {}) => { |
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.
needs rebasing on master after #9932
8bf62d9
to
85a8fbf
Compare
- with the refactor of remote-chain-facade.js, sometimes the icqConn resolves before the account. this change ensures the first account in each test context is cosmos1test and not cosmos1test1
- ensure CosmosOrchestrationAccountKit is given icqConnection if chainConfig has icqEnabled - ensure Chain.query() sends queries if chainConfig has icqEnabled - lazily provideICQConnection on first request and cache result in state - refs: #9890
85a8fbf
to
8c28e67
Compare
- with #9927, the makeAccount flow might also involve making an ICQ connection. This change increases the timeout for makeAccount to account for the additional work/latency.
- with #9927, the makeAccount flow might also involve making an ICQ connection. This change increases the timeout for makeAccount to account for the additional work/latency.
- with #9927, the makeAccount flow might also involve making an ICQ connection. This change increases the timeout for makeAccount to account for the additional work/latency.
closes: #9890
Description
CosmosOrchAccount
is given anicqConnection
ifChainConfig.icqEnabled
is trueRemoteChainFacade
has.query()
method available[ ] ensuresee feat: plumbLocalChainFacade
has.query()
method availablelocalchain.queryMany
through orchestrate facade #9935Security Considerations
n/a
Scaling Considerations
n/a
Documentation Considerations
n/a
Testing Considerations
Includes unit tests. Multichain tests would be a nice addition, but I wouldn't consider them a blocker for the PR.
Upgrade Considerations
n/a, code is currently unreleased