reth
reth copied to clipboard
Compilation of `evm` crate to RISC-V in CI
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.
@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.?
looking into this
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.
@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.
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.