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

EVM: Allow calling "native" methods through the CALL instruction #1839

Open
Stebalien opened this issue Aug 10, 2023 · 0 comments
Open

EVM: Allow calling "native" methods through the CALL instruction #1839

Stebalien opened this issue Aug 10, 2023 · 0 comments

Comments

@Stebalien
Copy link
Member

Currently, calling a native method requires delegate-calling the "call actor" precompile. This:

  1. Is annoying for smart contract developers: requires delegate call, doesn't work with the normal calling convention.
  2. Makes it harder to port existing smart wallets and multisigs.

However, there's a solution: intercept outbound calls to EVM handle_filecoin_method and translate them to native calls.

  • For EVM to EVM calls, this translation will be invisible because the input parameters will be translated back into the solidity ABI format on the other side. (assuming we guarantee that the data always round-trips exactly).
  • For EVM to native calls, this provides a nice way to invoke native actors without having to explicitly support such capabilities.
  • We can (later) extend this feature to EthAccounts, allowing EthAccounts to invoke native methods.

The downsides are:

  1. This is an "implicit" conversion. It should be safe for the reasons above (should be transparent in EVM -> EVM calls), but it's still strange. Technically, the EVM doesn't specify the ABI...
  2. The solidity function name, handle_filecoin_method, is unfortunate. But it's a bit late to change it now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant