Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation of evm crate to RISC-V in CI #8240

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

puma314
Copy link

@puma314 puma314 commented May 14, 2024

This is an extremely messy WIP draft of the modifications needed to get the reth_evm crate to compile inside a zkVM. I put it up as a draft to get comments on the approach.

crates/consensus/consensus/Cargo.toml Outdated Show resolved Hide resolved
crates/interfaces/src/blockchain_tree/error.rs Outdated Show resolved Hide resolved
crates/interfaces/src/error.rs Outdated Show resolved Hide resolved
crates/rpc/rpc/src/eth/api/mod.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall, supportive, but this will require a few more iterations.

let's start with using default-features = false in root cargo.toml workspace dependencies, so we don't need path imports

I'd also prefer if we could do this in a smaller pr first that just focuses on this

crates/evm/Cargo.toml Outdated Show resolved Hide resolved
@puma314
Copy link
Author

puma314 commented May 14, 2024

@mattsse do you have a suggestion for what to do for this import use reth_network_api::NetworkError? Any chance that we can move it to primitives and import it from there in interfaces, etc.?

@mattsse
Copy link
Collaborator

mattsse commented May 14, 2024

looking into this

@puma314
Copy link
Author

puma314 commented May 14, 2024

Also do you have an recommendation of where to put the compilation to RISC-V test? I can put it in testing and add a git workflow for it. Can also add a dockerfile with all the relevant installs of the toolchains so that there is not need for an install script, etc.

@puma314
Copy link
Author

puma314 commented May 16, 2024

@mattsse @gakonst this is ready for review, I cleaned it up significantly and found a sustainable solution for the NetworkError. I also added the testing of the zkVM compilation via Dockerfile environment.

@puma314 puma314 changed the title WIP: Compilation of evm crate to RISC-V Compilation of evm crate to RISC-V in CI May 16, 2024
@puma314 puma314 marked this pull request as ready for review May 16, 2024 05:15
@puma314
Copy link
Author

puma314 commented May 23, 2024

By the way @mattsse these are the crates + methods from them that would be nice to have compiled to RISC-V:

  • reth-primitives = { path = "../../crates/primitives", default-features = false, features = ["alloy-compat"]}
  • reth-consensus.workspace = true
  • reth-interfaces = { path = "../../crates/interfaces", default-features = false }
  • reth-evm.workspace = true
  • revm.workspace = true
  • reth-revm.workspace = true
  • revm-primitives.workspace = true

In particular, we use the reth_evm::Executor (like this: use reth_evm::execute::{BlockExecutionOutput, BlockExecutorProvider, Executor};) to actually run the execution.

You can see the crates + method we use in this WIP draft PR I made here that implements a zkEVM STF using the crates above if that's helpful context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants