Skip to content

Commit

Permalink
Fetch the light block at trusted_height + 1 when detecting misbehavior (
Browse files Browse the repository at this point in the history
#3727)

* fetch the light block at trusted_height+1 when detecting misbehaviour

* Add changelog entry

* Fix typo

---------

Co-authored-by: beer-1 <[email protected]>
  • Loading branch information
romac and beer-1 authored Dec 13, 2023
1 parent 045023a commit 7093e7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Fix a bug in the `evidence` command which would sometimes
prevent the detected misbehaviour evidence from being submitted,
instead erroring out with a validator set hash mismatch.
([\#3697](https://github.com/informalsystems/hermes/pull/3697))
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 7093e7a

Please sign in to comment.