Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ CARGO_WORKSPACE_DIR = { value = "", relative = true }
succinct = ["run", "-p", "xtask", "--", "succinct", "--"]
zkm = ["run", "-p", "xtask", "--", "zkm", "--"]
risc0 = ["run", "-p", "xtask", "--", "risc0", "--"]
pico = ["run", "-p", "xtask", "--", "pico", "--"]
2 changes: 1 addition & 1 deletion .github/workflows/rust_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
./scripts/download-and-extract-fixtures.sh

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@nightly
with:
components: clippy, rustfmt

Expand Down
65 changes: 11 additions & 54 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ benchmark-runner = { path = "crates/benchmark-runner" }
zkvm-interface = { git = "https://github.com/eth-applied-research-group/ere", package = "zkvm-interface" }
ere-sp1 = { git = "https://github.com/eth-applied-research-group/ere", package = "ere-sp1" }
ere-risczero = { git = "https://github.com/eth-applied-research-group/ere", package = "ere-risczero" }
ere-pico = { git = "https://github.com/eth-applied-research-group/ere", package = "ere-pico" }

# branch is kw/zkevm-benchmark-workload-repo
# NOTE: We are using a branch of a branch that has not yet been merged into master.
Expand Down
1 change: 1 addition & 0 deletions crates/ere-hosts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ license.workspace = true
benchmark-runner.workspace = true
ere-sp1.workspace = true
ere-risczero.workspace = true
# ere-pico.workspace = true
zkvm-interface.workspace = true

[lints]
Expand Down
16 changes: 16 additions & 0 deletions crates/ere-hosts/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

use std::path::PathBuf;

// use ere_pico::{ErePico, PICO_TARGET};

use benchmark_runner::{Action, run_benchmark_ere};
use ere_risczero::{EreRisc0, RV32_IM_RISCZERO_ZKVM_ELF};
use ere_sp1::{EreSP1, RV32_IM_SUCCINCT_ZKVM_ELF};

use zkvm_interface::{Compiler, ProverResourceType};

/// Main entry point for the host benchmarker
Expand All @@ -19,6 +22,12 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let action = Action::Execute;
run_benchmark_ere("risc0", risc0_zkvm, action)?;

// TODO: Symbol conflict with Risc0, See #42
// let resource = ProverResourceType::Cpu;
// let pico_zkvm = new_pico_zkvm(resource)?;
// let action = Action::Execute;
// run_benchmark_ere("pico", pico_zkvm, action)?;

// TODO: Add more backends
Ok(())
}
Expand All @@ -35,3 +44,10 @@ fn new_risczero_zkvm(
let program = RV32_IM_RISCZERO_ZKVM_ELF::compile(&PathBuf::from(guest_dir))?;
Ok(EreRisc0::new(program, prover_resource))
}
// fn new_pico_zkvm(
// prover_resource: ProverResourceType,
// ) -> Result<ErePico, Box<dyn std::error::Error>> {
// let guest_dir = concat!(env!("CARGO_WORKSPACE_DIR"), "ere-guests/pico");
// let program = PICO_TARGET::compile(&PathBuf::from(guest_dir))?;
// Ok(ErePico::new(program, prover_resource))
// }
17 changes: 17 additions & 0 deletions ere-guests/pico/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "pico-guest"
version = "0.1.0"
edition = "2024"

[dependencies]
pico-sdk = { git = "https://github.com/brevis-network/pico" }
reth-stateless.workspace = true
reth-ethereum-primitives = { workspace = true, features = [
"serde",
"serde-bincode-compat",
] }
reth-primitives-traits = { workspace = true, features = [
"serde",
"serde-bincode-compat",
] }
alloy-primitives.workspace = true
22 changes: 22 additions & 0 deletions ere-guests/pico/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#![no_main]

pico_sdk::entrypoint!(main);
use pico_sdk::io::read_as;

extern crate alloc;

use alloc::sync::Arc;
use reth_stateless::{fork_spec::ForkSpec, validation::stateless_validation, ClientInput};

/// Entry point.
pub fn main() {
println!("start read_input");
let input: ClientInput = read_as();
let network: ForkSpec = read_as();
let chain_spec = Arc::new(network.into());
println!("end read_input");

println!("start validation");
stateless_validation(input.block, input.witness, chain_spec).unwrap();
println!("end validation");
}
16 changes: 16 additions & 0 deletions precompile-patches/pico.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[patch.crates-io]
tiny-keccak = { git = "https://github.com/brevis-network/tiny-keccak", tag = "pico-patch-v1.0.0-keccak-v2.0.2" }

sha2 = { git = "https://github.com/brevis-network/hashes", tag = "pico-patch-v1.0.1-sha2-v0.10.8", package = "sha2" }
sha3 = { git = "https://github.com/brevis-network/hashes", tag = "pico-patch-v1.0.1-sha3-v0.10.8", package = "sha3" }

curve25519-dalek = { git = "https://github.com/brevis-network/curve25519-dalek", tag = "pico-patch-v1.0.1-curve25519-dalek-v4.1.3" }
bls12381 = { git = "https://github.com/brevis-network/bls12_381", tag = "pico-patch-v1.0.1-bls12_381-v0.8.0", package = "bls12_381" }
curve25519-dalek-ng = { git = "https://github.com/brevis-network/curve25519-dalek-ng", tag = "pico-patch-v1.0.1-curve25519-dalek-ng-v4.1.1" }
ed25519-consensus = { git = "https://github.com/brevis-network/ed25519-consensus", tag = "pico-patch-v1.0.1-ed25519-consensus-v2.1.0" }

ecdsa-core = { git = "https://github.com/brevis-network/signatures", tag = "pico-patch-v1.0.1-ecdsa-0.16.9", package = "ecdsa" }

secp256k1 = { git = "https://github.com/brevis-network/rust-secp256k1", tag = "pico-patch-v1.0.1-secp256k1-v0.29.1" }
substrate-bn = { git = "https://github.com/brevis-network/bn", tag = "pico-patch-v1.0.1-bn-v0.6.0" }
bigint = { git = "https://github.com/brevis-network/crypto-bigint", tag = "pico-patch-v1.0.0-bigint-v0.6.0", package = "crypto-bigint" }