Skip to content

Commit d15b533

Browse files
committed
update fcu logic
1 parent 5060dab commit d15b533

File tree

1 file changed

+8
-5
lines changed
  • crates/chain-orchestrator/src

1 file changed

+8
-5
lines changed

crates/chain-orchestrator/src/lib.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -407,12 +407,15 @@ impl<
407407

408408
// Check if the unwind impacts the fcs safe head.
409409
if let Some(block_info) = unwind_result.l2_safe_block_info {
410-
// If the safe head was unwound and is above or equal to the finalized head,
411-
// update the fcs.
412-
if block_info.number != self.engine.fcs().safe_block_info().number &&
413-
block_info.number >= self.engine.fcs().finalized_block_info().number
414-
{
410+
// If the new safe head is above the current finalized head, update the fcs safe
411+
// head to the new safe head.
412+
if block_info.number >= self.engine.fcs().finalized_block_info().number {
415413
self.engine.update_fcs(None, Some(block_info), None).await?;
414+
} else {
415+
// Otherwise, update the fcs safe head to the finalized head.
416+
self.engine
417+
.update_fcs(None, Some(*self.engine.fcs().finalized_block_info()), None)
418+
.await?;
416419
}
417420
}
418421

0 commit comments

Comments
 (0)