diff options
| author | Kamen Mladenov <kamen@syndamia.com> | 2025-02-03 10:08:02 +0200 |
|---|---|---|
| committer | Kamen Mladenov <kamen@syndamia.com> | 2025-02-03 10:08:02 +0200 |
| commit | 3a98310bafbfa7cf20d8bfcf41510781567b1417 (patch) | |
| tree | ef766d244869020d5bb9bfd61be438d36e28534f | |
| parent | 6945c597d9f39e8d603e8cdac17705c8b167e2ba (diff) | |
| download | zkVMs-benchmarks-3a98310bafbfa7cf20d8bfcf41510781567b1417.tar zkVMs-benchmarks-3a98310bafbfa7cf20d8bfcf41510781567b1417.tar.gz zkVMs-benchmarks-3a98310bafbfa7cf20d8bfcf41510781567b1417.zip | |
feat(zkvms_host_io): Add argument for private input
| -rw-r--r-- | guests/fibonacci/default_private_input.toml | 1 | ||||
| -rw-r--r-- | guests/fibonacci/default_public_input.toml | 3 | ||||
| -rw-r--r-- | guests/graph_coloring/default_private_input.toml | 12 | ||||
| -rw-r--r-- | guests/graph_coloring/default_public_input.toml | 13 | ||||
| -rw-r--r-- | zkvms_host_io/src/lib.rs | 12 |
5 files changed, 24 insertions, 17 deletions
diff --git a/guests/fibonacci/default_private_input.toml b/guests/fibonacci/default_private_input.toml new file mode 100644 index 0000000..f0375d7 --- /dev/null +++ b/guests/fibonacci/default_private_input.toml @@ -0,0 +1 @@ +fN = 259695496911122585 diff --git a/guests/fibonacci/default_public_input.toml b/guests/fibonacci/default_public_input.toml index 74b33bc..c1f77d0 100644 --- a/guests/fibonacci/default_public_input.toml +++ b/guests/fibonacci/default_public_input.toml @@ -1,2 +1 @@ -n = 85 -fN = 259695496911122585 +n = 85 diff --git a/guests/graph_coloring/default_private_input.toml b/guests/graph_coloring/default_private_input.toml new file mode 100644 index 0000000..c593326 --- /dev/null +++ b/guests/graph_coloring/default_private_input.toml @@ -0,0 +1,12 @@ +coloring = [ + [0, 2], + [1, 1], + [2, 1], + [3, 0], + [4, 1], + [5, 2], + [6, 0], + [7, 0], + [8, 1], + [9, 2] +] diff --git a/guests/graph_coloring/default_public_input.toml b/guests/graph_coloring/default_public_input.toml index b240a3a..c09ebb0 100644 --- a/guests/graph_coloring/default_public_input.toml +++ b/guests/graph_coloring/default_public_input.toml @@ -12,16 +12,3 @@ graph = [ ] colors = 3 - -coloring = [ - [0, 2], - [1, 1], - [2, 1], - [3, 0], - [4, 1], - [5, 2], - [6, 0], - [7, 0], - [8, 1], - [9, 2] -] diff --git a/zkvms_host_io/src/lib.rs b/zkvms_host_io/src/lib.rs index d00a1b1..8e49e29 100644 --- a/zkvms_host_io/src/lib.rs +++ b/zkvms_host_io/src/lib.rs @@ -6,6 +6,7 @@ use std::{env, option::Option, fs::read_to_string, collections::HashMap}; pub use input_macros::foreach_input_field; static DEFAULT_PUBLIC_INPUT: &str = include_str!(concat!(env!("INPUTS_DIR"), "/default_public_input.toml")); +static DEFAULT_PRIVATE_INPUT: &str = include_str!(concat!(env!("INPUTS_DIR"), "/default_private_input.toml")); static DEFAULT_ENV: &str = include_str!(concat!(env!("INPUTS_DIR"), "/default.env")); #[derive(Parser, Debug)] @@ -14,6 +15,8 @@ struct Cli { /// What the ZKVM is going to do run_type: RunType, + private_input: Option<String>, + public_input: Option<String>, } @@ -53,12 +56,17 @@ input_macros::generate_output_type_input_struct!(); pub fn read_args() -> RunWith<Input> { let cli = Cli::parse(); - let contents: String = if cli.public_input.is_some() { + let public_contents: String = if cli.public_input.is_some() { read_to_string(cli.public_input.unwrap()).unwrap() } else { DEFAULT_PUBLIC_INPUT.to_string() }; - let input: Input = toml::from_str(&contents).unwrap(); + let private_contents: String = if cli.private_input.is_some() { + read_to_string(cli.private_input.unwrap()).unwrap() + } else { + DEFAULT_PRIVATE_INPUT.to_string() + }; + let input: Input = toml::from_str(&(public_contents + &private_contents)).unwrap(); let default_env = read_str(DEFAULT_ENV).unwrap(); |
