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

Fix gm hermes config to preserve the global section #1008

Merged
merged 3 commits into from
May 27, 2021
Merged

Conversation

adizere
Copy link
Member

@adizere adizere commented May 27, 2021

Closes: #1007

Description

Small modification to the gm script to make it work with the new version of the Hermes config.toml file.


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.

@adizere adizere requested a review from greg-szabo May 27, 2021 15:41
@adizere adizere changed the title gm hermes config preserves the global section Fix gm hermes config to preserve the global section May 27, 2021
Copy link
Member

@greg-szabo greg-szabo left a comment

Choose a reason for hiding this comment

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

I care less about the naming convention, but let's make sure config is loaded in load_config.

@@ -692,10 +692,12 @@ list_keys() {
}

hermes_config() {
STRATEGY="$(stoml -q "$GLOBAL_HERMES_CONFIG" global.strategy || echo 'all')"
LOG_LEVEL="$(stoml -q "$GLOBAL_HERMES_CONFIG" global.log_level || echo 'info')"
Copy link
Member

Choose a reason for hiding this comment

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

I would like to keep all config reading in the load_config function and make variables available for functions from there. Can you move this in there? You'll find a section that loads all global configs.

I would also rename them GLOBAL_HERMES_STRATEGY and GLOBAL_HERMES_LOG_LEVEL as well as the option to global.hermes_strategy and global.hermes_log_level, as gaiad might have log levels in the future.

I guess soon we'll need to introduce a [hermes] global section in the config and move all entries there so the names don't get too long. At that point we can name them hermes.log_level.

Also note that the default loading (||) is not fully working, there's an issue about it in #993. Don't worry about it for now, just make sure you have these options in your config so you don't rely on hard-coded defaults.

Copy link
Member Author

Choose a reason for hiding this comment

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

I would like to keep all config reading in the load_config function and make variables available for functions from there. Can you move this in there? You'll find a section that loads all global configs.

That makes sense. Should be fixed now. 2d033ab

I would also rename them GLOBAL_HERMES_STRATEGY and GLOBAL_HERMES_LOG_LEVEL as well as the option to global.hermes_strategy and global.hermes_log_level, as gaiad might have log levels in the future.
I guess soon we'll need to introduce a [hermes] global section in the config and move all entries there so the names don't get too long. At that point we can name them hermes.log_level.

I renamed the variables into GLOBAL_HERMES_STRATEGY and GLOBAL_HERMES_LOG_LEVEL but I think we should postpone changing the Hermes config.toml file to adopt global.hermes_strategy and global.hermes_log_level (that would require many changes in the ibc-relayer crate).

I guess soon we'll need to introduce a [hermes] global section in the config and move all entries there so the names don't get too long. At that point we can name them hermes.log_level.

Agree, we'll do this later.

Copy link
Member

@greg-szabo greg-szabo left a comment

Choose a reason for hiding this comment

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

Yup, looks good.

@adizere adizere merged commit 5067621 into master May 27, 2021
@adizere adizere deleted the adi/1007_gm branch May 27, 2021 16:20
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
…s#1008)

* gm hermes config preserves the global section; fixes informalsystems#1007.

* Moved parameter loading to load_config

* Added defaults for strategy and log_level
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.

Gaia manager hermes config command writes incorrect strategy
2 participants