Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions crates/chain-orchestrator/src/consolidation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ pub(crate) async fn reconcile_batch<L2P: Provider<Scroll>>(
// Extract the block info with L1 messages.
let block_info: L2BlockInfoWithL1Messages = (&current_block).into();

// The derived attributes match the L2 chain but are associated with a block
// number less than or equal to the finalized block, so skip.
if attributes.block_number <= fcs.finalized_block_info().number {
// The block matches the derived attributes and the block is below or equal to the
// safe current safe head.
if attributes.block_number <= fcs.finalized_block_info().number ||
((attributes.block_number <= fcs.safe_block_info().number) &&
batch.target_status.is_consolidated())
{
Ok::<_, ChainOrchestratorError>(BlockConsolidationAction::Skip(block_info))
} else {
// The block matches the derived attributes but is above the finalized block,
// so we need to update the fcs.
// The block matches the derived attributes, no action is needed.
Ok::<_, ChainOrchestratorError>(BlockConsolidationAction::UpdateFcs(block_info))
}
} else {
Expand Down
Loading