add gate count metrics (#238)

* add gate count metrics

* tweak params

* move metrics to its own file
This commit is contained in:
Eduard S. 2025-05-21 12:45:51 +02:00 committed by GitHub
parent de9b206852
commit c3c9e7f99c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 222 additions and 18 deletions

View file

@ -623,9 +623,12 @@ pub mod tests {
let params = middleware::Params {
// Currently the circuit uses random access that only supports vectors of length 64.
// With max_input_main_pods=3 we need random access to a vector of length 73.
max_input_main_pods: 1,
max_input_main_pods: 0,
max_custom_predicate_batches: 0,
max_custom_predicate_verifications: 0,
..Default::default()
};
println!("{:#?}", params);
let (gov_id_builder, pay_stub_builder, sanction_list_builder) =
zu_kyc_sign_pod_builders(&params);
@ -640,6 +643,7 @@ pub mod tests {
let mut prover = Prover {};
let kyc_pod = kyc_builder.prove(&mut prover, &params)?;
crate::measure_gates_print!();
let pod = (kyc_pod.pod as Box<dyn Any>).downcast::<MainPod>().unwrap();
Ok(pod.verify()?)
@ -741,6 +745,7 @@ pub mod tests {
max_custom_predicate_verifications: 8,
..Default::default()
};
println!("{:#?}", params);
let mut alice = Signer(SecretKey(RawValue::from(1)));
let bob = Signer(SecretKey(RawValue::from(2)));
@ -768,6 +773,7 @@ pub mod tests {
let mut prover = Prover {};
let alice_bob_ethdos = alice_bob_ethdos_builder.prove(&mut prover, &params)?;
crate::measure_gates_print!();
let pod = (alice_bob_ethdos.pod as Box<dyn Any>)
.downcast::<MainPod>()
.unwrap();
@ -790,6 +796,7 @@ pub mod tests {
max_custom_predicate_verifications: 2,
..Default::default()
};
println!("{:#?}", params);
let mut cpb_builder = CustomPredicateBatchBuilder::new(params.clone(), "cpb".into());
let stb0 = STB::new(NP::ValueOf)
@ -824,6 +831,7 @@ pub mod tests {
let mut prover = Prover {};
let pod = pod_builder.prove(&mut prover, &params)?;
crate::measure_gates_print!();
let pod = (pod.pod as Box<dyn Any>).downcast::<MainPod>().unwrap();