diff --git a/batcher/aligned-batcher/src/config/mod.rs b/batcher/aligned-batcher/src/config/mod.rs index 9f53631ee..47adce463 100644 --- a/batcher/aligned-batcher/src/config/mod.rs +++ b/batcher/aligned-batcher/src/config/mod.rs @@ -38,7 +38,6 @@ impl NonPayingConfig { #[derive(Debug, Deserialize)] pub struct BatcherConfigFromYaml { pub block_interval: u64, - pub batch_size_interval: usize, pub max_proof_size: usize, pub max_batch_size: usize, pub eth_ws_reconnects: usize, diff --git a/batcher/aligned-batcher/src/lib.rs b/batcher/aligned-batcher/src/lib.rs index 0fb3b38d8..b8b7a19f0 100644 --- a/batcher/aligned-batcher/src/lib.rs +++ b/batcher/aligned-batcher/src/lib.rs @@ -68,7 +68,6 @@ pub struct Batcher { payment_service_fallback: BatcherPaymentService, batch_state: Mutex, max_block_interval: u64, - min_batch_len: usize, max_proof_size: usize, max_batch_size: usize, last_uploaded_batch_block: Mutex, @@ -194,7 +193,6 @@ impl Batcher { payment_service, payment_service_fallback, max_block_interval: config.batcher.block_interval, - min_batch_len: config.batcher.batch_size_interval, max_proof_size: config.batcher.max_proof_size, max_batch_size: config.batcher.max_batch_size, last_uploaded_batch_block: Mutex::new(last_uploaded_batch_block), @@ -750,17 +748,18 @@ impl Batcher { let current_batch_len = batch_state_lock.batch_queue.len(); let last_uploaded_batch_block_lock = self.last_uploaded_batch_block.lock().await; - if current_batch_len == 0 { - info!("Current batch is empty. Waiting for more proofs..."); + if current_batch_len < 2 { + info!( + "Current batch has {} proof. Waiting for more proofs...", + current_batch_len + ); return None; } - if batch_state_lock.batch_queue.len() < self.min_batch_len - && block_number < *last_uploaded_batch_block_lock + self.max_block_interval - { + if block_number < *last_uploaded_batch_block_lock + self.max_block_interval { info!( - "Current batch not ready to be posted. Current block: {} - Last uploaded block: {}. Current batch length: {} - Minimum batch length: {}", - block_number, *last_uploaded_batch_block_lock, batch_state_lock.batch_queue.len(), self.min_batch_len + "Current batch not ready to be posted. Minimium amount of {} blocks have not passed. Block passed: {}", self.max_block_interval, + block_number - *last_uploaded_batch_block_lock, ); return None; }