foundry icon indicating copy to clipboard operation
foundry copied to clipboard

`--buffer` flag for `forge script` to adjust broadcast buffer size

Open chlwys opened this issue 1 year ago • 3 comments

Component

Forge

Describe the feature you would like

add a --buffer flag for forge script to adjust broadcast buffer size – transactions are broadcasted in hardcoded batches of 100, introduced in https://github.com/foundry-rs/foundry/pull/1824. This is fine for most chains, but is still too big for some (eg Optimism Sepolia).

--slow works, but can be excruciatingly slow with big scripts. Proposing --buffer as an optional flag (defaults to 100) that customises this broadcast buffer size. This would enable somewhere between --slow and buffer=100 and bigger buffer sizes for chains that support it

Additional context

working on a large testnet deployment on Optimism Sepolia (~2000 txes) and getting rate limited very quickly. Running a personal archive node, tracked down the issue to the central sequencer rate limiting after sending about 20-30 transactions at once

--slow takes over 12h to run this script TT

chlwys avatar Dec 26 '23 21:12 chlwys

Sounds reasonable, wdyt @Evalir @mattsse

DaniPopes avatar Jan 29 '24 19:01 DaniPopes

Yeah I think this is a good idea. We've seen similar complaints about the batch size a few months ago, doesn't hurt to add it

Evalir avatar Jan 30 '24 12:01 Evalir

<3

chlwys avatar Feb 14 '24 13:02 chlwys

Implemented as --batch-size in https://github.com/foundry-rs/foundry/pull/7540

DaniPopes avatar Apr 06 '24 15:04 DaniPopes