synapseweb3 / forcerelay

Apache License 2.0
10 stars 8 forks source link

feat: add channel close feature #382

Closed ashuralyk closed 9 months ago

ashuralyk commented 10 months ago

Related issues

Description

Channel layer misses close feature for a long time, and for a compatible version of IBC protocol, close feature should be accomplished at last.

Change logs

  1. bump ckb-ics to https://github.com/synapseweb3/ckb-ics/commits/0299a9126a7cb28ff54b1a02f286f0618133731c
  2. bump forcerelay-ckb-sdk to https://github.com/synapseweb3/forcerelay-ckb-sdk/commits/cd29a30b350ab853a496a58b970017bfa1249182
  3. complete transaction assembly for MsgChannelCloseInit and MsgChannelCloseConfirm
  4. iterate contracts of IBC for CKB endpoint
  5. extract the envelope struct from IBC transaction to distinguish which type of message is behind a closed channel, specifically to distinguish a channel that comes to close is triggered by MsgChannelCloseInit or MsgChannelCloseConfirm
  6. emit channel close command in packet related CI tests
  7. complete query_txs() method, but others are unreachable to do

    Scan and check the incomplete methods in Ckb4Ibc, and find only query_txs() needs to implemented, others can keep unimplemented status.

  8. add channel close trigger in CI test only between CKB chains

Related PRs

ashuralyk commented 10 months ago

@blckngm this PR's CI won't pass because we give relayer a random key but the module is set PRIVKEY, which would emit error in the contract check of MsgChannelCloseInit, we should send transaction to close channel via forcerelay-ckb-sdk

ashuralyk commented 10 months ago

@Flouse this PR can start to review