Cosmos-sdk: manually test IBC cli cmds

Created on 10 Jun 2020  Â·  13Comments  Â·  Source: cosmos/cosmos-sdk

Summary

The IBC cli is not being used or tested. It should be refactored to support more dynamic usage.

Problem Definition

While working through 03-connection I noticed the cmd for the OpenTry handshake passed in proofInit to the proofConsensus field. Any attempt at using this command successfully should fail showing that no one has attempted to use this command (which is essential to doing anything IBC).

The iqlusioninc relayer, one of the more widely used relayers, does not rely on these commands and instead has its own custom cli commands. There should be at least a few usable commands it could import instead of implementing all of its own. This should be true for any relayer.

Proposal

Refactor and test the IBC cli/rest commands with usability in mind. Currently proofs are passed in directly or by json file. There should be an option to pass in a connection endpoint to the counterparty chain to query and parse the proofs directly. Perhaps there should also be commands to query and store proofs (if there isn't already)

This should probably be punted until after the gRPC refactor across the sdk codebase.


A concrete list of things that need to be done to close this issue:

manually test the following cmds:

  • [x] create client
  • [x] update client
  • [x] client misbehaviour
  • [ ] upgrade client
  • [x] transfer tx cmd
  • [ ] transfer query demon trace
  • [ ] transfer query denom traces
  • [x] query client state
  • [x] query client states
  • [x] query consensus state
  • [x] query consensus states
  • [ ] query header
  • [x] query node consensus state
  • [ ] conn open init
  • [ ] conn open try
  • [ ] conn open ack
  • [ ] conn open confirm
  • [x] query connection
  • [x] query connections
  • [x] query client connections
  • [ ] channel open init
  • [ ] channel open try
  • [ ] channel open ack
  • [ ] channel open confirm
  • [ ] channel close init
  • [ ] channel close confirm
  • [x] query channel
  • [x] query channels
  • [x] query connection channels
  • [x] query channel client state
  • [x] query packet commitment
  • [x] query packet commitments
  • [ ] query unreceived packets
  • [ ] query unrelayed acks
  • [x] query next sequence recv

cmds to add and test:

  • [ ] relay packet
  • [ ] relay acknowledgement

Also consider applying the original proposal of this issue, allowing an endpoint to be passed/queried for counterparty proofs. Maybe this can be opened in a separate issue and implemented if users request the same feature

CLI client-ux tests ibc

All 13 comments

I also noted that most of the Channel client/ queries are missing

We should also add CLI tests after the CLI user flow is sorted out

from-review: move GetCmdQueryNextSequence from ibc-transfer cli to channel

remove res.Height+1 in channel client utils

we should integrate support for application version selection at the client level. Trying to automate this with optional flag overrides would be ideal. We should use ics20 as testing grounds for the best way to do this from a developer standpoint

Blocked on https://github.com/cosmos/cosmos-sdk/issues/6961. Also low-priority / last-minute; also not state-machine-breaking.

change all marshalling and unmarshalling in the client to proto

Edit: add a proto definition to wrap []string to proto marshal paths in the client queries

change all marshalling and unmarshalling in the client to proto

yeah so we need to write some tests to see if the commands work properly. Otherwise, we might need to include the proto codec in the client context

yeah so we need to write some tests to see if the commands work properly. Otherwise, we might need to include the proto codec in the client context

I think this should work? But agreed we should add tests

types.RegisterInterface(clientCtx.InterfaceRegistry) // don't think this is necessary
cdc := codec.NewProtoCodec(clientCtx.InterfaceRegistry)

I think we are missing cli functions for receiving and acknowledging packets

query commands should have the prove flag default to false. I imagine most users won't need the proof everytime that call this command

should we sort packet commitments query by sequence before returning?

address comment

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fedekunze picture fedekunze  Â·  3Comments

cwgoes picture cwgoes  Â·  3Comments

rigelrozanski picture rigelrozanski  Â·  3Comments

mossid picture mossid  Â·  3Comments

faboweb picture faboweb  Â·  3Comments