-
Notifications
You must be signed in to change notification settings - Fork 329
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 chain types in the configuration #2228
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!!! thanks @romac !!
opts: &UpgradePlanOptions, | ||
) -> Result<TxHash, UpgradeChainError> { | ||
let upgrade_height = dst_chain | ||
.query_chain_latest_height() | ||
.query_latest_height() // FIXME(romac): Use query_chain_latest_height once added to ChainHandle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this going to be fixed with #2185?
A lot of the code in this function is Cosmos/Tendermint specific and should be moved in the Cosmos chain impl (when the fixme is fixed)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, we should tackle this with issue 2185!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can also issue the right call here and add the appropriate method to the handle or would you rather we do this in a follow-up PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's do it in a follow up PR
Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>
Can you also add some comment in
|
I'm wondering if we should document this chain type feature already in config.toml (and release it with v1), since it's rather experimental. |
@romac had the same comment offline. I am ok either way. I expect this to be used when other chain types will be supported, e.g. substrate. Not sure at what stage substrate integration is now, was wondering if it would be useful for them to upstream these changes. |
Good point! Another use-case for the chain type feature is integration with basecoin-rs. From what I can tell, we're signalling the changes here via (doc)comments and the public API here Not sure how to highlight this API better for substrate or other relayer developers, so that they can find & use it with ease, but as a first approach this looks good to me! If this proves to be too obscure, then I agree we should highlight it in config.toml. |
Should we choose the chain type naming convention while we are at it? "CosmosSdk" (CamelCase) vs. "cosmos-sdk" (kebab-case) The reason for the latter is, other chain types would often have a one word name, e.g. "substrate", so capitalization of those would look annoying. Think of all those wasteful Shift keypresses. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opts: &UpgradePlanOptions, | ||
) -> Result<TxHash, UpgradeChainError> { | ||
let upgrade_height = dst_chain | ||
.query_chain_latest_height() | ||
.query_latest_height() // FIXME(romac): Use query_chain_latest_height once added to ChainHandle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, we should tackle this with issue 2185!
On the third hand, deserialization of the chain type could just be case-insensitive. It should be if this format is also used in CLI, because 1) CLI users on Unix traditionally hate using upper case unless necessary; 2) CLI users on Windows are used to parameters being case-insensitive. |
Agreed. I'll see if I can make it both case insensitive and ignore dashes as well. |
Done here: 111f3f0 |
…stems#2228) * Move `ChainEndpoint` trait into its own module * Add support for multiple chain types * Add changelog entry * Remove `type` entry from the default config * Update relayer-cli/src/cli_utils.rs Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com> * Ignore case and dashes when deserializing `ChainType` * Fix test Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>
Closes: #2240
Description
See the proposal on the linked issue.
PR author checklist:
unclog
.docs/
).Reviewer checklist:
Files changed
in the GitHub PR explorer.