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

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

Merged
merged 16 commits into from
Sep 6, 2023

Conversation

ashuralyk
Copy link
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
Copy link
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

@ashuralyk
Copy link
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
Copy link
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
Copy link
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
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
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
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
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

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
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
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
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
Copy link
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

crates/relayer/src/chain/ckb4ibc.rs Show resolved Hide resolved
.github/workflows/integration.yaml Outdated Show resolved Hide resolved
.github/workflows/integration.yaml Outdated Show resolved Hide resolved
.github/workflows/rust.yml Outdated Show resolved Hide resolved
crates/relayer/src/chain/ckb4ibc/monitor.rs Outdated Show resolved Hide resolved
crates/relayer/src/chain/ckb4ibc/utils.rs Show resolved Hide resolved
crates/relayer/src/chain/ckb4ibc/utils.rs Outdated Show resolved Hide resolved
@ashuralyk ashuralyk requested a review from jjyr September 5, 2023 12:20
@ashuralyk
Copy link
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
31 of 32 checks passed
@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