@@ -38,13 +38,13 @@ pub(crate) async fn reconcile_batch<L2P: Provider<Scroll>>(
3838
3939 // The block matches the derived attributes and the block is below or equal to the
4040 // safe current safe head.
41- if attributes. block_number <= fcs. safe_block_info ( ) . number {
41+ if attributes. block_number <= fcs. finalized_block_info ( ) . number ||
42+ attributes. block_number <= fcs. safe_block_info ( ) . number
43+ {
4244 Ok :: < _ , ChainOrchestratorError > ( BlockConsolidationAction :: Skip ( block_info) )
4345 } else {
4446 // The block matches the derived attributes, no action is needed.
45- Ok :: < _ , ChainOrchestratorError > ( BlockConsolidationAction :: UpdateSafeHead (
46- block_info,
47- ) )
47+ Ok :: < _ , ChainOrchestratorError > ( BlockConsolidationAction :: UpdateFcs ( block_info) )
4848 }
4949 } else {
5050 // The block does not match the derived attributes, a reorg is needed.
@@ -81,7 +81,7 @@ impl BatchReconciliationResult {
8181 for next in & self . actions {
8282 if let Some ( last) = actions. last_mut ( ) {
8383 match ( last, next) {
84- ( last, next) if last. is_update_safe_head ( ) && next. is_update_safe_head ( ) => {
84+ ( last, next) if last. is_update_fcs ( ) && next. is_update_fcs ( ) => {
8585 * last = next. clone ( ) ;
8686 }
8787 _ => {
@@ -128,8 +128,8 @@ pub(crate) struct AggregatedBatchConsolidationActions {
128128/// An action that must be performed on the L2 chain to consolidate a block.
129129#[ derive( Debug , Clone ) ]
130130pub ( crate ) enum BlockConsolidationAction {
131- /// Update the safe head to the given block.
132- UpdateSafeHead ( L2BlockInfoWithL1Messages ) ,
131+ /// Update the fcs to the given block.
132+ UpdateFcs ( L2BlockInfoWithL1Messages ) ,
133133 /// The derived attributes match the L2 chain and the safe head is already at or beyond the
134134 /// block, so no action is needed.
135135 Skip ( L2BlockInfoWithL1Messages ) ,
@@ -138,9 +138,9 @@ pub(crate) enum BlockConsolidationAction {
138138}
139139
140140impl BlockConsolidationAction {
141- /// Returns true if the action is to update the safe head .
142- pub ( crate ) const fn is_update_safe_head ( & self ) -> bool {
143- matches ! ( self , Self :: UpdateSafeHead ( _) )
141+ /// Returns true if the action is to update the fcs .
142+ pub ( crate ) const fn is_update_fcs ( & self ) -> bool {
143+ matches ! ( self , Self :: UpdateFcs ( _) )
144144 }
145145
146146 /// Returns true if the action is to skip the block.
@@ -157,7 +157,7 @@ impl BlockConsolidationAction {
157157 /// skip, returns None for reorg.
158158 pub ( crate ) fn into_block_info ( self ) -> Option < L2BlockInfoWithL1Messages > {
159159 match self {
160- Self :: UpdateSafeHead ( info) | Self :: Skip ( info) => Some ( info) ,
160+ Self :: UpdateFcs ( info) | Self :: Skip ( info) => Some ( info) ,
161161 Self :: Reorg ( _attrs) => None ,
162162 }
163163 }
@@ -166,7 +166,7 @@ impl BlockConsolidationAction {
166166impl std:: fmt:: Display for BlockConsolidationAction {
167167 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
168168 match self {
169- Self :: UpdateSafeHead ( info) => {
169+ Self :: UpdateFcs ( info) => {
170170 write ! ( f, "UpdateSafeHead to block {}" , info. block_info. number)
171171 }
172172 Self :: Skip ( info) => write ! ( f, "Skip block {}" , info. block_info. number) ,
0 commit comments