fix: check if head block is already canonical (#9900)

This commit is contained in:
Matthias Seitz
2024-07-30 14:01:21 +02:00
committed by GitHub
parent 4f8721aff2
commit e3d375a8f3

View File

@@ -1632,7 +1632,14 @@ where
return Ok(valid_outcome(state.head_block_hash))
}
// 3. we don't have the block to perform the update
// 3. check if the head is already part of the canonical chain
if let Ok(Some(canonical_header)) = self.find_canonical_header(state.head_block_hash) {
debug!(target: "engine", head = canonical_header.number, "fcu head block is already canonical");
// the head block is already canonical
return Ok(valid_outcome(state.head_block_hash))
}
// 4. we don't have the block to perform the update
let target = self.lowest_buffered_ancestor_or(state.head_block_hash);
Ok(TreeOutcome::new(OnForkChoiceUpdated::valid(PayloadStatus::from_status(