Skip to content

Commit 81c904c

Browse files
authored
feat: always update safe head (#434)
* always update safe head * update comments
1 parent d6a78f9 commit 81c904c

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

crates/chain-orchestrator/src/consolidation.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,13 @@ pub(crate) async fn reconcile_batch<L2P: Provider<Scroll>>(
3636
// Extract the block info with L1 messages.
3737
let block_info: L2BlockInfoWithL1Messages = (&current_block).into();
3838

39-
// The block matches the derived attributes and the block is below or equal to the
40-
// safe current safe head.
41-
if attributes.block_number <= fcs.finalized_block_info().number ||
42-
((attributes.block_number <= fcs.safe_block_info().number) &&
43-
batch.target_status.is_consolidated())
44-
{
39+
// The derived attributes match the L2 chain but are associated with a block
40+
// number less than or equal to the finalized block, so skip.
41+
if attributes.block_number <= fcs.finalized_block_info().number {
4542
Ok::<_, ChainOrchestratorError>(BlockConsolidationAction::Skip(block_info))
4643
} else {
47-
// The block matches the derived attributes, no action is needed.
44+
// The block matches the derived attributes but is above the finalized block,
45+
// so we need to update the fcs.
4846
Ok::<_, ChainOrchestratorError>(BlockConsolidationAction::UpdateFcs(block_info))
4947
}
5048
} else {

0 commit comments

Comments
 (0)