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

PFM transfer covering remote chain A's view of remote B's denoms #10006

Open
4 of 5 tasks
turadg opened this issue Aug 30, 2024 · 3 comments
Open
4 of 5 tasks

PFM transfer covering remote chain A's view of remote B's denoms #10006

turadg opened this issue Aug 30, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@turadg
Copy link
Member

turadg commented Aug 30, 2024

What is the Problem Being Solved?

Per @0xpatrickdev , we need and don't have any test scenarios for building PFM messages which require us to know RemoteChainA's view of RemoteChainB's denoms.

Description of the Design

#9491 made progress in pursuit of,

However this is smaller in scope. The scope of this is testing PFM and the pfm memo. (Perhaps through sendAnywhere contract)

Additional discussion

Tasks

Preview Give feedback
  1. automerge:rebase force:integration
    0xpatrickdev
  2. enhancement
    0xpatrickdev
  3. automerge:rebase

Security Considerations

Scaling Considerations

Test Plan

Upgrade Considerations

@turadg turadg added the enhancement New feature or request label Aug 30, 2024
@dckc
Copy link
Member

dckc commented Aug 30, 2024

A relevant detail: "chain A's view of remote B's denoms" is supposed to be called getLocalDenom as in chainA.getLocalDenom(chainBdenom), according to July 31 discussion #9814 (comment) where we dug up earlier API drafts.

A WIP version is included in

@LuqiPan LuqiPan assigned 0xpatrickdev and unassigned LuqiPan Sep 23, 2024
@0xpatrickdev 0xpatrickdev changed the title e2e test of swap covering remote chain A's view of remote B's denoms e2e test of transfer covering remote chain A's view of remote B's denoms Oct 18, 2024
@LuqiPan LuqiPan changed the title e2e test of transfer covering remote chain A's view of remote B's denoms Add the capability to build PFM messages and e2e tests for this capability Oct 21, 2024
@LuqiPan LuqiPan changed the title Add the capability to build PFM messages and e2e tests for this capability PFM transfer covering remote chain A's view of remote B's denoms Oct 21, 2024
@turadg turadg added this to the FU1: package integration milestone Nov 1, 2024
@turadg turadg removed this from the FU1: package integration milestone Nov 25, 2024
@turadg turadg self-assigned this Nov 25, 2024
mergify bot added a commit that referenced this issue Nov 26, 2024
refs: #10006
refs: #10445 

## Description
- adds `pfmEnabled: bool` to `CosmosChainInfo` to support multi-hop forwarding logic
- adds and exports `withChainCapabilities` helper that mixes in `PfmEnabled` and `IcqEnabled` constants to `ChainInfo`
- adds and exports `registerChainsAndAssets` helper that registers info in a `chainHub` in a contract `startFn`
- implements `chainHub` initialization in `fast-usdc` and `send-anywhere` contracts

### Security Considerations
- `chain-capabilities.js` is authoritative, but consumers have the ability to provide their own data. It's not published to vstorage and will be mixed in to local ChainHub's in example contracts that rely on it.

### Scaling Considerations
- Authors must maintain `chain-capabilities.js` over time

### Documentation Considerations
- documented via typedoc

### Testing Considerations
- updates snapshot tests

### Upgrade Considerations
Library code, part of an NPM Orch release
mergify bot added a commit that referenced this issue Nov 28, 2024
refs: #10445
refs: #10006

## Description
Adds `.makeTransferRoute(destination: ChainAddress, amount: DenomAmount, holdingChainName: string)`  to `ChainHub` to facilitate building IBC `MsgTransfer` parameters for single-hop and multi-hop (pfm) routes.

Returns synchronously using local `chainHub` data to facilitate ease of use at call sites and support future plans to make every call synchronous. It achieves this by interfacing  with the `chainInfos` and `connInfos` map stores directly instead of the public interface methods that currently fall back to remote calls to `agoricNames`.

Assumes the longest route will only be 1 intermediary hop (through the issuing chain). Does not support unwinding nested denoms (e.g. noble uusdc  sent directly from osmosis to agoric `agoric(osmosis(noble(uusdc)))`).

### Security Considerations
An incorrect implementation could result in loss of funds. #9324 remains open to determine sensible defaults for timeout parameters.

### Scaling Considerations
Nothing new, but each contract's `chainHub` will accumulate quite a bit of data .

### Documentation Considerations
JSdoc and tests

### Testing Considerations
Includes unit tests covering all codepaths and known scenarios.

### Upgrade Considerations
N/A, library code. This feature is needed for FUSDC.
@0xpatrickdev
Copy link
Member

The remaining work is:

  • implementation and test for COA (CosmosOrchestrationAccount)

This will include a commit like c35fac7 and ensuring tests continue to pass. It'd be nice if we included a test of a cosmos orch account performing a PFM transfer.

@dckc
Copy link
Member

dckc commented Dec 17, 2024

FastUSDC doesn't depend on multi-hop COA support, right?

Maybe split it out and close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants