From a57d906cd274d18c96046c8c8019f06f069f01eb Mon Sep 17 00:00:00 2001 From: Romain Ruetschi <106849+romac@users.noreply.github.com> Date: Tue, 22 Aug 2023 15:41:36 +0200 Subject: [PATCH 1/2] Do not perform client update if consensus state already exists On some chains there are a few active channels using the same connection and therefore clients. This PR adds a check in the client update code and not create the message if the consensus state at desired height is already present. This helps with reducing relayer fees, state bloating, etc by eliminating redundant updates. --- crates/relayer/src/foreign_client.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/crates/relayer/src/foreign_client.rs b/crates/relayer/src/foreign_client.rs index 008737e052..483e021bec 100644 --- a/crates/relayer/src/foreign_client.rs +++ b/crates/relayer/src/foreign_client.rs @@ -1069,6 +1069,24 @@ impl ForeignClient ForeignClient Date: Tue, 22 Aug 2023 16:36:57 +0200 Subject: [PATCH 2/2] Improve error message in `update client` command --- crates/relayer/src/foreign_client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/relayer/src/foreign_client.rs b/crates/relayer/src/foreign_client.rs index 483e021bec..0db0b17051 100644 --- a/crates/relayer/src/foreign_client.rs +++ b/crates/relayer/src/foreign_client.rs @@ -107,7 +107,7 @@ define_error! { height: Height, } |e| { - format_args!("client {} is already up-to-date with chain {}@{}", + format_args!("client {} is already up-to-date with chain {} at height {}", e.client_id, e.chain_id, e.height) },