Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support local prover && multiple task types #54

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7641e75
feat: support multiple task
yiweichi Jan 2, 2025
8381bab
feat: support multiple task
yiweichi Jan 2, 2025
a1dbcd9
feat: implement default for circuitType
yiweichi Jan 2, 2025
688ede5
feat: add local prover config
yiweichi Jan 4, 2025
6dd13b6
fix: clone for ProveRequest
yiweichi Jan 5, 2025
7d010b0
fix: lint
yiweichi Jan 5, 2025
f289997
remove unused config fields
yiweichi Jan 6, 2025
2dfae63
update config file
yiweichi Jan 6, 2025
4dab63a
update config file
yiweichi Jan 6, 2025
c52ccdc
Update src/config.rs
yiweichi Jan 8, 2025
c319139
fix: comments
yiweichi Jan 8, 2025
aacd757
Merge branch 'feat-integrate-proving-sdk' of https://github.com/scrol…
yiweichi Jan 8, 2025
61bbbe1
feat: add default n_workers
yiweichi Jan 8, 2025
f8f2ecd
update get prover version
yiweichi Jan 9, 2025
e29b98d
update get prover name
yiweichi Jan 9, 2025
79a1c05
remove ds_store
yiweichi Jan 10, 2025
1a1748f
add prover_provider_type
yiweichi Jan 12, 2025
ea4b1e3
rm ds_store
yiweichi Jan 14, 2025
d976336
Revert "rm ds_store"
yiweichi Jan 14, 2025
9d4dcfb
feat: local prover task resume
yiweichi Jan 14, 2025
e23bb7d
fix: login message rlp encode(#55)
yiweichi Jan 15, 2025
f4f8d14
fix: local prover task cache & db refactor
yiweichi Jan 15, 2025
575423f
Apply suggestions from code review
yiweichi Jan 15, 2025
b0ab0e1
Revert "Apply suggestions from code review" && refactor: ProverProvid…
yiweichi Jan 15, 2025
6fbd996
refactor: ProverProviderType to_u8
yiweichi Jan 15, 2025
4c65b38
test: add test for coordinator signature compatibility
yiweichi Jan 16, 2025
db00a03
format
yiweichi Jan 16, 2025
4ae7687
revert local prover pre-insert task
yiweichi Jan 17, 2025
1e83846
update cargo.toml
yiweichi Jan 17, 2025
b57526e
merge example config files
yiweichi Jan 20, 2025
1e79097
fix: chunk task input serialization issue (#59)
yiweichi Jan 21, 2025
c28acd0
fix: get block trace deserialization
yiweichi Jan 21, 2025
92634c6
feat: add default for QueryTaskResponse (#60)
yiweichi Jan 21, 2025
7f8dca4
revert N_WORKERS env
yiweichi Jan 22, 2025
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
Binary file removed .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ db/
*.lock
*.tgz
.vscode/

.DS_Store
101 changes: 13 additions & 88 deletions Cargo.lock

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

12 changes: 1 addition & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,24 @@ bls12_381 = { git = "https://github.com/scroll-tech/bls12_381", branch = "feat/i
[dependencies]
anyhow = "1.0"
log = "0.4"
env_logger = "0.11.3"
serde = { version = "1.0.198", features = ["derive"] }
serde_json = "1.0.116"
futures = "0.3.30"
ethers-core = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7" }
ethers-providers = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7" }
halo2_proofs = { git = "https://github.com/scroll-tech/halo2.git", branch = "v1.1" }
snark-verifier-sdk = { git = "https://github.com/scroll-tech/snark-verifier", branch = "develop", default-features = false, features = ["loader_halo2", "loader_evm", "halo2-pse"] }
# prover_darwin = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.12.2", package = "prover", default-features = false, features = ["parallel_syn", "scroll"] }
prover_darwin_v2 = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.13.1", package = "prover", default-features = false, features = ["parallel_syn", "scroll"] }
base64 = "0.13.1"
reqwest = { version = "0.12.4", features = ["gzip"] }
reqwest-middleware = "0.3"
reqwest-retry = "0.5"
once_cell = "1.19.0"
hex = "0.4.3"
tiny-keccak = { version = "2.0.0", features = ["sha3", "keccak"] }
rand = "0.8.5"
eth-keystore = "0.5.0"
rlp = "0.5.2"
tokio = { version = "1.37.0", features = ["full"] }
async-trait = "0.1"
sled = "0.34.7"
http = "1.1.0"
clap = { version = "4.5", features = ["derive"] }
ctor = "0.2.8"
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
axum = "0.6.0"
dotenv = "0.15"
rocksdb = "0.20"
rocksdb = "0.23.0"
56 changes: 34 additions & 22 deletions conf/config.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
{
"prover_name_prefix": "cloud_prover_",
"keys_dir": "keys",
"coordinator": {
"base_url": "https://coordinator-api.scrollsdk",
"retry_count": 3,
"retry_wait_time_sec": 5,
"connection_timeout_sec": 60
},
"l2geth": {
"endpoint": "https://l2-rpc.scrollsdk"
},
"prover": {
"circuit_type": 3,
"circuit_version": "v0.13.1",
"n_workers": 1,
"cloud": {
"base_url": "<CLOUD_PROVING_SERVICE_BASE_URL>",
"api_key": "<API_KEY>",
"prover_name_prefix": "prover_name",
"keys_dir": "keys",
"coordinator": {
"base_url": "https://coordinator-api.scrollsdk",
"retry_count": 3,
"retry_wait_time_sec": 5,
"connection_timeout_sec": 60
}
},
"db_path": "db"
}
},
"l2geth": {
"endpoint": "https://l2-rpc.scrollsdk"
},
"prover": {
"circuit_type": [1,2,3],
"circuit_version": "v0.13.1",
"cloud": {
"base_url": "<CLOUD_PROVING_SERVICE_BASE_URL>",
"api_key": "<API_KEY>",
"retry_count": 3,
"retry_wait_time_sec": 5,
"connection_timeout_sec": 60
},
"local": {
"low_version_circuit": {
"hard_fork_name": "bernoulli",
"params_path": "params",
"assets_path": "assets"
},
"high_version_circuit": {
"hard_fork_name": "curie",
"params_path": "params",
"assets_path": "assets"
}
}
},
"db_path": "db"
}

2 changes: 1 addition & 1 deletion examples/cloud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl ProvingService for CloudProver {
fn is_local(&self) -> bool {
false
}
async fn get_vk(&self, req: GetVkRequest) -> GetVkResponse {
async fn get_vks(&self, req: GetVkRequest) -> GetVkResponse {
todo!()
}
async fn prove(&self, req: ProveRequest) -> ProveResponse {
Expand Down
4 changes: 2 additions & 2 deletions examples/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl ProvingService for LocalProver {
fn is_local(&self) -> bool {
true
}
async fn get_vk(&self, req: GetVkRequest) -> GetVkResponse {
async fn get_vks(&self, req: GetVkRequest) -> GetVkResponse {
todo!()
}
async fn prove(&self, req: ProveRequest) -> ProveResponse {
Expand All @@ -50,7 +50,7 @@ async fn main() -> anyhow::Result<()> {
init_tracing();

let args = Args::parse();
let cfg: Config = Config::from_file(args.config_file)?;
let cfg: Config = Config::from_file_and_env(args.config_file)?;
let local_prover = LocalProver::new(cfg.prover.local.clone().unwrap());
let prover = ProverBuilder::new(cfg)
.with_proving_service(Box::new(local_prover))
Expand Down
Binary file removed src/.DS_Store
Binary file not shown.
Loading
Loading