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

Add support for multiple connection hops in create channel command #4067

Merged
merged 4 commits into from
Jun 29, 2024

Conversation

joaotav
Copy link
Collaborator

@joaotav joaotav commented Jun 25, 2024

Closes: #4062

Description


PR author checklist:

  • Added changelog entry, using unclog.
  • Added tests: integration (for Hermes) or unit/mock tests (for modules).
  • Linked to GitHub issue.
  • Updated code comments and documentation (e.g., docs/).
  • Tagged one reviewer who will be the one responsible for shepherding this PR.

Reviewer checklist:

  • Reviewed Files changed in the GitHub PR explorer.
  • Manually tested (in case integration/unit/mock tests are absent).

@joaotav joaotav linked an issue Jun 25, 2024 that may be closed by this pull request
12 tasks
joaotav added 3 commits June 27, 2024 23:34
* Add `--connection-hops` parameter to `CreateChannelCommand`

* Add method `run_multihop_reusing_connection()` to struct
  `CreateChannelCommand`

* Add associated function `new_multihop()` to struct `Channel`
@joaotav joaotav requested a review from romac June 28, 2024 06:06
@joaotav joaotav self-assigned this Jun 28, 2024
@joaotav joaotav added the O: multi-hop Related to ICS 033 Multi-Hop Channel label Jun 28, 2024
@@ -322,6 +323,9 @@ impl CreateChannelCommand {
) {
let config = app_config();

// Set global registry to get or spawn chain handles
set_global_registry(SharedRegistry::new((*app_config()).clone()));
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Even though the registry is being set here (as it is needed further down in the chain of function calls), the chains are being spawned using spawn_chain_runtime() rather than using get_or_spawn() within run_multihop_reusing_connection(). This was to keep it consistent with run_reusing_connection() which was already implemented and uses spawn_chain_runtime().
As get_or_spawn() might give us some performance, if we decide to keep using the registry in the CLIs we should use it here and make it consistent across all methods.

Copy link
Member

Choose a reason for hiding this comment

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

Good catch! Yeah let's see by the end of the implementation phase which technique we want to go with.

@joaotav joaotav marked this pull request as ready for review June 28, 2024 07:52
Copy link
Member

@romac romac left a comment

Choose a reason for hiding this comment

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

Great job! 👏

@joaotav joaotav merged commit 893f580 into joaotav/multihop-poc Jun 29, 2024
33 checks passed
@joaotav joaotav deleted the joaotav/4062-create-channel branch June 29, 2024 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O: multi-hop Related to ICS 033 Multi-Hop Channel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for multiple connection hops in create channel command
2 participants