Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow precompile to do subcalls ? #105

Closed
nanocryk opened this issue Mar 18, 2022 · 2 comments · May be fixed by #117
Closed

Allow precompile to do subcalls ? #105

nanocryk opened this issue Mar 18, 2022 · 2 comments · May be fixed by #117

Comments

@nanocryk
Copy link
Contributor

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

@sorpaas
Copy link
Member

sorpaas commented Nov 23, 2023

@nanocryk As I recall we never merged this into production. Do you still need this feature or did you use some workarounds instead?

@sorpaas
Copy link
Member

sorpaas commented Nov 23, 2023

Anyway this now works with #232.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants