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

Optimize time for hermes start/ worker spawn #1000

Merged
merged 8 commits into from
May 31, 2021

Conversation

ancazamfir
Copy link
Collaborator

@ancazamfir ancazamfir commented May 26, 2021

Closes: #998

Description

Changed from iterating through and querying each channel to:

  • query all clients (one RPC)
  • filter clients that are not for configured chains
  • for connections for that client (one RPC)
  • query channels for that connection (one RPC)
  • this is more efficient as after one RPC we know all channels obtained subsequently are very likely of interest (unless they are not-open/ inactive channels)

Also:

  • added missing queries to the handle

  • added a query to get the channel client state, in the end i did not use it but left it there and opened issue to add a CLI for this (Hermes feature: New query channel client CLI #999)

  • tested locally and also with cosmoshub-4 where there are ~125 channels. Startup time is reduced from 2-3mins for starting workers for a single pair of chains to 20 sec.

  • as chains are added to hermes startup time will definitely increase but with useful work associated with it (spawning workers)


For contributor use:

  • Updated the Unreleased section of CHANGELOG.md with the issue.
  • If applicable: Unit tests written, added test to CI.
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Updated relevant documentation (docs/) and code comments.
  • Re-reviewed Files changed in the Github PR explorer.

@ancazamfir ancazamfir requested review from adizere and romac as code owners May 26, 2021 18:49
@ancazamfir ancazamfir marked this pull request as draft May 26, 2021 18:50
@ancazamfir ancazamfir marked this pull request as ready for review May 28, 2021 14:55
Copy link
Member

@adizere adizere left a comment

Choose a reason for hiding this comment

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

Looks good!

@adizere adizere merged commit e6e23b0 into master May 31, 2021
@adizere adizere deleted the anca/optimize_worker_spawn branch May 31, 2021 09:15
@adizere adizere mentioned this pull request Jul 13, 2021
5 tasks
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
* Optimize spawning of workers - draft

* Add back check to start workers only if channel is open

* Cleanup

* Check connection state

* Bit of cleanup

* Changelog

Co-authored-by: Adi Seredinschi <adi@informal.systems>
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.

High startup time for hermes
3 participants