diff --git a/crates/script/src/broadcast.rs b/crates/script/src/broadcast.rs index 04329891d28f..983c02374fb6 100644 --- a/crates/script/src/broadcast.rs +++ b/crates/script/src/broadcast.rs @@ -319,15 +319,11 @@ impl BundledState { let pb = init_progress!(transactions, "txes"); - // We send transactions and wait for receipts in batches of 100, since some networks - // cannot handle more than that. - let valid_batch_size = self.args.batch_size.min(100); - let batch_size = if sequential_broadcast { 1 } else { valid_batch_size }; + // We send transactions and wait for receipts in batches. + let batch_size = if sequential_broadcast { 1 } else { self.args.batch_size }; let mut index = already_broadcasted; - for (batch_number, batch) in - transactions.chunks(batch_size).map(|f| f.to_vec()).enumerate() - { + for (batch_number, batch) in transactions.chunks(batch_size).enumerate() { let mut pending_transactions = vec![]; shell::println(format!( @@ -335,17 +331,17 @@ impl BundledState { batch_number * batch_size, batch_number * batch_size + std::cmp::min(batch_size, batch.len()) - 1 ))?; - for (tx, kind, is_fixed_gas_limit) in batch.into_iter() { - let tx_hash = send_transaction( + for (tx, kind, is_fixed_gas_limit) in batch { + let fut = send_transaction( provider.clone(), - tx, - kind, + tx.clone(), + kind.clone(), sequential_broadcast, - is_fixed_gas_limit, + *is_fixed_gas_limit, estimate_via_rpc, self.args.gas_estimate_multiplier, ); - pending_transactions.push(tx_hash); + pending_transactions.push(fut); } if !pending_transactions.is_empty() { diff --git a/crates/script/src/lib.rs b/crates/script/src/lib.rs index 1f002d4bbc6e..5b27a5ff420e 100644 --- a/crates/script/src/lib.rs +++ b/crates/script/src/lib.rs @@ -108,6 +108,8 @@ pub struct ScriptArgs { pub broadcast: bool, /// Batch size of transactions. + /// + /// This is ignored and set to 1 if batching is not available or `--slow` is enabled. #[arg(long, default_value = "100")] pub batch_size: usize,