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
58 changes: 27 additions & 31 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 @@ -50,6 +50,7 @@ provider = { path = "./crates/provider" }
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-cuda = { git = "https://github.com/ProjectZKM/Ziren" }
zkm-sdk = { git = "https://github.com/ProjectZKM/Ziren" }

# reth
Expand Down
12 changes: 11 additions & 1 deletion bin/eth-proofs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name = "eth-proofs"
edition = "2021"

[dependencies]
tokio.workspace = true
tokio = { workspace = true, features = ["signal"] }
url.workspace = true
tracing.workspace = true
serde_json.workspace = true
Expand All @@ -13,6 +13,11 @@ tracing-subscriber = "0.3.18"
dotenv = "0.15.0"
clap = { version = "4.5.7", features = ["derive", "env"] }
eyre = "0.6.12"
bincode = "1.3.3"
sha2 = "0.10.8"
hex = "0.4.3"
fs2 = "0.4.3"
libc = "0.2"
reqwest = { workspace = true, features = ["json"] }
reqwest-middleware = { version = "0.3.3", features = ["json"] }
reqwest-retry = "0.6.1"
Expand All @@ -28,6 +33,8 @@ provider.workspace = true

# Ziren
zkm-sdk.workspace = true
zkm-cuda.workspace = true
zkm-prover.workspace = true

# alloy
alloy-chains.workspace = true
Expand All @@ -41,3 +48,6 @@ zkm-build.workspace = true

[features]
test = []

[dev-dependencies]
tempfile = "3"
11 changes: 9 additions & 2 deletions bin/eth-proofs/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
use zkm_build::build_program;
use zkm_build::{build_program_with_args, BuildArgs};

fn main() {
build_program("../guest");
println!("cargo:rerun-if-env-changed=ETH_PROOFS_BUILD_ELF");
if let Ok(path) = std::env::var("ETH_PROOFS_BUILD_ELF") {
let path = std::fs::canonicalize(path).expect("ETH_PROOFS_BUILD_ELF must exist");
println!("cargo:rerun-if-changed={}", path.display());
println!("cargo:rustc-env=ZKM_ELF_reth={}", path.display());
} else {
build_program_with_args("../guest", BuildArgs { locked: true, ..Default::default() });
}
}
48 changes: 47 additions & 1 deletion bin/eth-proofs/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub struct Args {

/// The WS rpc url used to fetch data about the block.
#[clap(long, env)]
pub ws_rpc_url: Url,
pub ws_rpc_url: Option<Url>,

/// The debug HTTP rpc url used to fetch data about the block trace.
#[clap(long, env)]
Expand All @@ -28,6 +28,24 @@ pub struct Args {
#[clap(long, default_value_t = 100)]
pub block_interval: u64,

/// Which residue class of `block_interval` this instance proves: blocks
/// with `number % block_interval == block_residue`. Two instances with
/// `--block-interval 2` and residues 0 and 1 split the chain between two
/// provers and prove two blocks at a time.
#[clap(long, default_value_t = 0)]
pub block_residue: u64,

/// How many prepared blocks (fetched + natively executed) may wait for the
/// prover. The fetch of block N+1 always overlaps the proof of block N;
/// this bounds how far ahead the fetcher runs.
#[clap(long, default_value_t = 1)]
pub prefetch_depth: usize,

/// Skip a block when it is more than this many blocks behind the newest
/// header seen (0 = never skip: prove every block the stream delivers).
#[clap(long, default_value_t = 0)]
pub max_lag: u64,

/// ETH proofs endpoint.
#[clap(long, env)]
pub eth_proofs_endpoint: String,
Expand All @@ -44,6 +62,34 @@ pub struct Args {
#[clap(long, env)]
pub pager_duty_integration_key: Option<String>,

/// Direct local GPU server, set by Fleet for an integrated app worker.
#[clap(long, env = "FLEET_GPU_ENDPOINT")]
pub local_gpu_endpoint: Option<Url>,

/// Persistent local worker state. Required with --local-gpu-endpoint.
#[clap(long, env = "FLEET_APP_STORAGE_ROOT", requires = "local_gpu_endpoint")]
pub state_dir: Option<std::path::PathBuf>,

/// Use an existing production guest instead of the embedded ELF.
#[clap(long, env = "ETH_PROOFS_ELF_FILE")]
pub elf_file: Option<std::path::PathBuf>,

/// Reject a guest whose digest differs from this app's configured program.
#[clap(long, env = "FLEET_APP_ELF_ID")]
pub expected_elf_id: Option<String>,

/// First block for a new durable stream; restarts resume persisted progress.
#[clap(long)]
pub start_block: Option<u64>,

/// Witness preparation concurrency (currently 1; GPU proving remains serial).
#[clap(long, default_value_t = 1)]
pub prepare_concurrency: usize,

/// Pause proving when this many completed reports await acknowledgment.
#[clap(long, default_value_t = 128)]
pub max_pending_reports: usize,

/// Moongate server endpoint.
#[clap(long, env)]
pub moongate_endpoint: Option<String>,
Expand Down
Loading