Skip to content

Commit

Permalink
Only batch for private mempool
Browse files Browse the repository at this point in the history
  • Loading branch information
nyospe committed May 14, 2024
1 parent 5c24d9c commit 4136954
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sequencer/src/bin/submit-transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -267,7 +270,11 @@ async fn submit_transactions<Ver: StaticVersionType>(
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 {
Expand Down

0 comments on commit 4136954

Please sign in to comment.