diff --git a/network/src/lib.rs b/network/src/lib.rs index 9a1b07e198..6e2839fdff 100644 --- a/network/src/lib.rs +++ b/network/src/lib.rs @@ -35,6 +35,8 @@ use std::marker::PhantomData; /// valid parachain-block candidate. /// Data encoding is just `GossipMessage`, the relay-chain validator candidate statement message is /// the justification. +/// +/// Note: if no justification is provided the annouce is considered valid. pub struct JustifiedBlockAnnounceValidator { authorities: Vec, phantom: PhantomData, @@ -53,6 +55,11 @@ impl BlockAnnounceValidator for JustifiedBlockAnnounceValidator fn validate(&mut self, header: &B::Header, mut data: &[u8]) -> Result> { + // If no data is provided the announce is valid. + if data.is_empty() { + return Ok(Validation::Success) + } + // Check data is a gossip message. let gossip_message = GossipMessage::decode(&mut data) .map_err(|_| Box::new(ClientError::BadJustification(