Skip to content

Commit a8c0f39

Browse files
authored
Merge branch 'main' into haoyu/sindri_tokio
2 parents 93b045c + a623cd6 commit a8c0f39

File tree

9 files changed

+37
-7
lines changed

9 files changed

+37
-7
lines changed

.DS_Store

6 KB
Binary file not shown.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ target/
2020
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
2121
#.idea/
2222

23-
config.json
2423
keys/
2524
db/
2625

charts/scroll-proving-sdk/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: v2
33
description: Example chart for showing how to package a service built using the scroll-proving-sdk library
44
name: scroll-proving-sdk
5-
version: 0.0.6
5+
version: 0.0.7
66
kubeVersion: ">=1.22.0-0"
77
maintainers:
88
- name: scroll-tech

charts/scroll-proving-sdk/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# scroll-proving-sdk
22

3-
![Version: 0.0.6](https://img.shields.io/badge/Version-0.0.6-informational?style=flat-square)
3+
![Version: 0.0.7](https://img.shields.io/badge/Version-0.0.7-informational?style=flat-square)
44

55
Example chart for showing how to package a service built using the scroll-proving-sdk library
66

charts/scroll-proving-sdk/values.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,6 @@ scrollConfig: |
8484
# "retry_wait_time_sec": 5,
8585
# "connection_timeout_sec": 60
8686
# }
87-
# }
87+
# },
88+
# "db_path": "db"
8889
# }

conf/config.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"prover_name_prefix": "cloud_prover_",
3+
"keys_dir": "keys",
4+
"coordinator": {
5+
"base_url": "https://coordinator-api.scrollsdk",
6+
"retry_count": 3,
7+
"retry_wait_time_sec": 5,
8+
"connection_timeout_sec": 60
9+
},
10+
"l2geth": {
11+
"endpoint": "https://l2-rpc.scrollsdk"
12+
},
13+
"prover": {
14+
"circuit_type": 3,
15+
"circuit_version": "v0.13.1",
16+
"n_workers": 1,
17+
"cloud": {
18+
"base_url": "<CLOUD_PROVING_SERVICE_BASE_URL>",
19+
"api_key": "<API_KEY>",
20+
"retry_count": 3,
21+
"retry_wait_time_sec": 5,
22+
"connection_timeout_sec": 60
23+
}
24+
},
25+
"db_path": "db"
26+
}

src/.DS_Store

6 KB
Binary file not shown.

src/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::fs::File;
88
pub struct Config {
99
pub prover_name_prefix: String,
1010
pub keys_dir: String,
11-
pub db_path: String,
11+
pub db_path: Option<String>,
1212
pub coordinator: CoordinatorConfig,
1313
pub l2geth: Option<L2GethConfig>,
1414
pub prover: ProverConfig,
@@ -125,7 +125,7 @@ impl Config {
125125
}
126126
}
127127
if let Some(val) = Self::get_env_var("DB_PATH")? {
128-
self.db_path = val;
128+
self.db_path = Option::from(val);
129129
}
130130

131131
Ok(())

src/prover/builder.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ impl ProverBuilder {
8686
None => None,
8787
};
8888

89+
let db_path = self.cfg.db_path.unwrap_or_else(|| {
90+
panic!("Missing database path");
91+
});
92+
8993
Ok(Prover {
9094
circuit_type: self.cfg.prover.circuit_type,
9195
circuit_version: self.cfg.prover.circuit_version,
@@ -94,7 +98,7 @@ impl ProverBuilder {
9498
proving_service: self.proving_service.unwrap(),
9599
n_workers: self.cfg.prover.n_workers,
96100
health_listener_addr: self.cfg.health_listener_addr,
97-
db: Db::new(&self.cfg.db_path)?,
101+
db: Db::new(&db_path)?,
98102
})
99103
}
100104
}

0 commit comments

Comments
 (0)