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
-
Motivation
Allowing batching to happen natively within the
Connext
opens up more effective gas optimizations (i.e. batchingexecute
calls). 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.sender
properties (as the contract usesdelegatecall
).Design Requirements
xcall
andreconcile
)Proposal
The
Connext
contract should inherit theMulticall
contract so that there is a.multicall(data)
function on the contract itself.This will allow the sequencer to easily batch
execute
calls by combining the individual payloads and callingexec
and 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 withMulticall
to 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 multipleexecute
calls.When we start batching the nomad messages, there will still be leaf-based functions that will need to be executed (i.e.
process
for claiming against a leaf if you provided fast liquidity, andexecute
to provide fast liquidity for a leaf). These functions can be batched, but it is unlikely many of the per-batch transactions (i.e.dispatch
to send a root over nomad,reconcile
to update a root from nomad)Beta Was this translation helpful? Give feedback.
All reactions