ethermint icon indicating copy to clipboard operation
ethermint copied to clipboard

Support Running Rust Based EVM Impls.

Open itsdevbear opened this issue 1 year ago • 4 comments

Related to: https://github.com/evmos/ethermint/issues/1348

Proposal: Support Running Rust Based EVM Impls.

Current behavior: Supporting geth and geth like golang EVM implementations

Desired behavior: Enable the ability to bind a Rust based evm implementation via x/evm/vm

Use case: Rust has certain performance benefits that we have seen in EVM implementations such as https://github.com/akula-bft/akula. Using FFI, it is possible to call a rust based EVM from the EVM module. Example: https://github.com/mediremi/rust-plus-golang

Requests may be closed if we're not actively planning to work on them.

itsdevbear avatar Sep 16 '22 18:09 itsdevbear

If FFI is used to do this then you don't get to remove cgo. If you want to use the architectural improvements present in Akula you could use erigon.

The work that Paradigm did here (https://github.com/gakonst/narwhal-abci-evm) could also be used to see how to make an ABCI connection to an EVM in Rust without using the Cosmos-SDK.

jbowen93 avatar Sep 26 '22 14:09 jbowen93

Oh 100% FFI would require CGO, you were probably thinking of https://github.com/evmos/ethermint/issues/1348, in that embodiment there could be a way to remove CGO.

Paradigm repo is cool, have played with it a bunch.

itsdevbear avatar Sep 26 '22 14:09 itsdevbear

This issue was more related to the work done here https://github.com/evmos/ethermint/commit/acf15474e78ce53f26dbdfe1b1148446d2ebf56e

Which began the process of opening up alternative EVM implementations apart from geth

itsdevbear avatar Sep 26 '22 15:09 itsdevbear

This issue was more related to the work done here https://github.com/evmos/ethermint/commit/acf15474e78ce53f26dbdfe1b1148446d2ebf56e

Ya I didn't see an issue attached to that PR and this seemed like the closest thing. I'd assume this and #1348 would both fall under "modularize the EVM interface" but there's no parent tracking issue for that.

jbowen93 avatar Sep 26 '22 15:09 jbowen93

I think we just need to support evmc interface: https://github.com/evmos/ethermint/issues/1310

But I guess supporting external evm implementation is in conflict with precompiles support, unless we can somehow make them work together.

yihuang avatar Oct 27 '22 02:10 yihuang

Once we get through precompiles we're going to start hacking Erigon in, we have a baby POC but its hood.

itsdevbear avatar Oct 27 '22 03:10 itsdevbear

Once we get through precompiles we're going to start hacking Erigon in, we have a baby POC but its hood.

Erigon, awesome, do you plan to adopt the db structure? replacing iavl tree?

yihuang avatar Oct 27 '22 03:10 yihuang

Potentially, first step would be using the VM. Through x/evm/vm folder structure .

We are toying with the idea of storing EVM state outside of the KvStore, as a way to solve some of the issues we've seen. But not too sure yet. Feels hacky.

itsdevbear avatar Oct 27 '22 17:10 itsdevbear

This issue is stale because it has been open 45 days with no activity. Remove Status: Stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Dec 12 '22 00:12 github-actions[bot]