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 Namada #3705

Open
wants to merge 97 commits into
base: master
Choose a base branch
from

Conversation

yito88
Copy link
Contributor

@yito88 yito88 commented Nov 21, 2023

Closes: #XXX

Description

To transfer tokens between Namada and Cosmos-base chains.

  • Add Namada to ChainConfig
  • Reuse CosmosSdkConfig for generating Tendermint light clients
  • Add NamadaChain as ChainEndpoint implementation
    • See crates/relayer/src/chain/namada.rs and files under crates/relayer/src/chain/namada
    • To submit Namada transactions and query
  • Store Namada key to KeyRing

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).

@yito88 yito88 marked this pull request as ready for review November 21, 2023 16:05
@romac romac changed the title Add Namada ChainEndpoint Add support for Namada Jan 18, 2024
Copy link
Contributor

@ljoss17 ljoss17 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!
Left some initial comments and questions

}

impl NamadaChain {
fn config(&self) -> &CosmosSdkConfig {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this required since there is already the fn config() implementation from the ChainEndpoint https://github.com/informalsystems/hermes/pull/3705/files#diff-c8209ac0ce0499033b7cfc2981c4284a1ec525a3e6848bbf0a11856a011c9c2bR188?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed


let mut rpc_client = HttpClient::new(config.rpc_addr.clone())
.map_err(|e| Error::rpc(config.rpc_addr.clone(), e))?;
rpc_client.set_compat_mode(CompatMode::V0_37);
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the compat mode be retrieved from the configuration https://github.com/informalsystems/hermes/blob/master/config.toml#L439? It could default to V0_37 with a warning

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

}

fn shutdown(self) -> Result<(), Error> {
Ok(())
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason this method doesn't send the Shutdown to the Event Source?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

}

fn version_specs(&self) -> Result<Specs, Error> {
unimplemented!()
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this eventually be implemented?

heights.push(height);
}
// the key is not for a consensus state
Err(_) => continue,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this expected to happen often?
If not, a debug! would be nice to have the error. If it happens often then using trace! would be preferred.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added debug!

);
crate::telemetry!(query, self.id(), "query_upgraded_client_state");

unimplemented!()
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this eventually be implemented?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

implemented

);
crate::telemetry!(query, self.id(), "query_upgraded_consensus_state");

unimplemented!()
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this eventually be implemented?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

implemented

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.

2 participants