Skip to content
Open
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
7,331 changes: 6,339 additions & 992 deletions prover/Cargo.lock

Large diffs are not rendered by default.

38 changes: 24 additions & 14 deletions prover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,29 @@ members = [
"crates/utils",
"crates/storage/rpc-db",
"crates/storage/witness-db",
"tests/*/*",
]
default-members = [
"bin/host",
"bin/client",
"bin/server",
"bin/shadow-prove",
"crates/executor/host",
"crates/executor/client",
"crates/executor/core",
"crates/primitives",
"crates/mpt",
"crates/utils",
"crates/storage/rpc-db",
"crates/storage/witness-db",
]
exclude = ["bin/challenge"]
resolver = "2"

[workspace.package]
version = "2.0.0"
edition = "2021"
rust-version = "1.91.0"
version = "2.1.0"
edition = "2024"
rust-version = "1.95.0"
authors = ["developers"]
license = "MIT OR Apache-2.0"
homepage = "https://github.com/morph-l2/morph/tree/main/prover"
Expand All @@ -38,7 +53,7 @@ flexi_logger = "0.29"
log = "0.4"
once_cell = "1.19"
thiserror = "2.0.14"
async-trait = "0.1.89"
async-trait = "0.1"

# Serialization
serde = "1.0"
Expand All @@ -48,8 +63,8 @@ serde_with = "3.9"
# Async & Networking
axum = "0.4.3"
futures = "0.3"
reqwest = "0.12"
tokio = { version = "1.21", default-features = false, features = [
reqwest = "0.13"
tokio = { version = "1.51.1", default-features = false, features = [
"rt",
"rt-multi-thread",
] }
Expand Down Expand Up @@ -125,9 +140,9 @@ morph-rpc = { git = "https://github.com/morph-l2/morph-reth.git", branch = "port


# ZK / SP1
sp1-sdk = { git = "https://github.com/succinctlabs/sp1.git", tag = "v6.2.0" }
sp1-zkvm = { git = "https://github.com/succinctlabs/sp1.git", tag = "v6.2.0" }
sp1-verifier = { git = "https://github.com/succinctlabs/sp1.git", tag = "v6.2.0" }
sp1-sdk = { git = "https://github.com/succinctlabs/sp1.git", tag = "v6.4.0" }
sp1-zkvm = { git = "https://github.com/succinctlabs/sp1.git", tag = "v6.4.0" }
sp1-verifier = { git = "https://github.com/succinctlabs/sp1.git", tag = "v6.4.0" }

# Workspace Members
morph-prove = { path = "bin/host", default-features = false }
Expand All @@ -149,8 +164,3 @@ missing-debug-implementations = "deny"
# Precompile patches
k256 = { git = "https://github.com/sp1-patches/elliptic-curves", tag = "patch-k256-13.4-sp1-6.2.0" }
p256 = { git = "https://github.com/sp1-patches/elliptic-curves", tag = "patch-p256-13.2-sp1-6.2.0" }

# Use the same local zstd implementation for transitive users (notably sp1-sdk)
# to avoid multiple libzstd C implementations with different experimental
# parameter numbers being linked into the same binary.
zstd = { git = "https://github.com/morph-l2/zstd-rs.git", branch = "zstd-dev" }
39 changes: 23 additions & 16 deletions prover/Dockerfile.sp1-base
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
FROM ubuntu:22.04
ARG GO_VERSION=1.24.0
FROM golang:${GO_VERSION}-bookworm AS go-toolchain

RUN apt-get update --fix-missing
# Install basic packages
RUN apt-get install build-essential curl wget git pkg-config -y
# Install dev-packages
RUN apt-get update && \
apt-get install -y --no-install-recommends libclang-dev libssl-dev llvm && \
rm -rf /var/lib/apt/lists/*
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update --fix-missing \
&& apt-get install --yes --no-install-recommends \
ca-certificates \
build-essential \
curl \
docker.io \
git \
libclang-dev \
libssl-dev \
llvm \
pkg-config \
wget \
protobuf-compiler \
libprotobuf-dev \
&& rm -rf /var/lib/apt/lists/*

# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
ENV CARGO_HOME=/root/.cargo
RUN rustup install nightly-2024-07-07
RUN rustup default nightly-2024-07-07
RUN rustup component add llvm-tools rustc-dev --toolchain nightly-2024-07-07
RUN rustup install 1.95.0
RUN rustup default 1.95.0
RUN rustup component add llvm-tools --toolchain 1.95.0

# Install Golang
ARG GO_VERSION=1.22
RUN wget https://raw.githubusercontent.com/anylots/golangTemp/main/go1.22.1.linux-amd64.tar.gz
RUN tar -C /usr/local -xzf go1.22.1.linux-amd64.tar.gz
RUN rm go1.22.1.linux-amd64.tar.gz
COPY --from=go-toolchain /usr/local/go /usr/local/go
ENV PATH="/usr/local/go/bin:${PATH}"

12 changes: 0 additions & 12 deletions prover/Dockerfile.sp1-test

This file was deleted.

8 changes: 4 additions & 4 deletions prover/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Generate zk proof for the l2 batch.
SP1 v6 requires the 64-bit succinct toolchain. Install with:

```sh
sp1up --version v6.2.0
sp1up --version v6.4.0
```

To build the program to risc-v bin:
Expand All @@ -24,7 +24,7 @@ cargo prove build --ignore-rust-version
or use docker(reproducible compilation):
```sh
cd bin/client
cargo prove build --docker --tag v6.2.0 --ignore-rust-version
cargo prove build --docker --tag v6.4.0 --ignore-rust-version
```

This will output the compiled ELF to the file client/elf/verifier-client.
Expand All @@ -51,9 +51,9 @@ To generate a PLONK proof that is small enough to be verified on-chain and verif

```sh
// use network prover
cargo run --release --package morph-prove --bin prove -- --block-path ./testdata/mpt/mainnet_25215.json --prove
cargo run --release --package morph-prove --bin prove -- --block-path ./testdata/block_inputs/mainnet_25215.json --prove
// use local cpu prover
cargo run --release --features local --package morph-prove --bin prove -- --block-path ./testdata/mpt/mainnet_25215.json --prove
cargo run --release --features local --package morph-prove --bin prove -- --block-path ./testdata/block_inputs/mainnet_25215.json --prove
// prove specified block range
cargo run --release --package morph-prove --bin prove -- --start-block 0x35 --end-block 0x37 --rpc http://127.0.0.1:8545 --use-rpc-db --prove
```
Expand Down
11 changes: 7 additions & 4 deletions prover/bin/challenge/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "challenge-handler"
version = "2.0.0"
edition = "2021"
rust-version = "1.75"
version = "2.1.0"
edition = "2024"
rust-version = "1.95"
authors = ["developers"]
license = "MIT OR Apache-2.0"
homepage = "https://github.com/morph-l2/morph/tree/main/prover"
Expand All @@ -11,7 +11,10 @@ repository = "https://github.com/morph-l2/morph/tree/main/prover"

[dependencies]
tokio = { version = "1", features = ["full"] }
reqwest = { version = "0.11", default-features = false, features = ["blocking", "json"] }
reqwest = { version = "0.11", default-features = false, features = [
"blocking",
"json",
] }
ethers = "2.0.6"
dotenv = "0.15.0"
env_logger = "0.9.0"
Expand Down
6 changes: 4 additions & 2 deletions prover/bin/client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[package]
name = "verifier-client"
version = "0.1.0"
edition = "2021"
version.workspace = true
edition.workspace = true
license.workspace = true
rust-version.workspace = true

[dependencies]
sp1-zkvm = { workspace = true }
Expand Down
Binary file modified prover/bin/client/elf/verifier-client
Binary file not shown.
12 changes: 9 additions & 3 deletions prover/bin/host/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[package]
version = "0.1.0"
name = "morph-prove"
edition = "2021"
version.workspace = true
edition.workspace = true
license.workspace = true
rust-version.workspace = true
default-run = "prove"

[[bin]]
Expand All @@ -26,6 +28,10 @@ once_cell = { workspace = true }
alloy = { workspace = true }
dotenv = { workspace = true }
alloy-provider = { workspace = true }
alloy-primitives = { workspace = true }
# Must match the tonic version used by sp1-sdk, otherwise `downcast_ref::<tonic::Status>()`
# silently fails (see `NetworkFailure::classify`).
tonic = { version = "0.12.3", default-features = false, optional = true }

# workspace
prover-executor-host = { workspace = true }
Expand All @@ -40,4 +46,4 @@ tokio = { workspace = true, features = ["macros"] }
[features]
default = ["network"]
local = ["sp1-sdk/native-gnark"]
network = ["sp1-sdk/network"]
network = ["sp1-sdk/network", "dep:tonic"]
3 changes: 2 additions & 1 deletion prover/bin/host/src/evm.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
//! An end-to-end example of using the SP1 SDK to generate a proof of a program that can have an
//! EVM-Compatible proof generated which can be verified on-chain.

use std::path::PathBuf;

use prover_utils::read_env_var;
use serde::{Deserialize, Serialize};
use std::path::PathBuf;

/// The ELF (executable and linkable format) file for the Succinct RISC-V zkVM.
pub const STATELESS_VERIFIER_ELF: &[u8] = include_bytes!("../../client/elf/verifier-client");
Expand Down
Loading
Loading