synapseweb3 / forcerelay

Apache License 2.0
10 stars 8 forks source link

feat: complete `ckb4ibc-test` with embedded `forcerelay-ckb-sdk` #305

Closed ashuralyk closed 1 year ago

ashuralyk commented 1 year ago

background:

the forcerelay-ckb-sdk has almost completed, so we can embed it into our ckb4ibc-test to automatically test the packet relaying between two ckb endpoints

change log:

  1. remove the hard-code of *_type_args config values from test-framework crate
  2. change the generation of client_id from type_args to type_hash for security concerns
  3. complete the coding of packet test
  4. debug relayer monitor and query_channel
  5. debug generation of AckPacket transaction
  6. fix a capacity calculation bug
  7. rebase https://github.com/synapseweb3/forcerelay/pull/308 @jjyr and pass through the test case specific_test_only_for_ckb

p.s. integration-test -> ica-filter-test seems cannot be fixed until we merge Hermes v1.6.0, it seems has pre-packed nix package that only matches latest Hermes version, which would cause failure while using previous version of Hermes framework

ashuralyk commented 1 year ago

@jjyr I'm refactoring ckb4ibc-test framework, I'm afraid it has impact on your current work of testing Axon Endpoints, so please check this PR

ashuralyk commented 1 year ago

@Flouse I have completed the coding of packet test case embedded in ckb4ibc-test and successfully sent SendPacket transaction, but the next process was stuck due to the monitor logic of relayer I guess, so the next stage is to debug and make test case pass through, @blckngm could help me do this if you have your leisure time

ashuralyk commented 1 year ago

@blckngm packet cell has successfully searched on chain_a, but the next problem is in query_channel method, it accepted channel-1 which is not existed on chain_a

ashuralyk commented 1 year ago

@blckngm current issue is blocked when searching RecvPacket through SDK, please take a moment to look at it https://github.com/synapseweb3/forcerelay-ckb-sdk/issues/7

ashuralyk commented 1 year ago

@blckngm after using the latest revision of forcerelay-ckb-sdk, the CI process has stuck in searching AckPacket cell on chain-a https://github.com/synapseweb3/forcerelay/actions/runs/6008594876/job/16296503004?pr=305, so please take a look at it

blckngm commented 1 year ago

It's still related to cursor usage. Use https://github.com/synapseweb3/forcerelay-ckb-sdk/tree/temp-fix-cursor for now.

ashuralyk commented 1 year ago

@blckngm @Flouse @jjyr I have already passed ckb4ibc-test CI test locally which contains packet relaying test in ckb <-> ckb case, I think it's ok to prepare a code review

ashuralyk commented 1 year ago

@jjyr please help me check it out, I got nothing from my failed CI and I found its processing list is different from yours, so have you done something on it in your PR ?

https://github.com/synapseweb3/forcerelay/actions/runs/6012440875/job/16329029412?pr=305

ashuralyk commented 1 year ago

LGTM.

We should merge #308 before this PR, #308 upgrade the integration-test CI and the implement Axon <-> CKB channel tests, it can gurantee this PR do not break the CI.

Then we rebase this PR and rewrite the packet test.

what's your recommend on merging this PR? my opinion is to start a new branch and move essential changes of packet test into it from this PR, do you recommend just merging it exactly after rebasing?

ashuralyk commented 1 year ago

@Flouse the next operation of coding to do in ibc-test is the following:

  1. implement packet test within axon endpoints
  2. implement packet test between axon and ckb endpoints
  3. advanced implement packet test with sUDT for ckb endpoints
ashuralyk commented 1 year ago

@jjyr suggestions in comments are applied