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

Bug in IbcQuery::ListChannels implementation when port is unset #1597

Closed
webmaster128 opened this issue Sep 4, 2023 · 0 comments · Fixed by #1620
Closed

Bug in IbcQuery::ListChannels implementation when port is unset #1597

webmaster128 opened this issue Sep 4, 2023 · 0 comments · Fixed by #1620

Comments

@webmaster128
Copy link
Member

According to the API specification, an unset port ID falls back to the contract's port ID:

If port_id is omitted, this list all channels bound to the contract's port.

(https://github.com/CosmWasm/cosmwasm/blob/v1.3.3/packages/std/src/query/ibc.rs#L16-L20), and

If PortID is unset, this list all channels bound to the contract's port.

(https://github.com/CosmWasm/wasmvm/blob/v1.3.0/types/queries.go#L165-L172). This specification never changed since the API's existence.

However, in https://github.com/CosmWasm/wasmd/pull/439/files#diff-47293308b181e6cdf9a982870e2de9941dfb405553ed239f7a192ec46963ec58R180 the implemetation changed to list channels for all ports in that case, instead of the contract's port. This is a bug in wasmd.

The motivation for changing the implementation instead of documenting the current behaviour is the following:

  • The behaviour of falling back to the contract's port is consistent with IbcQuery::Channel
  • Listing all channels of the chain is hardly something that makes sense to do in a smart contract
  • It seems like the query is hardly used. After asking around only one user was found: astroport. That user can probably better use a different query.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant