Skip to content

Commit

Permalink
fetch the light block at trusted_height+1 when detecting misbehaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 committed Nov 16, 2023
1 parent 9e1b91b commit 38f65a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/relayer/src/light_client/tendermint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ impl super::LightClient<CosmosSdkChain> for LightClient {
provider: self.peer_id,
};

let trusted_block = self.fetch(update_header.trusted_height)?;
// Get the light block at trusted_height + 1 from chain.
let trusted_block = self.fetch(update_header.trusted_height.increment())?;
if trusted_block.validators.hash() != update_header.trusted_validator_set.hash() {
return Err(Error::misbehaviour(format!(
"mismatch between the trusted validator set of the update \
Expand Down

0 comments on commit 38f65a6

Please sign in to comment.