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
79 changes: 63 additions & 16 deletions Cargo.lock

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

12 changes: 7 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
[package]
name = "scroll-proving-sdk"
version = "0.1.0"
edition = "2021"
version = "0.2.0"
edition = "2024"

[dependencies]
eyre = "0.6"
serde = { version = "1", features = ["derive"] }
serde_json = "1.0"
ethers-core = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7" }
reqwest = { version = "0.12", features = ["gzip"] }
futures = "0.3"
reqwest = { version = "0.12", features = ["gzip", "json"] }
reqwest-middleware = "0.4"
reqwest-retry = "0.7"
hex = "0.4"
tiny-keccak = { version = "2.0", features = ["sha3", "keccak"] }
rand = "0.9"
rlp = "0.6"
alloy-rlp = { version = "0.3", features = ["derive"] }
tokio = { version = "1.48", features = ["net", "sync"] }
async-trait = "0.1"
http = "1.4"
Expand All @@ -24,4 +25,5 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
axum = { version = "0.8", default-features = false, features = ["tokio", "http1"] }
dotenvy = "0.15"
rocksdb = "0.24"

strum = { version = "0.27", features = ["derive"] }
serde_repr = "0.1"
20 changes: 20 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use std::env;

const DEFAULT_COMMIT: &str = "unknown";
const DEFAULT_ZK_VERSION: &str = "000000-000000";
const DEFAULT_TAG: &str = "v0.0.0";

fn main() {
println!(
"cargo:rustc-env=GIT_REV={}",
env::var("GIT_REV").unwrap_or_else(|_| DEFAULT_COMMIT.to_string()),
);
println!(
"cargo:rustc-env=GO_TAG={}",
env::var("GO_TAG").unwrap_or_else(|_| DEFAULT_TAG.to_string()),
);
println!(
"cargo:rustc-env=ZK_VERSION={}",
env::var("ZK_VERSION").unwrap_or_else(|_| DEFAULT_ZK_VERSION.to_string()),
);
}
4 changes: 2 additions & 2 deletions examples/cloud.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#![allow(dead_code)]
use eyre::{eyre, Result};
use async_trait::async_trait;
use clap::Parser;
use eyre::{Result, eyre};
use reqwest::Url;
use std::fs::File;

use scroll_proving_sdk::{
config::Config as SdkConfig,
prover::{
ProverBuilder, ProvingService,
proving_service::{
GetVkRequest, GetVkResponse, ProveRequest, ProveResponse, QueryTaskRequest,
QueryTaskResponse,
},
ProverBuilder, ProvingService,
},
utils::init_tracing,
};
Expand Down
4 changes: 2 additions & 2 deletions examples/local.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use eyre::{eyre, Result};
use async_trait::async_trait;
use clap::Parser;
use eyre::{Result, eyre};
use scroll_proving_sdk::{
config::Config as SdkConfig,
prover::{
ProverBuilder, ProvingService,
proving_service::{
GetVkRequest, GetVkResponse, ProveRequest, ProveResponse, QueryTaskRequest,
QueryTaskResponse,
},
ProverBuilder, ProvingService,
},
utils::init_tracing,
};
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "nightly-2025-02-14"
channel = "nightly-2025-08-18"
21 changes: 11 additions & 10 deletions src/config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{coordinator_handler::ProverType, prover::ProofType};
use eyre::{eyre, Result};
use dotenvy::dotenv;
use eyre::{Result, eyre};
use serde::{Deserialize, Serialize};
use serde_json;
use std::fs::File;
Expand All @@ -22,6 +22,8 @@ pub struct CoordinatorConfig {
pub retry_count: u32,
pub retry_wait_time_sec: u64,
pub connection_timeout_sec: u64,
#[serde(default)]
pub suppress_empty_task_error: bool,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
Expand All @@ -37,8 +39,6 @@ pub struct ProverConfig {
/// specified time value. Defaults to 0, indicating that no randomized delay shall be applied.
#[serde(default)]
pub randomized_delay_sec: u64,
#[serde(default)]
pub suppress_empty_task_error: bool,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct DbConfig {}
Expand Down Expand Up @@ -106,11 +106,12 @@ impl Config {

self.prover.supported_proof_types = values_vec
.iter()
.map(|value| match value.parse::<u8>() {
Ok(num) => ProofType::from_u8(num),
Err(e) => {
panic!("Failed to parse circuit type: {}", e);
}
.map(|value| {
value
.parse::<u8>()
.ok()
.and_then(ProofType::from_repr)
.expect("failed to parse circuit type")
})
.collect::<Vec<ProofType>>();
}
Expand All @@ -120,7 +121,7 @@ impl Config {
}

if let Some(val) = Self::get_env_var("DB_PATH")? {
self.db_path = Option::from(val);
self.db_path = Some(val);
}

if let Some(val) = Self::get_env_var("POLL_INTERVAL_SEC")? {
Expand All @@ -131,7 +132,7 @@ impl Config {
}

if Self::get_env_var("SUPPRESS_EMPTY_TASK_ERR")?.is_some() {
self.prover.suppress_empty_task_error = true;
self.coordinator.suppress_empty_task_error = true;
}

Ok(())
Expand Down
Loading