You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The EVM is single threaded. So users will intuitively expect client.multicall(calls) to be faster than Promise.all(calls.map(call => client.call(call) but this is actually not the case.
Solution
We don't want users to think about this so we should optimize multicall to be faster
Write a javascript precompile for multicall that optimizes multicall by running it in parallel
Write plug into the EVM to detect whenever the bytecode matches multicall3 and if it does use our javascript precompile rather than executing the evm bytecode
The text was updated successfully, but these errors were encountered:
We want gas metering to be right so what we should do is run the calls in parallel but then at the end run it all together to produce the final result. Running it all together can naively just reexecute now that all state has been cached or if we want to avoid the 2x overhead we can just return early from the inner calls
The EVM is single threaded. So users will intuitively expect
client.multicall(calls)
to be faster thanPromise.all(calls.map(call => client.call(call)
but this is actually not the case.Solution
We don't want users to think about this so we should optimize multicall to be faster
The text was updated successfully, but these errors were encountered: