Skip to content

Commit

Permalink
Add Pk path
Browse files Browse the repository at this point in the history
  • Loading branch information
ec2 committed Oct 31, 2023
1 parent 070fb98 commit dbc64d6
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions prover/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,35 +81,30 @@ pub(crate) async fn gen_evm_proof_rotation_circuit_handler(

// TODO: use config/build paths from CLI flags
let app_config_path = PathBuf::from("../lightclient-circuits/config/committee_update.json");
let app_pk_path = PathBuf::from("./build/committee_update_circuit.pkey");

let agg_l2_pk_path = PathBuf::from("./build/step_agg_l2.pkey");
let agg_l1_pk_path = PathBuf::from("./build/step_agg_l1.pkey");

let agg_l2_config_path =
PathBuf::from("../lightclient-circuits/config/committee_update_aggregation_2.json");
let agg_l1_config_path =
PathBuf::from("../lightclient-circuits/config/committee_update_aggregation_1.json");
let _build_dir = PathBuf::from("./build");

let (l0_snark, _pk_filename) = match spec {
let l0_snark = match spec {
Spec::Minimal => {
let witness = fetch_rotation_args(beacon_api).await?;
(
gen_app_snark::<eth_types::Minimal>(app_config_path, app_pk_path, witness)?,
"agg_rotation_circuit_minimal.pkey",
)
let app_pk_path = PathBuf::from("./build/committee_update_circuit_minimal.pkey");
gen_app_snark::<eth_types::Minimal>(app_config_path, app_pk_path, witness)?
}
Spec::Testnet => {
let witness = fetch_rotation_args(beacon_api).await?;
(
gen_app_snark::<eth_types::Testnet>(app_config_path, app_pk_path, witness)?,
"agg_rotation_circuit_testnet.pkey",
)
let app_pk_path = PathBuf::from("./build/committee_update_circuit_testnet.pkey");
gen_app_snark::<eth_types::Testnet>(app_config_path, app_pk_path, witness)?
}
Spec::Mainnet => {
let witness = fetch_rotation_args(beacon_api).await?;
(
gen_app_snark::<eth_types::Mainnet>(app_config_path, app_pk_path, witness)?,
"agg_rotation_circuit_mainnet.pkey",
)
let app_pk_path = PathBuf::from("./build/committee_update_circuit_mainnet.pkey");
gen_app_snark::<eth_types::Mainnet>(app_config_path, app_pk_path, witness)?
}
};

Expand All @@ -121,7 +116,7 @@ pub(crate) async fn gen_evm_proof_rotation_circuit_handler(

println!("L1 Keygen num_instances: {:?}", circuit.num_instance());

let pk_l1 = gen_pk(&p1, &circuit, None);
let pk_l1 = gen_pk(&p1, &circuit, Some(&agg_l1_pk_path));
let pinning = AggregationConfigPinning::from_path(agg_l1_config_path);
let lookup_bits = k as usize - 1;
let mut circuit = AggregationCircuit::new::<SHPLONK>(
Expand All @@ -147,7 +142,7 @@ pub(crate) async fn gen_evm_proof_rotation_circuit_handler(
AggregationCircuit::keygen::<SHPLONK>(&p2, std::iter::once(l1_snark.clone()));
circuit.expose_previous_instances(true);

let pk_l2 = gen_pk(&p2, &circuit, None);
let pk_l2 = gen_pk(&p2, &circuit, Some(&agg_l2_pk_path));
let pinning = AggregationConfigPinning::from_path(agg_l2_config_path);

let mut circuit = AggregationCircuit::prover::<SHPLONK>(
Expand Down

0 comments on commit dbc64d6

Please sign in to comment.