Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make batch size as a option #7540

Merged
merged 6 commits into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/script/src/broadcast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ impl BundledState {

// We send transactions and wait for receipts in batches of 100, since some networks
// cannot handle more than that.
let batch_size = if sequential_broadcast { 1 } else { 100 };
let valid_batch_size = self.args.batch_size.min(100);
let batch_size = if sequential_broadcast { 1 } else { valid_batch_size };
let mut index = already_broadcasted;

for (batch_number, batch) in
Expand Down
4 changes: 4 additions & 0 deletions crates/script/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ pub struct ScriptArgs {
#[arg(long)]
pub broadcast: bool,

/// Batch size of transactions.
#[arg(long, default_value = "100")]
pub batch_size: usize,

/// Skips on-chain simulation.
#[arg(long)]
pub skip_simulation: bool,
Expand Down
Loading