From 4136954251c57614db13f90112ec1a28746f12e9 Mon Sep 17 00:00:00 2001 From: Nathan F Yospe Date: Tue, 14 May 2024 14:44:16 -0400 Subject: [PATCH] Only batch for private mempool --- sequencer/src/bin/submit-transactions.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sequencer/src/bin/submit-transactions.rs b/sequencer/src/bin/submit-transactions.rs index 19844b92d9..2dd1e38b08 100644 --- a/sequencer/src/bin/submit-transactions.rs +++ b/sequencer/src/bin/submit-transactions.rs @@ -132,6 +132,9 @@ impl Options { .clone() .unwrap_or_else(|| self.url.join("submit").unwrap()) } + fn use_public_mempool(&self) -> bool { + self.submit_url.is_none() + } } #[async_std::main] @@ -267,7 +270,11 @@ async fn submit_transactions( txns.push(tx); hashes.push(hash); - let randomized_batch_size = rng.gen_range(opt.min_batch_size..=opt.max_batch_size); + let randomized_batch_size = if opt.use_public_mempool() { + 1 + } else { + rng.gen_range(opt.min_batch_size..=opt.max_batch_size) + }; let txns_batch_count = txns.len() as u64; if randomized_batch_size <= txns_batch_count { if let Err(err) = if txns_batch_count == 1 {