From 494c5d187c00deab67bb5dc352d03c2d86f3b966 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Mon, 10 Jul 2023 16:11:42 +0200 Subject: [PATCH 1/2] Include client updates for supporting messages when assembling messages to relay from the operational data --- crates/relayer/src/link/operational_data.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/crates/relayer/src/link/operational_data.rs b/crates/relayer/src/link/operational_data.rs index 2883e515ae..5c5315b09a 100644 --- a/crates/relayer/src/link/operational_data.rs +++ b/crates/relayer/src/link/operational_data.rs @@ -158,7 +158,7 @@ impl OperationalData { relay_path: &RelayPath, ) -> Result { // For zero delay we prepend the client update msgs. - let client_update_msg = if !self.conn_delay_needed() { + let client_update_msgs = if !self.conn_delay_needed() { let update_height = self.proofs_height.increment(); debug!( @@ -166,18 +166,16 @@ impl OperationalData { self.target, update_height ); - // Fetch the client update message. Vector may be empty if the client already has the header - // for the requested height. - let mut client_update_opt = match self.target { + // Fetch the client update messages. + // Vector may be empty if the client already has the header for the requested height. + match self.target { OperationalDataTarget::Source => { relay_path.build_update_client_on_src(update_height)? } OperationalDataTarget::Destination => { relay_path.build_update_client_on_dst(update_height)? } - }; - - client_update_opt.pop() + } } else { let (client_state, _) = match self.target { OperationalDataTarget::Source => relay_path @@ -205,12 +203,12 @@ impl OperationalData { if client_state.is_frozen() { return Ok(TrackedMsgs::new(vec![], self.tracking_id)); - } else { - None } + + vec![] }; - let msgs = client_update_msg + let msgs = client_update_msgs .into_iter() .chain(self.batch.iter().map(|gm| gm.msg.clone())) .collect(); From 4040bd501e9ea645d1b6167f3bcb0cec8c53393b Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Mon, 10 Jul 2023 16:17:14 +0200 Subject: [PATCH 2/2] Add changelog entry --- .changelog/unreleased/bug-fixes/ibc-relayer/3465-3565.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .changelog/unreleased/bug-fixes/ibc-relayer/3465-3565.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer/3465-3565.md b/.changelog/unreleased/bug-fixes/ibc-relayer/3465-3565.md new file mode 100644 index 0000000000..17192b321f --- /dev/null +++ b/.changelog/unreleased/bug-fixes/ibc-relayer/3465-3565.md @@ -0,0 +1,4 @@ +- Fix a bug where Hermes would discard the client updates + corresponding to the supporting headers returned by the light + client when assembling messages to relay from the operational data + ([\#3465](https://github.com/informalsystems/hermes/issues/3465)) \ No newline at end of file