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 CometBFT 0.37 compatibility mode for unsupported Tendermint versions (eg. Tendermint 0.35 and 0.36) #3404

Merged
merged 6 commits into from
Jun 8, 2023
Merged
5 changes: 4 additions & 1 deletion crates/relayer-cli/src/commands/listen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@ fn detect_compatibility_mode(
) -> eyre::Result<CompatMode> {
let client = HttpClient::new(config.rpc_addr.clone())?;
let status = rt.block_on(client.status())?;
let compat_mode = CompatMode::from_version(status.node_info.version)?;
let compat_mode = CompatMode::from_version(status.node_info.version).unwrap_or_else(|e| {
warn!("Unsupported tendermint version, will use v0.37 compatibility mode but relaying might not work as desired: {e}");
CompatMode::V0_37
});
Ok(compat_mode)
}

Expand Down
6 changes: 4 additions & 2 deletions crates/relayer/src/chain/cosmos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -850,8 +850,10 @@ impl ChainEndpoint for CosmosSdkChain {

let node_info = rt.block_on(fetch_node_info(&rpc_client, &config))?;

let compat_mode = CompatMode::from_version(node_info.version)
.map_err(|e| Error::rpc(config.rpc_addr.clone(), e))?;
let compat_mode = CompatMode::from_version(node_info.version).unwrap_or_else(|e| {
warn!("Unsupported tendermint version, will use v0.37 compatibility mode but relaying might not work as desired: {e}");
CompatMode::V0_37
});
rpc_client.set_compat_mode(compat_mode);

let light_client = TmLightClient::from_config(&config, node_info.id)?;
Expand Down