Skip to content

Commit 00e222d

Browse files
committed
fix: identical misbehaviour headers
1 parent 5b87c66 commit 00e222d

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

cosmwasm/ibc-union/lightclient/ethereum/src/client.rs

+6
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,12 @@ pub fn verify_misbehaviour<C: ChainSpec>(
323323
Error::MisbehaviourCannotExist(slot_1, slot_2),
324324
)?;
325325

326+
ensure(
327+
misbehaviour.update_1.update_data().finalized_header
328+
!= misbehaviour.update_2.update_data().finalized_header,
329+
Error::IdenticalMisbehaviourHeaders,
330+
)?;
331+
326332
let current_slot =
327333
compute_slot_at_timestamp::<C>(client_state.genesis_time, ctx.env.block.time.seconds())
328334
.ok_or(Error::IntegerOverflow)?;

cosmwasm/ibc-union/lightclient/ethereum/src/errors.rs

+3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ pub enum Error {
5252
client_state_latest_slot: u64,
5353
consensus_state_slot: u64,
5454
},
55+
56+
#[error("the misbehaviour headers must be different")]
57+
IdenticalMisbehaviourHeaders,
5558
}
5659

5760
impl From<Error> for StdError {

0 commit comments

Comments
 (0)