Skip to content

lita-xyz/reth-valida

This branch is 13 commits behind main.

Repository files navigation

This crate is a modified version of reth, to be run on the Valida zkVM.

It is to be used in conjunction with prepare_block. It reads a specific serialized block prepared by prepare_block, and prove the block on the Ethereum engine, using Valida.

Compilation

To compile this to run on the Valida zkVM, make sure you have the Valida Compiler installed. Follow its README to install. Make sure there is no error in the compilation process.

After the Valida compiler is successfully installed, run the following command in the reth-valida directory:

cargo +valida build --release

This is in active development. If you get compilation errors, run git pull, cargo clean, cargo updateand try again.

If you get the following error:

error: toolchain 'valida' is not installable

Run this script from the Valida repo to add the Valida compiler to rustc.

Proving a block

After successful compilation, the binary will be in target/delendum-unknown-baremetal-gnu/release/reth-valida. One can prove a block by running the binary in Valida, with the block data input input.bin (obtained from running prepare_block, more details to follow). To do this, run this command in the valida-toolchain directory:

./valida/target/release/valida run ../reth-valida/target/delendum-unknown-baremetal-gnu/release/reth-valida log ../prepare_block/input.bin

Alternatively, run the built binary in a valida-shell with the block data input file:

>valida run <path to reth-valida binary> log <path to input.bin>

Preparing block data

To prepare the block data, clone the prepare_block repository and run the following command (see also its README):

Note that prepare_block is not intended to be compiled with the Valida compiler because it has features that are not supported by the Valida compiler. Use the standard Rust toolchain to compile and run prepare_block.

cargo run -- --rpc-url "<RPC URL>" --block-number <block number>

The output will be in the current directory as input.bin.

This is in active development. If you get compilation errors, run git pull, cargo clean, cargo updateand try again.

About

revm/reth block proving on Valida

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages