File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -190,6 +190,11 @@ where
190190 self . metrics . batch_queue_size . set ( self . batch_queue . len ( ) as f64 ) ;
191191 self . metrics . payload_attributes_queue_size . set ( self . attributes_queue . len ( ) as f64 ) ;
192192 }
193+
194+ /// Returns the size of the batch queue.
195+ pub fn batch_queue_size ( & self ) -> usize {
196+ self . batch_queue . len ( )
197+ }
193198}
194199
195200impl < P > Stream for DerivationPipeline < P >
Original file line number Diff line number Diff line change @@ -71,6 +71,10 @@ const CHAIN_ORCHESTRATOR_MAX_PENDING_FUTURES: usize = 20;
7171/// L1 notification channel.
7272const ENGINE_MAX_PENDING_FUTURES : usize = 5000 ;
7373
74+ /// The maximum number of pending batch commits in the derivation pipeline for acceptance of new
75+ /// events from the L1 notification channel.
76+ const DERIVATION_PIPELINE_MAX_PENDING_BATCHES : usize = 500 ;
77+
7478/// The main manager for the rollup node.
7579///
7680/// This is an endless [`Future`] that drives the state of the entire network forward and includes
@@ -541,7 +545,9 @@ where
541545 let chain_orchestrator_has_capacity = self . chain . pending_futures_len ( ) <
542546 CHAIN_ORCHESTRATOR_MAX_PENDING_FUTURES - L1_NOTIFICATION_CHANNEL_BUDGET as usize ;
543547 let engine_has_capacity = self . engine . pending_futures_len ( ) < ENGINE_MAX_PENDING_FUTURES ;
544- chain_orchestrator_has_capacity && engine_has_capacity
548+ let derivation_pipeline_has_capacity =
549+ self . derivation_pipeline . batch_queue_size ( ) < DERIVATION_PIPELINE_MAX_PENDING_BATCHES ;
550+ chain_orchestrator_has_capacity && engine_has_capacity && derivation_pipeline_has_capacity
545551 }
546552}
547553
You can’t perform that action at this time.
0 commit comments