diff --git a/zk_prover/src/chips/range/tests.rs b/zk_prover/src/chips/range/tests.rs index 07cc576..70b68b8 100644 --- a/zk_prover/src/chips/range/tests.rs +++ b/zk_prover/src/chips/range/tests.rs @@ -292,4 +292,22 @@ mod testing { .render(9, &circuit, &root) .unwrap(); } + + #[cfg(feature = "dev-graph")] + #[test] + fn range_check_cost() { + use halo2_proofs::{dev::CircuitCost, halo2curves::bn256::G1}; + + // TODO: confirm the value of K + const K: u32 = 4; + + let circuit = TestCircuit::<4> { + a: Fp::from(0x1f2f3f4f), + b: Fp::from(1), + }; + + let ckt_cost = CircuitCost::>::measure(K, &circuit); + let proof_size = ckt_cost.proof_size(1); + print!("{:#?}", proof_size); + } } diff --git a/zk_prover/src/circuits/tests.rs b/zk_prover/src/circuits/tests.rs index cab5e15..c5b8d32 100644 --- a/zk_prover/src/circuits/tests.rs +++ b/zk_prover/src/circuits/tests.rs @@ -458,4 +458,27 @@ mod test { .render(K, &circuit, &root) .unwrap(); } + + + #[cfg(feature = "dev-graph")] + #[test] + fn mst_inclusion_cost() { + use halo2_proofs::{dev::CircuitCost, halo2curves::bn256::G1}; + + // TODO: confirm the value of K + const K: u32 = 11; + + let merkle_sum_tree = + MerkleSumTree::::from_csv("../csv/entry_16.csv").unwrap(); + let user_index = 0; + let merkle_proof = merkle_sum_tree.generate_proof(user_index).unwrap(); + let circuit = MstInclusionCircuit::::init(merkle_proof); + + let ckt_cost = + CircuitCost::>::measure( + K, &circuit, + ); + let proof_size = ckt_cost.proof_size(1); + print!("{:#?}", proof_size); + } }