@@ -1049,26 +1049,23 @@ impl Batcher {
10491049
10501050 let max_fee = verification_data. max_fee ;
10511051 let nonce = verification_data. nonce ;
1052-
1053- info ! ( "ME llega max_fee {}" , max_fee ) ;
1054-
1055- let new_entry = BatchQueueEntry :: new (
1056- verification_data ,
1057- verification_data_comm ,
1058- ws_conn_sink ,
1059- proof_submitter_sig ,
1060- proof_submitter_addr ,
1052+ batch_state_lock . batch_queue . push (
1053+ BatchQueueEntry :: new (
1054+ verification_data ,
1055+ verification_data_comm ,
1056+ ws_conn_sink ,
1057+ proof_submitter_sig ,
1058+ proof_submitter_addr ,
1059+ ) ,
1060+ BatchQueueEntryPriority :: new ( max_fee , nonce ) ,
10611061 ) ;
1062- let new_entry_priority = BatchQueueEntryPriority :: new ( max_fee, nonce) ;
1063-
1064- batch_state_lock
1065- . batch_queue
1066- . push ( new_entry, new_entry_priority) ;
10671062
10681063 let batch_queue_len = batch_state_lock. batch_queue . len ( ) ;
10691064
1070- // if max batch qty exceded, remove least priority proof
1065+ // if max batch qty exceded, remove least priority element
10711066 if batch_queue_len > self . max_batch_proof_qty {
1067+ info ! ( "Queue limit exceded, removing least priority element" ) ;
1068+
10721069 if let Some ( lowest_priority_entry) = batch_state_lock. batch_queue . pop_min ( ) {
10731070 send_message (
10741071 lowest_priority_entry. 0 . messaging_sink . unwrap ( ) ,
@@ -1081,7 +1078,6 @@ impl Batcher {
10811078 // Update metrics
10821079 let queue_len = batch_state_lock. batch_queue . len ( ) ;
10831080 let queue_size_bytes = calculate_batch_size ( & batch_state_lock. batch_queue ) ?;
1084-
10851081 self . metrics
10861082 . update_queue_metrics ( queue_len as i64 , queue_size_bytes as i64 ) ;
10871083
0 commit comments