Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
properly gate sanity check (#3684)
Browse files Browse the repository at this point in the history
  • Loading branch information
rphmeier authored and chevdor committed Aug 21, 2021
1 parent 160c057 commit e3901b8
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions node/service/src/relay_chain_selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,24 +412,23 @@ where
}
};

// Prevent sending flawed data to the dispute-coordinator.
if Some(subchain_block_descriptions.len() as _) !=
subchain_number.checked_sub(target_number)
{
tracing::error!(
LOG_TARGET,
present_block_descriptions = subchain_block_descriptions.len(),
target_number,
subchain_number,
"Mismatch of anticipated block descriptions and block number difference.",
);
return Ok(Some(target_hash))
}

let lag = initial_leaf_number.saturating_sub(subchain_number);
self.metrics.note_approval_checking_finality_lag(lag);

let lag = if cfg!(feature = "disputes") {
// Prevent sending flawed data to the dispute-coordinator.
if Some(subchain_block_descriptions.len() as _) !=
subchain_number.checked_sub(target_number)
{
tracing::error!(
LOG_TARGET,
present_block_descriptions = subchain_block_descriptions.len(),
target_number,
subchain_number,
"Mismatch of anticipated block descriptions and block number difference.",
);
return Ok(Some(target_hash))
}
// 3. Constrain according to disputes:
let (tx, rx) = oneshot::channel();
overseer
Expand Down

0 comments on commit e3901b8

Please sign in to comment.