Skip to content
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

Merged
merged 6 commits into from
Aug 22, 2024

Conversation

0xpatrickdev
Copy link
Member

@0xpatrickdev 0xpatrickdev commented Aug 19, 2024

closes: #9890

Description

Security 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

Copy link

cloudflare-workers-and-pages bot commented Aug 19, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8c28e67
Status:🚫  Build failed.

View logs

@@ -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;
Copy link
Member Author

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

Copy link
Member

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.

@0xpatrickdev 0xpatrickdev force-pushed the 9890-queries-in-orchestrate branch 5 times, most recently from 2fa9230 to a3319b8 Compare August 21, 2024 15:23
@0xpatrickdev 0xpatrickdev changed the base branch from master to mfig-vows-default-to-swingset August 21, 2024 15:23
@0xpatrickdev 0xpatrickdev force-pushed the 9890-queries-in-orchestrate branch from a3319b8 to 1c7ec01 Compare August 21, 2024 16:00
@0xpatrickdev 0xpatrickdev marked this pull request as ready for review August 21, 2024 16:33
@michaelfig michaelfig force-pushed the mfig-vows-default-to-swingset branch from f2a2895 to a513b30 Compare August 21, 2024 17:51
@turadg turadg self-assigned this Aug 21, 2024
@michaelfig michaelfig force-pushed the mfig-vows-default-to-swingset branch from 05eb6f0 to 63f0294 Compare August 21, 2024 19:10
Copy link
Member

@turadg turadg left a 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
Copy link
Member

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`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Member

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:

Suggested change
// 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
Copy link
Member

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.

@@ -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 = {}) => {
Copy link
Member

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

@turadg turadg force-pushed the 9890-queries-in-orchestrate branch from 8bf62d9 to 85a8fbf Compare August 21, 2024 19:50
@turadg turadg added the automerge:rebase Automatically rebase updates, then merge label Aug 21, 2024
Base automatically changed from mfig-vows-default-to-swingset to master August 21, 2024 21:08
- 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
@0xpatrickdev 0xpatrickdev force-pushed the 9890-queries-in-orchestrate branch from 85a8fbf to 8c28e67 Compare August 22, 2024 02:10
@mergify mergify bot merged commit 6d97bc4 into master Aug 22, 2024
79 of 80 checks passed
@mergify mergify bot deleted the 9890-queries-in-orchestrate branch August 22, 2024 03:31
0xpatrickdev added a commit that referenced this pull request Aug 27, 2024
- 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.
0xpatrickdev added a commit that referenced this pull request Aug 27, 2024
- 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.
0xpatrickdev added a commit that referenced this pull request Aug 27, 2024
- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:rebase Automatically rebase updates, then merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

execute queries in orchestrate async-flow
2 participants