File tree Expand file tree Collapse file tree
batcher/aligned-batcher/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -808,8 +808,10 @@ impl Batcher {
808808 nonced_verification_data. nonce ,
809809 ) ;
810810
811+
811812 if let Some ( lowest_entry_priority) = batch_state_lock. lowest_entry_priority ( ) {
812- // If the new proof has more priority than the lowest one in the queue, discard the latter one and push the new one
813+ // If the new proof has higher priority than the lowest-priority proof in the queue,
814+ // discard the lowest-priority proof and insert the new proof according to its priority.
813815 if lowest_entry_priority. cmp ( & msg_entry_priority) == Ordering :: Greater {
814816 let Some ( ( removed_entry, _) ) = batch_state_lock. batch_queue . pop ( ) else {
815817 warn ! ( "Failed to remove lowest-priority proof despite queue being full." ) ;
Original file line number Diff line number Diff line change @@ -232,7 +232,7 @@ impl BatchState {
232232 pub ( crate ) fn update_user_state_on_entry_removal ( & mut self , removed_entry : & BatchQueueEntry ) {
233233 let addr = removed_entry. sender ;
234234
235- let last_max_fee_limit = match self
235+ let new_last_max_fee_limit = match self
236236 . batch_queue
237237 . iter ( )
238238 . filter ( |( e, _) | e. sender == addr)
@@ -248,8 +248,8 @@ impl BatchState {
248248 if let Entry :: Occupied ( mut user_state) = self . user_states . entry ( addr) {
249249 user_state. get_mut ( ) . proofs_in_batch -= 1 ;
250250 user_state. get_mut ( ) . nonce -= U256 :: one ( ) ;
251- user_state. get_mut ( ) . total_fees_in_queue -= U256 :: one ( ) ;
252- user_state. get_mut ( ) . last_max_fee_limit = last_max_fee_limit ;
251+ user_state. get_mut ( ) . total_fees_in_queue -= user_state . get_mut ( ) . last_max_fee_limit ;
252+ user_state. get_mut ( ) . last_max_fee_limit = new_last_max_fee_limit ;
253253 }
254254 }
255255
You can’t perform that action at this time.
0 commit comments