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!: chainHub.getAsset requires srcChainName parameter #10588

Merged
merged 4 commits into from
Dec 3, 2024

Conversation

0xpatrickdev
Copy link
Member

@0xpatrickdev 0xpatrickdev commented Nov 29, 2024

refs: #10445

Description

IBC Denoms are unique to a chain but not all not all chains. e.g., if channel-0 points to osmosis for two chains, the uosmo denom will be ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518 for both.

This change requires callers to specify the holdingChainName for the denom they wish to retrieve information about.

Security Considerations

None

Scaling Considerations

None

Documentation Considerations

None

Testing Considerations

Updates existing tests. Motivated from work in #10571 which surfaced this issue.

Upgrade Considerations

Breaking change, but for library code that will be part on NPM or FUSDC release.

@0xpatrickdev 0xpatrickdev added the force:integration Force integration tests to run on PR label Nov 29, 2024
@0xpatrickdev 0xpatrickdev force-pushed the pc/10445-chain-hub-get-asset branch from dc416d2 to d43db44 Compare November 29, 2024 20:17
Copy link

cloudflare-workers-and-pages bot commented Nov 29, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5912769
Status: ✅  Deploy successful!
Preview URL: https://83a302d7.agoric-sdk.pages.dev
Branch Preview URL: https://pc-10445-chain-hub-get-asset.agoric-sdk.pages.dev

View logs

@0xpatrickdev 0xpatrickdev force-pushed the pc/10445-chain-hub-get-asset branch 4 times, most recently from d280d69 to c3403e5 Compare November 29, 2024 21:52
@0xpatrickdev 0xpatrickdev changed the base branch from pc/10445-transfer-pfm to master November 29, 2024 21:53
Copy link

Base branch is changed to master. Please re-run the integration tests by adding 'force:integration' label.

@0xpatrickdev 0xpatrickdev force-pushed the pc/10445-chain-hub-get-asset branch 3 times, most recently from 1eed391 to c12d868 Compare November 29, 2024 23:44
@0xpatrickdev
Copy link
Member Author

✘ [fail]: user can open a vault under debt limit The IST balance should increase by the minted amount

This seems unrelated to these changes and is likely a flake.

Copy link
Member

@dckc dckc left a comment

Choose a reason for hiding this comment

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

this seems about right

@@ -146,6 +146,7 @@ export interface Orchestrator {
IssuingChain extends keyof KnownChains,
>(
denom: Denom,
holdingChainName: HoldingChain,
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

why is holdingChainName constrained to a static list of known chains?

OK, I guess I see why for now. Tolerable tech debt, I suppose.

In due course, it seems like getDenomInfo should be parameterized by...

  getDenomInfo: <
    HoldingChainInfo extends ChainInfo,
    IssuingChainInfo extends ChainInfo,
  >(

and maybe even the ConnectionInfo between them.

Copy link
Member Author

Choose a reason for hiding this comment

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

why is holdingChainName constrained to a static list of known chains?

Something to potentially solve in #9992. In the (stale) PR that attempted to close it, allowing string for chainName was an approach discussed.

const actual = orc.getDenomInfo('utoken1');
const actual = orc.getDenomInfo(
'utoken1',
// @ts-expect-error 'mock' not a KnownChain
Copy link
Member

Choose a reason for hiding this comment

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

doesn't seem like that should be an error

@0xpatrickdev 0xpatrickdev force-pushed the pc/10445-chain-hub-get-asset branch from c12d868 to aa03864 Compare December 2, 2024 16:03
@0xpatrickdev 0xpatrickdev changed the title feat!: chainHub.getAsset requires holdingChainName parameter feat!: chainHub.getAsset requires srcChainName parameter Dec 2, 2024
@0xpatrickdev 0xpatrickdev force-pushed the pc/10445-chain-hub-get-asset branch 2 times, most recently from b4ce8f3 to 4464d37 Compare December 2, 2024 22:00
@0xpatrickdev 0xpatrickdev added the automerge:rebase Automatically rebase updates, then merge label Dec 2, 2024
@0xpatrickdev 0xpatrickdev force-pushed the pc/10445-chain-hub-get-asset branch from 4464d37 to ba8aaa9 Compare December 3, 2024 17:30
@0xpatrickdev 0xpatrickdev added automerge:rebase Automatically rebase updates, then merge and removed automerge:rebase Automatically rebase updates, then merge labels Dec 3, 2024
@0xpatrickdev 0xpatrickdev added automerge:rebase Automatically rebase updates, then merge and removed force:integration Force integration tests to run on PR automerge:rebase Automatically rebase updates, then merge labels Dec 3, 2024
@0xpatrickdev 0xpatrickdev force-pushed the pc/10445-chain-hub-get-asset branch from ba8aaa9 to 9638d57 Compare December 3, 2024 18:23
@0xpatrickdev 0xpatrickdev added the automerge:rebase Automatically rebase updates, then merge label Dec 3, 2024
- to facililate registering the same denom across multiple chains in `ChainHub`
- denoms are unique to a chain, but not all chains
- since denoms are only unique to a chain and all chains, require `srcChainName` parameter for asset info lookups
- filed #10599 after observing multiple flakes from unrelated changes
@0xpatrickdev 0xpatrickdev force-pushed the pc/10445-chain-hub-get-asset branch from 9638d57 to 5912769 Compare December 3, 2024 18:44
@turadg
Copy link
Member

turadg commented Dec 3, 2024

@mergify refresh

Copy link
Contributor

mergify bot commented Dec 3, 2024

refresh

✅ Pull request refreshed

@mergify mergify bot merged commit 3154854 into master Dec 3, 2024
81 checks passed
@mergify mergify bot deleted the pc/10445-chain-hub-get-asset branch December 3, 2024 21:43
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.

3 participants