Skip to content

Commit 4d39cda

Browse files
rakanalhjfldde
andauthored
Introduce prove with fakes (#99)
* Introduce prove with fakes * Use kebab case * Rename * Remove custom deserialization * Bump toolchain * Derive Deserialize * Clippy --------- Co-authored-by: jfldde <168934971+jfldde@users.noreply.github.com>
1 parent bfc2086 commit 4d39cda

File tree

5 files changed

+10
-25
lines changed

5 files changed

+10
-25
lines changed

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[toolchain]
2-
channel = "1.81"
2+
channel = "1.85"
33
components = ["rustfmt", "rust-src", "clippy"]
44
profile = "minimal"

src/citrea_config/batch_prover.rs

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,17 @@
11
use serde::{Deserialize, Serialize};
22

33
/// The possible configurations of the prover.
4-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)]
5-
#[serde(rename_all = "lowercase")]
4+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
5+
#[serde(rename_all = "kebab-case")]
66
pub enum ProverGuestRunConfig {
77
/// Skip proving.
88
Skip,
9-
/// Run the rollup verification logic inside the current process.
10-
Simulate,
119
/// Run the rollup verifier in a zkVM executor.
1210
Execute,
1311
/// Run the rollup verifier and create a SNARK of execution.
1412
Prove,
15-
}
16-
17-
impl<'de> Deserialize<'de> for ProverGuestRunConfig {
18-
fn deserialize<D>(deserializer: D) -> Result<ProverGuestRunConfig, D::Error>
19-
where
20-
D: serde::Deserializer<'de>,
21-
{
22-
let s = String::deserialize(deserializer)?;
23-
match s.as_str() {
24-
"skip" => Ok(ProverGuestRunConfig::Skip),
25-
"simulate" => Ok(ProverGuestRunConfig::Simulate),
26-
"execute" => Ok(ProverGuestRunConfig::Execute),
27-
"prove" => Ok(ProverGuestRunConfig::Prove),
28-
_ => Err(serde::de::Error::custom("invalid prover guest run config")),
29-
}
30-
}
13+
/// Run the rollup verifier and create a SNARK or a fake proof of execution.
14+
ProveWithFakes,
3115
}
3216

3317
/// Prover configuration

src/citrea_config/rollup.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ impl Default for RollupConfig {
149149
storage: StorageConfig {
150150
path: TempDir::new()
151151
.expect("Failed to create temporary directory")
152-
.into_path(),
152+
.keep(),
153153
db_max_open_files: None,
154154
},
155155
runner: None,
@@ -161,9 +161,10 @@ impl Default for RollupConfig {
161161
da_private_key: None,
162162
tx_backup_dir: TempDir::new()
163163
.expect("Failed to create temporary directory")
164-
.into_path()
164+
.keep()
165165
.display()
166166
.to_string(),
167+
167168
monitoring: Some(MonitoringConfig::default()),
168169
},
169170
public_keys: RollupPublicKeys {

src/config/bitcoin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl Default for BitcoinConfig {
2929
rpc_password: "password".to_string(),
3030
data_dir: TempDir::new()
3131
.expect("Failed to create temporary directory")
32-
.into_path(),
32+
.keep(),
3333
extra_args: Vec::new(),
3434
network: Network::Regtest,
3535
docker_image: None,

src/config/test_case.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl Default for TestCaseConfig {
8181
|_| {
8282
TempDir::new()
8383
.expect("Failed to create temporary directory")
84-
.into_path()
84+
.keep()
8585
},
8686
PathBuf::from,
8787
)

0 commit comments

Comments
 (0)