evmos / ethermint

Ethermint is a Cosmos SDK library for running scalable and interoperable EVM chains
https://docs.evmos.org/
GNU Lesser General Public License v3.0
1.81k stars 535 forks source link

Support Running Rust Based EVM Impls. #1349

Closed itsdevbear closed 1 year ago

itsdevbear commented 1 year ago

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.

jbowen93 commented 1 year ago

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.

itsdevbear commented 1 year ago

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 commented 1 year ago

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

jbowen93 commented 1 year ago

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.

yihuang commented 1 year ago

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.

itsdevbear commented 1 year ago

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

yihuang commented 1 year ago

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?

itsdevbear commented 1 year ago

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.

github-actions[bot] commented 1 year ago

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.