-
Notifications
You must be signed in to change notification settings - Fork 358
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
Add support for multi-hop channels #3988
Draft
romac
wants to merge
34
commits into
master
Choose a base branch
from
joaotav/multihop-poc
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* feat: add `--connection-hops` parameter to tx chan-open-init * Create directory `relayer-types/core/ics33_multihop` for ics33 definitions * Define structs `ConnectionHop` and `ConnectionHops` * Add `connection_hops` field to struct `Channel` * patch ibc-proto-rs for multihop support * Add connection hops support to `build_chan_open_init_and_send` * Enable parsing of multihop `channel_open_init` events * Add a wrapper struct `ConnectionIds` for Vec<ConnectionId> * Change `connection_id` type from `ConnectionId` to `ConnectionIds` in structs `Attributes`, `OpenInit`, `OpenTry`, `OpenAck`, `OpenConfirm`, `CloseInit` and `CloseConfirm` * Fix clippy warnings * Apply review suggestions and fix clippy warnings * Add review suggestions and fix clippy warnings * Apply suggestions from code review Co-authored-by: Romain Ruetschi <[email protected]> Signed-off-by: Joāo Chervinski <[email protected]> * Change `--connection-hops` type from `Option<Vec<ConnectionId>>` to `Option<ConnectionIds>` * Update guide templates * Fix failing CI tests * Add tests for tx chan-open-init CLI * Apply review suggestions * Add and update FIXMEs * Replace "/" with "\" for proper line concatenation * Update guide templates --------- Signed-off-by: Joāo Chervinski <[email protected]> Co-authored-by: Romain Ruetschi <[email protected]>
* Add connection hops support to `fn run()` * Add channel path validation * Add check to ensure that the channel path specified by the user leads to the expected chain * Fix oversight that caused `--connection-hops` passed to `tx chan-open-init` to be processed in reverse order * Update guide templates for `tx-chan-open-init` * Improve error handling in `fn run()` for TxChanOpenTry * Add `build_multihop_chan_open_try` * Add validation to ensure counterparty channel end is in INIT state before building MsgChannelOpenTry in both single and multihop methods. * Fix clippy warnings * Add `connection_hops` field to `ChannelSide` * Add the `connection_hops` field to struct `ChannelSide`, allowing each side of the channel to store their own view of the channel path. * Remove the `connection_hops` field from struct `Channel`. * Add `get_global_registry` function to get a `SharedRegistry` * Add `src_chain_id` and `dst_chain_id` fields to `ConnectionHops` * Remove `reference_chain_id` field from struct `ConnectionHops` and add two new fields, `src_chain_id`, representing the chain where the ConnectionId representing the hop lives, and `dst_chain_id`, representing the chain the hop leads to. * Add `update_channel_path_clients()` to struct `Channel` * Improve `update_channel_path_clients()` * Add comments for clarity * Add `Vec<Height>` to the return type of `update_channel_path_clients()` to return heights for subsequent multihop proof queries * Add `build_update_client_on_last_hop()` * Add struct `MultihopProofHeights` * Add `build_multihop_proofs()` * Fix failing CI tests * Modify `build_multihop_proofs()` to enable successful `MsgChannelOpenTry` * Refactor `build_multihop_proofs()` for clarity * Rename `build_multihop_proofs()` to `build_multihop_channel_proofs()` * Modify `build_multihop_channel_proofs()` to use iterators instead of indexing to access elements when constructing proofs * Move struct `MultihopProofHeights` to `relayer-types/src/core/ics33_multihop/proofs.rs` * Add and improve comments for clarity * Fix `check-guide` build * Apply suggestions from code review Co-authored-by: Romain Ruetschi <[email protected]> Signed-off-by: Joāo Chervinski <[email protected]> * Add review suggestions --------- Signed-off-by: Joāo Chervinski <[email protected]> Co-authored-by: Romain Ruetschi <[email protected]> Co-authored-by: Romain Ruetschi <[email protected]>
* Add multihop support for `tx chan-open-ack` * Replace call to `tx_chan_cmd!` macro with an inline function * Add `build_multihop_chan_open_ack()` * Fix failing CI tests * Replace incorrect call to `build_chan_open_try()` with a call to `build_chan_open_ack()` within `do_build_chan_open_ack_and_send()` method * Modify `validated_expected_channel()` to support multiple connection hops * Add a more descriptive message to `ChannelError::UnexpectedChannelState` * Improve comments
…4067) * Fix typo in variable name and add comments * Add multiple connection hops support to `create channel` command * Add `--connection-hops` parameter to `CreateChannelCommand` * Add method `run_multihop_reusing_connection()` to struct `CreateChannelCommand` * Add associated function `new_multihop()` to struct `Channel` * Update guide templates * Add unit tests for `-connection-hops` parameter
* Add option to specify connection hops in test-framework init_channel method * Update Nix flake to include polymer simd with multihop * Remove unnecessary changes and add test for manual handshake for channel with multihop * Rename multihop channel test * Add multihop feature for multihop tests * Rename client variables in multihop test
* Change `ChannelConnectionClient` with an enum with `SingleHop` and `Multihop` variants * Add structs `ChannelConnectionClientSingleHop` and `ChannelConnectionClientMultihop` and new corresponding errors
…ingle-hop and multihop cases
…op-packet-relaying
…av/4084-multihop-packet-relaying
* Rename variables for consistency
* Add method `is_multihop()` to struct `RelayPath` * Add frozen client checks to `channel_connection_client()`
* Remove frozen client check from function `channel_connection_client()`
* Add test for a simple transfer on a newly opened multihop channel * Move multihop IBC transfer inside supervisor block --------- Co-authored-by: João <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes: #3940
Running Hermes with multi-hop support
In order to test multi-hop features that have been added in this branch, a chain binary that supports multi-hop channels is required. Feature development and preliminary testing were conducted using the
multihop-main
branch of Polymer's proof-of-concept multi-hop implementation for ibc-go: https://github.com/polymerdao/ibc-go/tree/polymer/multihop-mainTo install the version of Polymer's ibc-go used in the development for this branch:
The binary for
simd
will be located inpolymer-multihop/build/simd
.