Skip to content

Commit

Permalink
Make batch size as a option (#7540)
Browse files Browse the repository at this point in the history
* batch size as a option

* Update crates/script/src/broadcast.rs

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>

* Update crates/script/src/broadcast.rs

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>

* Update crates/script/src/lib.rs

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>

* Update crates/script/src/lib.rs

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>

* Update crates/script/src/lib.rs

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>

---------

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
  • Loading branch information
hoaleee and DaniPopes authored Apr 6, 2024
1 parent 5b0dc8c commit 0c961f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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

0 comments on commit 0c961f7

Please sign in to comment.