cronos
cronos copied to clipboard
Use evm precompiles to replace ibc hooks/evm hooks
https://github.com/loredanacirstea/ethermint/blob/precompiles-ibc7/x/evm/vm/precompiles.go#L39
Advantages
- Directly called by contract, can return execution result to caller, more convenient.
Pitfalls
- when precompiled contracts executed, the evm state modifications are not persisted in native storage yet, so they are not visible to the native code, need to be careful when handling user balances.
- contract exception revert don't work with native storage changes?
I guess there's one way to make it work, it's to manage the state inside statedb, or find a way to make statedb extensible.