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

Build blocks using Reth 1.1.0 #115

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

Build blocks using Reth 1.1.0 #115

wants to merge 91 commits into from

Conversation

hashcashier
Copy link
Contributor

@hashcashier hashcashier commented Oct 29, 2024

This PR migrates zeth from directly using revm to using reth for building blocks. This allows zeth to support all forks supported by reth. The changes are an overhaul of many of zeth's internal components and project structure. Notably, because of Cargo's feature unification, and reth's dependence on feature flags for enabling/disabling OP functionality, two separate zeth binaries are now necessary.

The project has been restructured into the following crates:

  • zeth-core Library for defining and using the sparse MPT to statelessly build a block using reth.
  • zeth-core-ethereum Specialization of the core library for Ethereum blocks.
  • zeth-core-optimism Specialization of the core library for Optimism blocks.
  • zeth-preflight Library for populating the data required to statelessly build a block using zeth-core.
  • zeth-preflight-ethereum Specialization of the preflight library for Ethereum RPCs.
  • zeth-preflight-optimism Specialization of the preflight library for Optimism RPCs.
  • zeth-guests-reth-ethereum A binary for running the stateless block building process for Ethereum blocks.
  • zeth-guests-reth-optimism A binary for running the stateless block building process for Optimism blocks.
  • zeth-guests Library for exporting the compiled rv32im bytecode of zeth-guests-reth.
  • zeth A library for running a CLI to use the RISC Zero zkVM to generate/verify proofs for the stateless block building process.
  • zeth-ethereum A binary using the zeth crate for Ethereum blocks.
  • zeth-optimism A binary using the zeth crate for Optimism blocks.
  • zeth-benchmark A binary for benchmarking proving performance for randomly sampled blocks.

Functionality changes:

  • All ethereum types have been migrated to alloy types.
  • All Bonsai and profiling logic has been delegated to r0vm's environment variables.
  • Optimism consensus verification (block derivation) logic has been removed.
  • Ethereum foundation testing is unfinished.

Note: v1.81 of the toolchain is required:

rzup update

Note: Separate binaries must be built individually

cargo build -p zeth-ethereum --bin zeth-ethereum
cargo build -p zeth-optimism --bin zeth-optimism

Issues affected:

@pdg744
Copy link

pdg744 commented Nov 7, 2024

@hashcashier @SchmErik iiuc v1.81 toolchain should now be ready to use!

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