@@ -6,7 +6,7 @@ use aligned_sdk::{
66 } ,
77} ;
88use ethers:: types:: { Address , Signature , U256 } ;
9- use priority_queue:: DoublePriorityQueue ;
9+ use priority_queue:: PriorityQueue ;
1010use std:: {
1111 hash:: { Hash , Hasher } ,
1212 ops:: ControlFlow ,
@@ -119,7 +119,7 @@ impl Ord for BatchQueueEntryPriority {
119119 }
120120}
121121
122- pub ( crate ) type BatchQueue = DoublePriorityQueue < BatchQueueEntry , BatchQueueEntryPriority > ;
122+ pub ( crate ) type BatchQueue = PriorityQueue < BatchQueueEntry , BatchQueueEntryPriority > ;
123123
124124/// Calculates the size of the batch represented by the given batch queue.
125125pub ( crate ) fn calculate_batch_size ( batch_queue : & BatchQueue ) -> Result < usize , BatcherError > {
@@ -165,7 +165,7 @@ pub(crate) fn try_build_batch(
165165 let mut finalized_batch = batch_queue;
166166 let mut batch_size = calculate_batch_size ( & finalized_batch) ?;
167167
168- while let Some ( ( entry, _) ) = finalized_batch. peek_max ( ) {
168+ while let Some ( ( entry, _) ) = finalized_batch. peek ( ) {
169169 let batch_len = finalized_batch. len ( ) ;
170170 let fee_per_proof = calculate_fee_per_proof ( batch_len, gas_price, constant_gas_cost) ;
171171
@@ -186,7 +186,7 @@ pub(crate) fn try_build_batch(
186186 . len ( ) ;
187187 batch_size -= verification_data_size;
188188
189- finalized_batch. pop_max ( ) ;
189+ finalized_batch. pop ( ) ;
190190
191191 continue ;
192192 }
@@ -201,7 +201,7 @@ pub(crate) fn try_build_batch(
201201 return Err ( BatcherError :: BatchCostTooHigh ) ;
202202 }
203203
204- Ok ( finalized_batch. clone ( ) . into_descending_sorted_vec ( ) )
204+ Ok ( finalized_batch. clone ( ) . into_sorted_vec ( ) )
205205}
206206
207207fn calculate_fee_per_proof ( batch_len : usize , gas_price : U256 , constant_gas_cost : u128 ) -> U256 {
0 commit comments