Skip to content

Allow precompile to do subcalls ? #105

Closed
@nanocryk

Description

@nanocryk

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 :/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions