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

Need to handle denom prefixes of <ibc-port>/<ibc-channel>/ #4614

Closed
michaelfig opened this issue Feb 19, 2022 · 0 comments · Fixed by #4615
Closed

Need to handle denom prefixes of <ibc-port>/<ibc-channel>/ #4614

michaelfig opened this issue Feb 19, 2022 · 0 comments · Fixed by #4615
Assignees
Labels
bug Something isn't working pegasus
Milestone

Comments

@michaelfig
Copy link
Member

Describe the bug

To Reproduce

From @simpletrontdip on Discord (https://discord.com/channels/585576150827532298/766087740336635924/943026098986422314):

Pegasus seems to send an IBC package with non-prefixed denom (uphoton instead of pegasus/channel-0/uphoton)

{"amount":"1000000","denom":"uphoton","receiver":"cosmos1h68l7uqw255w4m2v82rqwsl6p2qmkrg08u5mye","sender":"pegasus"}

This makes the target chain treat it as a remote one (although it was sent back)

gaiad q bank balances cosmos1h68l7uqw255w4m2v82rqwsl6p2qmkrg08u5mye --node https://rpc.testnet.cosmos.network:443 --chain-id cosmoshub-testnet
balances:
- amount: "1000000"
  denom: ibc/91CC51904C9E34CD841008CDA73F92811A235501A556EAC7F81B32FAA7F706A7
- amount: "334995400"
  denom: uphoton
pagination:
  next_key: null
  total: "0"

gaiad query ibc-transfer denom-trace 91CC51904C9E34CD841008CDA73F92811A235501A556EAC7F81B32FAA7F706A7 --node https://rpc.testnet.cosmos.network:443

denom_trace:
  base_denom: uphoton
  path: transfer/channel-134

Expected behavior

Pegasus implements denom prefixing semantics for IBC connections, as described in the ICS 20 spec

Notably, when IBC-Pegasus sends remotePegged tokens back to their source, the sent denom string must be prefixed with their source's port and channel, such as: {ics20Port}/{ics20Channel}/{denom}. When IBC-Pegasus receives a packet, localPegged tokens must only be matched if they use the channel's local prefix.

token source packet sender action
local us no prefix
local them verify and strip their prefix
remote us add our prefix
remote them no prefix

Platform Environment

  • what OS are you using? what version of Node.js?
  • is there anything special/unusual about your platform?
  • what version of the Agoric-SDK are you using? (run git describe --tags --always)

Additional context

Add any other context about the problem here.

Screenshots

If applicable, add screenshots to help explain your problem, especially for UI interactions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pegasus
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants