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 1 commit
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 = if self.args.batch_size > 100 { 100 } else { self.args.batch_size };
hoaleee marked this conversation as resolved.
Show resolved Hide resolved
let batch_size = if sequential_broadcast { 1 } else { valid_batch_size as usize };
hoaleee marked this conversation as resolved.
Show resolved Hide resolved
let mut index = already_broadcasted;

for (batch_number, batch) in
Expand Down
6 changes: 6 additions & 0 deletions crates/script/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,14 @@ pub struct ScriptArgs {

/// Broadcasts the transactions.
#[arg(long)]

hoaleee marked this conversation as resolved.
Show resolved Hide resolved
pub broadcast: bool,

/// Batch size of transactions.
/// --batch-size
hoaleee marked this conversation as resolved.
Show resolved Hide resolved
#[arg(long, default_value = "100")]
pub batch_size: i32,
hoaleee marked this conversation as resolved.
Show resolved Hide resolved

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