Top-Level Batching #757
LayneHaber
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Motivation
Allowing batching to happen natively within the
Connextopens up more effective gas optimizations (i.e. batchingexecutecalls). Gas costs can be heavily optimized for transactions if routers are able to batch them safely. By using the Multicall by OZ contract, multiple functions may be called simultaneously while preserving anymsg.senderproperties (as the contract usesdelegatecall).Design Requirements
xcallandreconcile)Proposal
The
Connextcontract should inherit theMulticallcontract so that there is a.multicall(data)function on the contract itself.This will allow the sequencer to easily batch
executecalls by combining the individual payloads and callingexecand is simple to implement. However, it may miss out on more savings that could be included in a more function-specific implementation.Open Questions
What are the realistic gains from making a function-specific implementation (i.e.
executeMany), and can that be combined withMulticallto make an even more efficient and easy to use implementation? The majority of storage reads/writes are done bytransferId, except for the router balance, which is done byrouter. Could also help when sending out relayer fees, by handling them for multipleexecutecalls.When we start batching the nomad messages, there will still be leaf-based functions that will need to be executed (i.e.
processfor claiming against a leaf if you provided fast liquidity, andexecuteto provide fast liquidity for a leaf). These functions can be batched, but it is unlikely many of the per-batch transactions (i.e.dispatchto send a root over nomad,reconcileto update a root from nomad)Beta Was this translation helpful? Give feedback.
All reactions