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

Include client updates for supporting messages when assembling messages to relay from the operational data #3468

Merged
merged 2 commits into from
Jul 11, 2023
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
4 changes: 4 additions & 0 deletions .changelog/unreleased/bug-fixes/ibc-relayer/3465-3565.md
Original file line number Diff line number Diff line change
@@ -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))
18 changes: 8 additions & 10 deletions crates/relayer/src/link/operational_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,26 +158,24 @@ impl OperationalData {
relay_path: &RelayPath<ChainA, ChainB>,
) -> Result<TrackedMsgs, LinkError> {
// 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!(
"prepending {} client update at height {}",
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
Expand Down Expand Up @@ -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();
Expand Down