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

9211 lookup denom #9983

Merged
merged 14 commits into from
Aug 30, 2024
Merged

9211 lookup denom #9983

merged 14 commits into from
Aug 30, 2024

Conversation

turadg
Copy link
Member

@turadg turadg commented Aug 27, 2024

closes: #9211

Description

Uses ChainHub for lookup of denoms and brands (from the other).

Adds some coercion utilities to get the desired shape within the exos and contract, using a ChainHub.

Security Considerations

Contracts control their ChainHub and can specify any mapping of brand to denom.

Scaling Considerations

If contracts import the whole Known Chains module, that will increase bundle size. I think this will be unlikely in production. We'll have on-chain lookup by then.

Documentation Considerations

not yet

Testing Considerations

existing coverage

Upgrade Considerations

None of this is deployed yet

Copy link

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

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4cac5cc
Status: ✅  Deploy successful!
Preview URL: https://ade6fe15.agoric-sdk.pages.dev
Branch Preview URL: https://9211-lookup-denom.agoric-sdk.pages.dev

View logs

@turadg turadg marked this pull request as ready for review August 28, 2024 21:01
@turadg turadg force-pushed the 9211-lookup-denom branch 2 times, most recently from b578e55 to 25b46fe Compare August 28, 2024 21:12
@dckc
Copy link
Member

dckc commented Aug 29, 2024

trying an experiment to co-assign this PR to myself to get it to show up in a tracking thing

@dckc dckc assigned turadg and dckc Aug 29, 2024
@turadg turadg added automerge:rebase Automatically rebase updates, then merge and removed automerge:rebase Automatically rebase updates, then merge labels Aug 29, 2024
@turadg turadg added the force:integration Force integration tests to run on PR label Aug 29, 2024
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.

no need to wait for me

@@ -94,6 +94,20 @@ export interface Chain<CI extends ChainInfo> {
// TODO provide a way to get the local denom/brand/whatever for this chain
}

export interface BrandInfo<
Copy link
Member

Choose a reason for hiding this comment

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

A 1-line description seems worthwhile. I'm struggling a little bit to come up with one... but it seems a little odd to call this BrandInfo when the brand property is optional. Maybe something like AssetTrackingInfo or AssetInfo or AssetCosswalk.

asset is what the chain registry calls a similar structure.

Copy link
Member

Choose a reason for hiding this comment

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

cc @mitdralla @dtribble re change to orchestration-api.ts

Comment on lines 120 to 134
) => {
/** The well-known Brand on Agoric for the direct asset */
brand?: Brand;
/** The Chain at which the argument `denom` exists (where the asset is currently held) */
chain: Chain<KnownChains[HoldingChain]>;
/** The Chain that is the issuer of the underlying asset */
base: Chain<KnownChains[IssuingChain]>;
/** the Denom for the underlying asset on its issuer chain */
baseDenom: Denom;
};
) => BrandInfo<HoldingChain, IssuingChain>;
Copy link
Member

Choose a reason for hiding this comment

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

👏 this refactor addresses one case of...

image

(Unfortunately the symptoms persist for other methods such as getChain.)

@turadg turadg added the automerge:rebase Automatically rebase updates, then merge label Aug 29, 2024
@turadg turadg force-pushed the 9211-lookup-denom branch 3 times, most recently from 093b875 to 18462fd Compare August 29, 2024 23:56
@mergify mergify bot merged commit 42d1d4f into master Aug 30, 2024
80 checks passed
@mergify mergify bot deleted the 9211-lookup-denom branch August 30, 2024 18:08
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.

bidirectional lookup of denoms / brands for IBC
3 participants