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

getConnectionInfo by obj (or string) #9494

Closed
wants to merge 0 commits into from
Closed

Conversation

turadg
Copy link
Member

@turadg turadg commented Jun 12, 2024

incidental

Description

It seemed a little silly that we always have to deference .chainId. This does that within the getConnectionInfo call.

It also adds a getChainsAndConnection helper. It's outside of the ChainHub object to keep that surface minimal.

Should we also do it in registerConnection?

Have a helper to do it every chainId param?

Security Considerations

none

Scaling Considerations

none

Documentation Considerations

none

Testing Considerations

Covered already

Upgrade Considerations

none

@turadg turadg requested review from dckc and 0xpatrickdev June 12, 2024 14:35
@turadg turadg changed the base branch from master to 9063-make-account June 12, 2024 14:35
Copy link

cloudflare-workers-and-pages bot commented Jun 12, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7921211
Status: ✅  Deploy successful!
Preview URL: https://ce8201dc.agoric-sdk.pages.dev
Branch Preview URL: https://ta-chain-lookup-flex.agoric-sdk.pages.dev

View logs

Copy link
Member

@0xpatrickdev 0xpatrickdev left a comment

Choose a reason for hiding this comment

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

This feels more ocappy. Do we have any considerations or concerns around or increased message sizes? I guess it's all in the same vat so not a concern?

Comment on lines 23 to 24
ordering: 1 /* Order.ORDER_UNORDERED */,
state: 3 /* IBCConnectionState.STATE_OPEN */,
Copy link
Member

@0xpatrickdev 0xpatrickdev Jun 12, 2024

Choose a reason for hiding this comment

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

Tangential to the PR - i think it would read better in vstorage if we used ORDER_UNORDERED and STATE_OPEN strings instead of integers

Copy link
Member Author

Choose a reason for hiding this comment

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

agreed

Base automatically changed from 9063-make-account to master June 12, 2024 16:37
@turadg
Copy link
Member Author

turadg commented Jun 12, 2024

I guess it's all in the same vat so not a concern?

Right.

Any outstanding concerns? WDYT of the questions posed in the description?

Comment on lines 50 to 53
const [_, osmosis, connectionInfo] = await getChainsAndConnection(
chainHub,
'agoric',
'osmosis',
Copy link
Member

Choose a reason for hiding this comment

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

Great addition 👏 .

Noting that this doesn't help limit roundtrips for scenarios where we only have a chainId, like here:

const agoricChainInfo = await chainHub.getChainInfo('agoric');
const { transferChannel } = await chainHub.getConnectionInfo(
agoricChainInfo.chainId,
destination.chainId,
);

This is motivating factor for considering including chainName on ChainAddress

Copy link
Member

@0xpatrickdev 0xpatrickdev Jun 19, 2024

Choose a reason for hiding this comment

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

Nice, already a step ahead! #9498

packages/orchestration/src/facade.js Outdated Show resolved Hide resolved
* @template {string} K
* @typedef {K extends keyof KnownChains
* ? Omit<KnownChains[K], 'connections'>
* : ChainInfo} ActualChainInfo
Copy link
Member

Choose a reason for hiding this comment

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

nb: not crazy about this name, but don't have any better suggestions

@turadg turadg added the force:integration Force integration tests to run on PR label Jun 19, 2024
@turadg turadg changed the base branch from master to 9281-local-exo June 19, 2024 17:25
Base automatically changed from 9281-local-exo to master June 19, 2024 17:56
@turadg turadg added the automerge:rebase Automatically rebase updates, then merge label Jun 19, 2024
@@ -1,7 +1,7 @@
import { makeTracer } from '@agoric/internal';
import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
import { E } from '@endo/far';
import { makeChainHub } from '../utils/chainHub.js';
import { getChainsAndConnection, makeChainHub } from '../utils/chainHub.js';
Copy link
Member

Choose a reason for hiding this comment

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

Thinking on this more, wrt to host code requirements for async-flow, it may make more sense to have this directly on makeChainHub instead of a helper. NB for this PR but something to consider.

@turadg turadg force-pushed the ta/chain-lookup-flex branch 2 times, most recently from 4b39f1f to 7921211 Compare June 19, 2024 19:34
@turadg turadg closed this Jun 19, 2024
@turadg turadg deleted the ta/chain-lookup-flex branch June 19, 2024 22:29
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 force:integration Force integration tests to run on PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants