Is there a way to batch multiple contract.callStatic calls at once? #2437
-
Hi I am running a local geth node and would like to perform numerous amounts of contract.callStatic calls. I have attempted to run 1000 and 10000 of the callStatic calls in parallel and it seems like when running 1000 calls in parallel with await promise.all() the request takes around a second and works fine, but when running 10000 requests in parallel the result returns in 30 some seconds or the result doesn't return at all and my node crashes. Is there any way to batch these callStatic calls or a better way to perform numerous callStatic calls? Thanks for your time! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
If you use a |
Beta Was this translation helpful? Give feedback.
-
Following up on this issue if we use What I am looking to achieve is actually simulate an approval function call then simulate another function call to deposit the erc20 token into a protocol since it internally calls the |
Beta Was this translation helpful? Give feedback.
If you use a
JsonRpcBatchProvider
, it will implicitly batch what it can. :)