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
2,178 changes: 455 additions & 1,723 deletions Cargo.lock

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ primitives = { path = "./crates/primitives" }
provider = { path = "./crates/provider" }

# Ziren
zkm-build = { git = "https://github.com/ProjectZKM/Ziren", tag = "v1.2.7" }
zkm-core-executor = { git = "https://github.com/ProjectZKM/Ziren", tag = "v1.2.7" }
zkm-prover = { git = "https://github.com/ProjectZKM/Ziren", tag = "v1.2.7" }
zkm-sdk = { git = "https://github.com/ProjectZKM/Ziren", tag = "v1.2.7" }
zkm-build = { git = "https://github.com/ProjectZKM/Ziren" }
zkm-core-executor = { git = "https://github.com/ProjectZKM/Ziren" }
zkm-prover = { git = "https://github.com/ProjectZKM/Ziren" }
zkm-sdk = { git = "https://github.com/ProjectZKM/Ziren" }

# zkm-build = { path = "../Ziren/crates/build" }
# zkm-core-executor = { path = "../Ziren/crates/core/executor" }
Expand Down Expand Up @@ -188,7 +188,7 @@ op-alloy-rpc-types = { git = "https://github.com/ziren-patches/op-alloy", branch
# op-alloy-network = { path = "../patch/op-alloy/crates/network" }
# op-alloy-rpc-types = { path = "../patch/op-alloy/crates/rpc-types" }

kzg-rs = { git = "https://github.com/ziren-patches/kzg-rs", tag = "patch-0.2.7-ziren-1.2.7" }
kzg-rs = { git = "https://github.com/ziren-patches/kzg-rs", branch = "patch-0.2.7", default-features = false }

[workspace.lints]
rust.missing_debug_implementations = "warn"
Expand All @@ -200,7 +200,7 @@ rustdoc.all = "warn"
[patch.crates-io]
# Precompile patches
sha2 = { git = "https://github.com/ziren-patches/RustCrypto-hashes", branch = "patch-sha2-0.10.9", package = "sha2" }
bn = { git = "https://github.com/ziren-patches/bn", tag = "patch-0.6.0-ziren-1.2.7", package = "substrate-bn" }
k256 = { git = "https://github.com/ziren-patches/elliptic-curves", tag = "patch-k256-0.13.4-ziren-1.2.7" }
p256 = { git = "https://github.com/ziren-patches/elliptic-curves", tag = "patch-p256-0.13.2-ziren-1.2.7" }
alloy-primitives-v1-4-1 = { git = "https://github.com/ziren-patches/core.git", package = "alloy-primitives", tag = "patch-alloy-primitives-1.4.1-ziren-1.2.7" }
bn = { git = "https://github.com/ziren-patches/bn", branch = "patch-0.6.0", package = "substrate-bn" }
k256 = { git = "https://github.com/ziren-patches/elliptic-curves", branch = "patch-k256-0.13.4" }
p256 = { git = "https://github.com/ziren-patches/elliptic-curves", branch = "patch-p256-0.13.2" }
alloy-primitives-v1-4-1 = { git = "https://github.com/ziren-patches/core.git", package = "alloy-primitives", branch = "patch-alloy-primitives-1.4.1" }
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A minimal implementation of generating zero-knowledge proofs of EVM block execut
Required

- [Rust](https://www.rust-lang.org/tools/install)
- [Ziren toolchain](https://docs.zkm.io/introduction/installation.html)
- [Ziren toolchain](https://docs.zkm.io/introduction/installation.html): the guest program is always compiled with the `zkm` rustup toolchain, whichever toolchain builds the host; set `ZKM_GUEST_TOOLCHAIN` if it is installed under another name.
- Register on [Alchemy](https://www.alchemy.com/) or [Chainstack](https://chainstack.com/)​​ to get ​​`rpc url`​ and `ws url`​. But [Chainstack](https://chainstack.com/) does not support archival/historical `eth_getProof` calls.

### RPC Node Requirement
Expand Down
16 changes: 16 additions & 0 deletions bin/eth-proofs/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
use std::env;

use zkm_build::build_program;

/// The guest is compiled by a nested `cargo` that inherits this script's environment, into
/// which cargo exports the compiler building the host (`RUSTC`, a toolchain without the zkVM
/// target) and rustup exports that toolchain's name. Both are replaced by the Ziren toolchain
/// here; `ZKM_GUEST_TOOLCHAIN` names one installed under a different name.
/// `RUSTC_WORKSPACE_WRAPPER` is kept: zkm-build reads it to skip the guest build under clippy.
fn select_guest_toolchain() {
println!("cargo:rerun-if-env-changed=ZKM_GUEST_TOOLCHAIN");
let toolchain = env::var("ZKM_GUEST_TOOLCHAIN").unwrap_or_else(|_| "zkm".to_string());
env::set_var("RUSTUP_TOOLCHAIN", toolchain);
env::remove_var("RUSTC");
env::remove_var("RUSTC_WRAPPER");
}

fn main() {
select_guest_toolchain();
build_program("../guest");
}
Loading
Loading