File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -201,16 +201,19 @@ pub(crate) fn extract_batch_directly(
201201 return Err ( BatcherError :: BatchCostTooHigh ) ;
202202 }
203203
204- // Extract the batch entries (the ones that will pay enough)
205- let batch_entries = batch_queue. clone ( ) . into_sorted_vec ( ) ;
206- batch_queue. clear ( ) ;
204+ // Extract remaining entries in sorted order
205+ // Since pop() gives highest priority first, we collect them directly
206+ let mut batch_for_posting = Vec :: new ( ) ;
207+ while let Some ( ( entry, _) ) = batch_queue. pop ( ) {
208+ batch_for_posting. push ( entry) ;
209+ }
207210
208211 // Put back the rejected entries (they stay in the queue for later)
209212 for ( entry, priority) in rejected_entries {
210213 batch_queue. push ( entry, priority) ;
211214 }
212215
213- Ok ( batch_entries )
216+ Ok ( batch_for_posting )
214217}
215218
216219fn calculate_fee_per_proof ( batch_len : usize , gas_price : U256 , constant_gas_cost : u128 ) -> U256 {
You can’t perform that action at this time.
0 commit comments