Skip to content
Closed
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
db8554a
chore: cont opt - dump slice to file and load
dajuguan Dec 8, 2023
2af9e83
chore: cont-opt[2] enable dumping witness table periodically
dajuguan Dec 13, 2023
c45f18e
chore: cont-op[3] add file type for private inputs
dajuguan Dec 14, 2023
cbd3cab
chore: cont_opt[4] caching lookup for wasmi, flexbuffer & pooling for…
dajuguan Dec 18, 2023
a60c749
chore: cont-op -- replace callback with trait for dumping slice witne…
dajuguan Dec 18, 2023
c77cd1d
update comment
junyu0312 Dec 11, 2023
d46090b
fix: use F instead of AssignedCell to avoid unwrap
junyu0312 Dec 11, 2023
bd1c40d
fix: fix termination state and imtable
junyu0312 Dec 11, 2023
c095762
fix etable assignment
junyu0312 Dec 12, 2023
f99839a
fix: fix constraints of etable
junyu0312 Dec 12, 2023
a6053b2
refine image table
junyu0312 Dec 12, 2023
dd9b812
refine image table
junyu0312 Dec 12, 2023
5205f31
fix hardcode
junyu0312 Dec 13, 2023
ae734ed
add transpose for InitializationState
junyu0312 Dec 13, 2023
3168fb0
chore: refine image table assignment
junyu0312 Dec 13, 2023
66b16d7
fmt code
junyu0312 Dec 13, 2023
5970057
set the number of frame table entry always 2
junyu0312 Dec 14, 2023
945c29d
fix code style
junyu0312 Dec 14, 2023
664ab04
fix comment
junyu0312 Dec 14, 2023
4f8abe6
add name for post image table col
junyu0312 Dec 14, 2023
cbc68c5
fix image table assigner
junyu0312 Dec 14, 2023
37beae0
fix circuit_without_witness
junyu0312 Dec 15, 2023
829a66b
fix rlp_slice test
junyu0312 Dec 15, 2023
57adf94
fix compiling error
junyu0312 Dec 15, 2023
0748504
fix code style
junyu0312 Dec 18, 2023
231db4b
fix: fix a bug of post image table
junyu0312 Dec 18, 2023
aaedece
refine etable assignment
junyu0312 Dec 21, 2023
31c8ed3
decrease the degree of post init memory lookup
junyu0312 Dec 22, 2023
a22fffb
chore: cont opt - dump slice to file and load
dajuguan Dec 8, 2023
fdafec0
chore: cont-opt[2] enable dumping witness table periodically
dajuguan Dec 13, 2023
5434ced
chore: cont_opt[4] caching lookup for wasmi, flexbuffer & pooling for…
dajuguan Dec 18, 2023
6addb1c
chore: cont-op -- replace callback with trait for dumping slice witne…
dajuguan Dec 18, 2023
6fbdd47
rebase cont_dev
dajuguan Jan 9, 2024
b0cacad
feat: add proof-from-trace cli
dajuguan Jan 10, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/target
*.json
*.buf
output/
crates/playground/wasm
crates/playground/target
137 changes: 123 additions & 14 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ rayon = "1.8.0"
wasmi = { path = "third-party/wasmi" }

[profile.dev]
opt-level = 3
opt-level = 3
61 changes: 59 additions & 2 deletions crates/cli/src/app_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ use std::sync::Arc;
use std::sync::Mutex;

use crate::exec::exec_dry_run;
#[cfg(feature = "continuation")]
use crate::exec::exec_witness_dump;

use super::command::CommandBuilder;
use super::exec::exec_aggregate_create_proof;
use super::exec::exec_create_proof;
use super::exec::exec_create_proof_from_trace;
use super::exec::exec_dry_run_service;
use super::exec::exec_image_checksum;
use super::exec::exec_setup;
Expand Down Expand Up @@ -72,11 +75,14 @@ pub trait AppBuilder: CommandBuilder {
let app = Self::append_setup_subcommand(app);
let app = Self::append_dry_run_subcommand(app);
let app = Self::append_create_single_proof_subcommand(app);
let app = Self::append_create_proof_from_trace_subcommand(app);
let app = Self::append_verify_single_proof_subcommand(app);
let app = Self::append_create_aggregate_proof_subcommand(app);
let app = Self::append_verify_aggregate_verify_subcommand(app);
let app = Self::append_generate_solidity_verifier(app);
let app = Self::append_image_checksum_subcommand(app);
#[cfg(feature = "continuation")]
let app = Self::append_witness_dump_subcommand(app);

app
}
Expand Down Expand Up @@ -129,13 +135,11 @@ pub trait AppBuilder: CommandBuilder {
if !context_in.is_empty() || context_out_path.is_some() {
warn!("All context paths are ignored when dry-run is running in service mode.");
}

exec_dry_run_service(zkwasm_k, wasm_binary, phantom_functions, &listen)
} else {
assert!(public_inputs.len() <= Self::MAX_PUBLIC_INPUT_SIZE);

let context_output = Arc::new(Mutex::new(vec![]));

exec_dry_run(
zkwasm_k,
wasm_binary,
Expand All @@ -151,6 +155,37 @@ pub trait AppBuilder: CommandBuilder {
Ok(())
}
}

#[cfg(feature = "continuation")]
Some(("witness-dump", sub_matches)) => {
let public_inputs: Vec<u64> = Self::parse_single_public_arg(&sub_matches);
let private_inputs: Vec<u64> = Self::parse_single_private_arg(&sub_matches);
let context_in: Vec<u64> = Self::parse_context_in_arg(&sub_matches);
let context_out_path: Option<PathBuf> =
Self::parse_context_out_path_arg(&sub_matches);
let context_output = Arc::new(Mutex::new(vec![]));

let context_out = Arc::new(Mutex::new(vec![]));

assert!(public_inputs.len() <= Self::MAX_PUBLIC_INPUT_SIZE);

exec_witness_dump(
Self::NAME,
zkwasm_k,
wasm_binary,
phantom_functions,
&output_dir,
public_inputs,
private_inputs,
context_in,
context_output.clone(),
)?;

write_context_output(&context_out.lock().unwrap(), context_out_path)?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace context_out with context_output and remove context_out variable?


Ok(())
}

Some(("single-prove", sub_matches)) => {
let public_inputs: Vec<u64> = Self::parse_single_public_arg(&sub_matches);
let private_inputs: Vec<u64> = Self::parse_single_private_arg(&sub_matches);
Expand Down Expand Up @@ -178,6 +213,28 @@ pub trait AppBuilder: CommandBuilder {

Ok(())
}
Some(("proof-from-trace", sub_matches)) => {
let tables_dir = Self::parse_tables_path_arg(&sub_matches);
let param_dir = Self::parse_params_path_arg(&sub_matches);
let context_out_path: Option<PathBuf> =
Self::parse_context_out_path_arg(&sub_matches);

let context_out = Arc::new(Mutex::new(vec![]));

exec_create_proof_from_trace(
Self::NAME,
zkwasm_k,
wasm_binary,
phantom_functions,
&output_dir,
&tables_dir,
&param_dir,
)?;

write_context_output(&context_out.lock().unwrap(), context_out_path)?;

Ok(())
}
Some(("single-verify", sub_matches)) => {
let proof_path: PathBuf = Self::parse_proof_path_arg(&sub_matches);
let instance_path: PathBuf = Self::parse_single_instance_arg(&sub_matches);
Expand Down
Loading