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

WIP ZKWAS-221 #243

Open
wants to merge 6 commits into
base: explorer-integration
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
78 changes: 60 additions & 18 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 @@ -5,7 +5,7 @@ exclude = ["third-party/wasmi", "crates/playground"]
[workspace.dependencies]
anyhow = { version = "1.0.68", features = ["backtrace"] }
cfg-if = "1.0.0"
halo2aggregator-s = { git = "https://github.com/DelphinusLab/halo2aggregator-s.git", branch = "main", features = ["unsafe"] }
halo2aggregator-s = { git = "https://github.com/DelphinusLab/halo2aggregator-s.git", branch="explorer-integration", features = ["unsafe"] }
halo2_proofs = { git = "https://github.com/DelphinusLab/halo2-gpu-specific.git", default-features = true }
parity-wasm = { version = "0.42.0", features = ["sign_ext"] }
wasmi = { path = "third-party/wasmi" }
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ anyhow.workspace = true
halo2aggregator-s.workspace = true
halo2_proofs.workspace = true
wasmi.workspace = true
circuits-batcher = { git = "https://github.com/DelphinusLab/continuation-batcher.git" }
circuits-batcher = { git = "https://github.com/DelphinusLab/continuation-batcher.git", branch="polish-structure" }

[features]
default = []
Expand Down
39 changes: 22 additions & 17 deletions crates/cli/src/exec.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use anyhow::Result;
use circuits_batcher::proof::CircuitInfo;

use circuits_batcher::proof::ParamsCache;
use circuits_batcher::proof::ProofInfo;
use circuits_batcher::proof::ProofLoadInfo;
use circuits_batcher::proof::ProofPieceInfo;
use circuits_batcher::proof::ProvingKeyCache;
use delphinus_zkwasm::circuits::ZkWasmCircuit;
use delphinus_zkwasm::loader::ZkWasmLoader;
Expand Down Expand Up @@ -156,25 +157,27 @@ pub fn exec_create_proof<Builder: HostEnvBuilder>(
info!("Mock test passed");
}

let circuit: CircuitInfo<Bn256, ZkWasmCircuit<Fr>> = CircuitInfo::new(
circuit,
prefix.to_string(),
vec![instances],
zkwasm_k as usize,
circuits_batcher::args::HashType::Poseidon,
);
let prover: ProofPieceInfo = ProofPieceInfo::new(prefix.to_string(), 0, zkwasm_k);

// let circuit: CircuitInfo<Bn256, ZkWasmCircuit<Fr>> = CircuitInfo::new(
// circuit,
// prefix.to_string(),
// vec![instances],
// zkwasm_k as usize,
// circuits_batcher::args::HashType::Poseidon,
// );

// save the proof load info for the zkwasm circuit
circuit.proofloadinfo.save(output_dir);
// // save the proof load info for the zkwasm circuit
// circuit.proofloadinfo.save(output_dir);

// Cli saves zkwasm.0.instance.data as the
// first instance file for .loadinfo
// Thus we provide arg index = 0 to generate a
// proof with the first instance file
let mut param_cache = ParamsCache::new(5);
let mut pkey_cache = ProvingKeyCache::new(5);
// // Cli saves zkwasm.0.instance.data as the
// // first instance file for .loadinfo
// // Thus we provide arg index = 0 to generate a
// // proof with the first instance file
// let mut param_cache = ParamsCache::new(5);
// let mut pkey_cache = ProvingKeyCache::new(5);

circuit.exec_create_proof(output_dir, param_dir, &mut pkey_cache, 0, &mut param_cache);
// circuit.exec_create_proof(output_dir, param_dir, &mut pkey_cache, 0, &mut param_cache);

info!("Proof has been created.");

Expand Down Expand Up @@ -213,6 +216,8 @@ pub fn exec_verify_proof(
&proof.instances,
proof.transcripts.clone(),
TranscriptHash::Poseidon,
false,
&vec![],
);
}
info!("Verifing proof passed");
Expand Down
2 changes: 1 addition & 1 deletion crates/host/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ parity-wasm.workspace = true
wasmi.workspace = true

# TODO put the host circuits into features
zkwasm-host-circuits = { git = "https://github.com/DelphinusLab/zkWasm-host-circuits.git", branch="main" }
zkwasm-host-circuits = { git = "https://github.com/DelphinusLab/zkWasm-host-circuits.git", branch="keccak-test" }

[dev-dependencies]
rusty-fork = "0.3.0"
Expand Down
Loading
Loading