-
Notifications
You must be signed in to change notification settings - Fork 128
Open
Description
To achieve true interoperability between native code(precompiles) and EVM, native code should be able to call EVM in the same EVM instance.
Precompiles can call the four variant of evm.Call* method to call evm contracts with the current evm instance, but there are a few issues to beware of:
-
Context passing. Precompile should pass the current calling context down the stream.
- to do that, precompiles needs to receive the correct calling contexts first (Problem: precompile don't carry full EVM context go-ethereum#10).
- jumpDests cache need to be passed as well.
-
Precompile implementations should deal with re-entrant calls.
Anything else? or is there projects that had did this before that we can take as reference?
Use Cases
Any non-trivial precompile contract will need to be able to call back into EVM world back and force, for example a native DEX that works with ERC20 contracts.
Metadata
Metadata
Assignees
Labels
No labels