Skip to content

Commit

Permalink
OAK review. Issue #4. Forced authority set change handled as a misbeh…
Browse files Browse the repository at this point in the history
…aviour (#352)
  • Loading branch information
RustNinja authored Jun 17, 2023
1 parent ba90053 commit a358385
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion light-clients/ics10-grandpa/src/client_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ use codec::Decode;
use core::marker::PhantomData;
use finality_grandpa::Chain;
use grandpa_client_primitives::{
justification::{find_scheduled_change, AncestryChain, GrandpaJustification},
justification::{
find_forced_change, find_scheduled_change, AncestryChain, GrandpaJustification,
},
ParachainHeadersWithFinalityProof,
};
use ibc::{
Expand Down Expand Up @@ -327,6 +329,8 @@ where
ClientMessage::Header(header) => header,
_ => unreachable!("We've checked for misbehavior in line 180; qed"),
};
//forced authority set change is handled as a misbehaviour

let ancestry =
AncestryChain::<RelayChainHeader>::new(&header.finality_proof.unknown_headers);

Expand All @@ -335,6 +339,10 @@ where
Error::Custom(format!("No relay chain header found for hash: {relay_hash:?}"))
})?;

if find_forced_change(header).is_some() {
return Ok(true)
}

let (height, consensus_state) = ConsensusState::from_header::<H>(
parachain_header_proof,
client_state.para_id,
Expand Down

0 comments on commit a358385

Please sign in to comment.