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

Use the consensus_params rpc with explicit (latest) height #1382

Merged
merged 4 commits into from
Sep 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Improve reliability of health check ([#1382](https://github.com/informalsystems/ibc-rs/issues/1376))
8 changes: 6 additions & 2 deletions relayer/src/chain/cosmos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,13 @@ impl CosmosSdkChain {
/// Emits a log warning in case any error is encountered and
/// exits early without doing subsequent validations.
pub fn validate_params(&self) -> Result<(), Error> {
// Check on the configured max_tx_size against the latest block's consensus parameters
// Get the latest height and convert to tendermint Height
let latest_height = Height::try_from(self.query_latest_height()?.revision_height)
.map_err(Error::invalid_height)?;

// Check on the configured max_tx_size against the consensus parameters at latest height
let result = self
.block_on(self.rpc_client.latest_consensus_params())
.block_on(self.rpc_client.consensus_params(latest_height))
.map_err(|e| {
Error::config_validation_json_rpc(
self.id().clone(),
Expand Down