cronos icon indicating copy to clipboard operation
cronos copied to clipboard

Use evm precompiles to replace ibc hooks/evm hooks

Open yihuang opened this issue 3 years ago • 1 comments

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?

yihuang avatar May 18 '22 08:05 yihuang

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.

yihuang avatar May 18 '22 12:05 yihuang