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

Implement a mock Cosmos chain context #24

Open
5 tasks
Tracked by #27
soareschen opened this issue Feb 1, 2023 · 0 comments
Open
5 tasks
Tracked by #27

Implement a mock Cosmos chain context #24

soareschen opened this issue Feb 1, 2023 · 0 comments
Assignees

Comments

@soareschen
Copy link
Collaborator

Summary

In informalsystems/hermes#2733, we implemented a mock chain context for testing relayer-next. And #31 tracks the issue of implementing a mock solomachine chain context. This issue follows the same principle and we will implement a mock Cosmos chain context using cosmos/ibc-rs for testing relayer-next.

The mock Cosmos chain context will make use of actual Cosmos chain implementation following the CometBFT (Tendermint) and IBC specs. This is done by using the ibc crate and the tendermint-rs crate to run the Cosmos IBC implementation. The main difference is that this is still a mock chain, hence the entire blockchain state is stored only in memory. The mock Cosmos chain context can be implemented by implementing the one-for-all traits such as OfaBaseChain and forwarding the requests to the ibc crate.

Following the mock Cosmos chain implementation, we can instantiate the relayer to relay between two mock Cosmos chains. This will help in testing the correctness of both relayer-next and the ibc crate.

In a follow up issue, we can also work on implementing the relay context for relaying between a mock Cosmos chain context and an actual Cosmos chain context. This will help test the correctness of the ibc crate without requiring a full build of Rust-based Cosmos chain. This would also reduce the need of using the basecoin-rs project to test the ibc crate.

It is worth noting that this issue is different from #25. In #25, we want to build a purely mock chain context that is independent of any chain implementation. However, the current design of ibc is tightly coupled with low-level logic such as protobuf encoding, merkle proofs, and time. This means that there are more limitations on testing using the mock Cosmos chain context, as compared to testing it using a purely abstract mock chain implementation. Nevertheless, the mock Cosmos chain context serves a different purpose of testing the Cosmos-specific relayer logic, as compared to the purely abstract IBC logic.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
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 a pull request may close this issue.

2 participants