@@ -1252,9 +1252,12 @@ impl Batcher {
12521252 let last_uploaded_batch_block_lock = self . last_uploaded_batch_block . lock ( ) . await ;
12531253
12541254 if current_batch_len < 1 {
1255+ let min_max_fee = self . get_min_max_fee ( ) . await ;
12551256 info ! (
1256- "Current batch has {} proofs. Waiting for more proofs..." ,
1257- current_batch_len
1257+ "Current batch has {} proofs, min max fee {} for a batch of {}. Waiting for more proofs..." ,
1258+ current_batch_len,
1259+ min_max_fee,
1260+ self . amount_of_proofs_for_min_max_fee
12581261 ) ;
12591262 return None ;
12601263 }
@@ -1936,6 +1939,14 @@ impl Batcher {
19361939 + BATCHER_SUBMISSION_BASE_GAS_COST
19371940 }
19381941
1942+ async fn get_min_max_fee ( & self ) -> U256 {
1943+ let gas_price = * self . latest_block_gas_price . read ( ) . await ;
1944+ aligned_sdk:: verification_layer:: compute_fee_per_proof_formula (
1945+ self . amount_of_proofs_for_min_max_fee ,
1946+ gas_price,
1947+ )
1948+ }
1949+
19391950 /// Checks if the message signature is valid
19401951 /// and returns the address if its.
19411952 /// If not, returns false, logs the error,
@@ -2047,11 +2058,7 @@ impl Batcher {
20472058 }
20482059
20492060 async fn msg_covers_minimum_max_fee ( & self , msg_max_fee : U256 ) -> bool {
2050- let gas_price = * self . latest_block_gas_price . read ( ) . await ;
2051- let min_max_fee_per_proof = aligned_sdk:: verification_layer:: compute_fee_per_proof_formula (
2052- self . amount_of_proofs_for_min_max_fee ,
2053- gas_price,
2054- ) ;
2061+ let min_max_fee_per_proof = self . get_min_max_fee ( ) . await ;
20552062 msg_max_fee >= min_max_fee_per_proof
20562063 }
20572064
0 commit comments