Skip to content

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

Merged
ashuralyk merged 16 commits intodevfrom
feat/embeded-with-ckb-sdk
Sep 6, 2023
Merged

feat: complete ckb4ibc-test with embedded forcerelay-ckb-sdk#305
ashuralyk merged 16 commits intodevfrom
feat/embeded-with-ckb-sdk

Conversation

@ashuralyk
Copy link
Copy Markdown
Contributor

@ashuralyk ashuralyk commented Aug 22, 2023

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 feat: IBC test framework support Axon #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 ashuralyk requested review from Flouse, blckngm and jjyr August 22, 2023 07:00
@ashuralyk
Copy link
Copy Markdown
Contributor Author

@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

Comment thread tools/ckb4ibc-test/src/tests/packet.rs Outdated
@ashuralyk ashuralyk force-pushed the feat/embeded-with-ckb-sdk branch from 5e4fac9 to 7d549a6 Compare August 23, 2023 12:56
@ashuralyk
Copy link
Copy Markdown
Contributor Author

@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 ashuralyk marked this pull request as ready for review August 23, 2023 13:04
@ashuralyk ashuralyk force-pushed the feat/embeded-with-ckb-sdk branch from 366f08a to 94cf4ba Compare August 24, 2023 14:52
@ashuralyk
Copy link
Copy Markdown
Contributor Author

@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 ashuralyk force-pushed the feat/embeded-with-ckb-sdk branch from a86cb96 to b145d40 Compare August 25, 2023 15:42
@ashuralyk
Copy link
Copy Markdown
Contributor Author

ashuralyk commented Aug 27, 2023

@blckngm current issue is blocked when searching RecvPacket through SDK, please take a moment to look at it synapseweb3/forcerelay-ckb-sdk#7

@ashuralyk ashuralyk force-pushed the feat/embeded-with-ckb-sdk branch 2 times, most recently from eb21636 to 94a8cc5 Compare August 29, 2023 06:12
@ashuralyk
Copy link
Copy Markdown
Contributor Author

@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
Copy link
Copy Markdown
Contributor

blckngm commented Aug 29, 2023

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

@ashuralyk
Copy link
Copy Markdown
Contributor Author

@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
Copy link
Copy Markdown
Contributor Author

ashuralyk commented Aug 30, 2023

@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

Comment thread crates/relayer/src/chain/ckb4ibc/utils.rs Outdated
Comment thread tools/ckb4ibc-test/src/framework/utils/ckb.rs Outdated
Comment thread tools/ckb4ibc-test/src/framework/utils/ckb.rs Outdated
rt.block_on(ckb::sighash::init_sighash_celldep(&rpc_client))
.unwrap();
let hash = send_transaction(&chain_a_url, send_packet_tx).unwrap();
println!(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A way to implement this test on ibc-test-framework is to call the contract from counterparty chain, and check the contract's state in the deployed chain.

We should implement a contract both in solidity and in CKB to do this test.

Copy link
Copy Markdown
Collaborator

@jjyr jjyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ashuralyk
Copy link
Copy Markdown
Contributor Author

ashuralyk commented Aug 31, 2023

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 ashuralyk requested a review from jjyr August 31, 2023 02:42
@ashuralyk ashuralyk force-pushed the feat/embeded-with-ckb-sdk branch from 61aca69 to ae57d4b Compare September 3, 2023 04:57
@ashuralyk ashuralyk force-pushed the feat/embeded-with-ckb-sdk branch from ae57d4b to 3d534e0 Compare September 3, 2023 08:32
@ashuralyk
Copy link
Copy Markdown
Contributor Author

ashuralyk commented Sep 3, 2023

@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 ashuralyk force-pushed the feat/embeded-with-ckb-sdk branch from f266d88 to 609e12a Compare September 3, 2023 13:43
Comment thread crates/relayer/src/chain/ckb4ibc.rs
Comment thread .github/workflows/integration.yaml
Comment thread .github/workflows/integration.yaml Outdated
Comment thread .github/workflows/rust.yml Outdated
Comment thread crates/relayer/src/chain/ckb4ibc/monitor.rs Outdated
Comment thread crates/relayer/src/chain/ckb4ibc/utils.rs
Comment thread crates/relayer/src/chain/ckb4ibc/utils.rs Outdated
Comment thread tools/ibc-test/src/framework/binary/channel.rs
Comment thread tools/ibc-test/src/tests/mod.rs
Comment thread tools/ibc-test/src/tests/packet.rs
@ashuralyk ashuralyk requested a review from jjyr September 5, 2023 12:20
@ashuralyk ashuralyk force-pushed the feat/embeded-with-ckb-sdk branch from ff0ecb8 to e7cd6c0 Compare September 5, 2023 14:10
@ashuralyk
Copy link
Copy Markdown
Contributor Author

@jjyr suggestions in comments are applied

@ashuralyk ashuralyk added this pull request to the merge queue Sep 6, 2023
Merged via the queue into dev with commit 2f9ecfe Sep 6, 2023
@ashuralyk ashuralyk deleted the feat/embeded-with-ckb-sdk branch September 6, 2023 03:39
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 this pull request may close these issues.

3 participants