@@ -1062,6 +1062,7 @@ impl Batcher {
10621062 let new_entry_priority = BatchQueueEntryPriority :: new ( max_fee, nonce) ;
10631063
10641064 if batch_queue_len + 1 > self . max_batch_proof_qty {
1065+ info ! ( "Batch queue is full. Trying to remove an entry..." ) ;
10651066 let ( lowest_priority_entry, lowest_priority_entry_priority) =
10661067 get_lowest_priority_entry ( & batch_state_lock. batch_queue ) . unwrap ( ) ;
10671068
@@ -1071,16 +1072,28 @@ impl Batcher {
10711072 . remove ( & lowest_priority_entry)
10721073 . is_none ( )
10731074 {
1074- //err
1075+ // If this happens, we have a bug in our code
1076+ error ! ( "Some proofs were not found in the queue. This should not happen." ) ;
1077+ std:: mem:: drop ( batch_state_lock) ;
1078+ return Err ( BatcherError :: QueueRemoveError (
1079+ "Some proofs were not found in the queue" . into ( ) ,
1080+ ) ) ;
10751081 }
1082+ info ! ( "Removed entry from batch queue." ) ;
10761083
1077- // todo send msg to the removed entry ws
1084+ send_message (
1085+ lowest_priority_entry. messaging_sink . unwrap ( ) ,
1086+ SubmitProofResponseMessage :: AddToBatchError ,
1087+ )
1088+ . await ;
10781089
10791090 batch_state_lock
10801091 . batch_queue
10811092 . push ( new_entry, new_entry_priority) ;
10821093 } else {
1083- // can't accept the new proof
1094+ error ! ( "Queue is full and fee isn't enough" ) ;
1095+ std:: mem:: drop ( batch_state_lock) ;
1096+ return Err ( BatcherError :: BatchQueueIsFull ) ;
10841097 }
10851098 } else {
10861099 batch_state_lock
0 commit comments