22use std:: sync:: Mutex ;
33// Workspace deps
44use zksync_config:: ChainConfig ;
5+ use zksync_crypto:: bellman:: Circuit ;
56use zksync_crypto:: proof:: { AggregatedProof , PrecomputedSampleProofs , SingleProof } ;
67use zksync_crypto:: Engine ;
78use zksync_prover_utils:: aggregated_proofs:: { gen_aggregate_proof, prepare_proof_data} ;
@@ -10,6 +11,7 @@ use zksync_prover_utils::{PlonkVerificationKey, SetupForStepByStepProver};
1011use zksync_utils:: parse_env;
1112// Local deps
1213use crate :: { ProverConfig , ProverImpl } ;
14+ use zksync_crypto:: franklin_crypto:: circuit:: test:: TestConstraintSystem ;
1315use zksync_prover_utils:: fs_utils:: load_precomputed_proofs;
1416
1517/// We prepare some data before making proof for each block size, so we cache it in case next block
@@ -56,6 +58,14 @@ impl PlonkStepByStepProver {
5658 block_size : usize ,
5759 ) -> anyhow:: Result < SingleProof > {
5860 // we do this way here so old precomp is dropped
61+ let mut cs = TestConstraintSystem :: < Engine > :: new ( ) ;
62+ witness. clone ( ) . synthesize ( & mut cs) . unwrap ( ) ;
63+
64+ if let Some ( err) = cs. which_is_unsatisfied ( ) {
65+ println ! ( "unconstrained: {}" , cs. find_unconstrained( ) ) ;
66+ println ! ( "number of constraints {}" , cs. num_constraints( ) ) ;
67+ println ! ( "Unsatisfied {:?}" , err) ;
68+ }
5969 let valid_cached_precomp = {
6070 self . prepared_computations
6171 . lock ( )
0 commit comments