Description
As part of Moonbeam we'd like to implement a precompile that allows to batch call, the precompile taking as parameters addresses, call data, etc; and performing multiple calls in one transaction on the behalf of the caller.
However with the current design it's not possible for a precompile to perform subcalls in the EVM. From Substrate/Frontier it's possible to call pallet_evm to spawn an inner EVM but it will act as its own transaction (transaction fees again, transaction events, etc).
Not sure how this can be implemented. PrecompileSet::execute
could be changed to take &mut self
, return either for the final result or to perform a subcall, and thus take as a parameter either the initial call parameters or the result of a subcall. However it seems a bit messy to manage. I thought using async/generators but yield
is unstable and I don't think we can use .await
to perform a subcall :/