1- use ff:: { FromUniformBytes , WithSmallOrderMulGroup } ;
2- use std:: iter;
3-
41use super :: { vanishing, Error , VerifyingKey } ;
52use crate :: poly:: commitment:: PolynomialCommitmentScheme ;
63use crate :: poly:: VerifierQuery ;
74use crate :: transcript:: { read_n, Hashable , Sampleable , Transcript } ;
85use crate :: utils:: arithmetic:: compute_inner_product;
6+ use ff:: { FromUniformBytes , WithSmallOrderMulGroup } ;
7+ #[ cfg( feature = "plutus_debug" ) ]
8+ use log:: info;
9+ use std:: iter;
910
1011/// Prepares a plonk proof into a PCS instance that can be finalized or batched. It is
1112/// responsibility of the verifier to check the validity of the instance columns.
@@ -192,21 +193,36 @@ where
192193 } )
193194 . collect :: < Result < Vec < _ > , _ > > ( ) ?
194195 } ;
196+ #[ cfg( feature = "plutus_debug" ) ]
197+ info ! ( "instance evals {instance_evals:?}" ) ;
195198
196199 let advice_evals = ( 0 ..num_proofs)
197200 . map ( |_| -> Result < Vec < _ > , _ > { read_n ( transcript, vk. cs . advice_queries . len ( ) ) } )
198201 . collect :: < Result < Vec < _ > , _ > > ( ) ?;
199202
203+ #[ cfg( feature = "plutus_debug" ) ]
204+ info ! ( "advice evals {advice_evals:?}" ) ;
205+
200206 let fixed_evals = read_n ( transcript, vk. cs . fixed_queries . len ( ) ) ?;
207+
208+ #[ cfg( feature = "plutus_debug" ) ]
209+ info ! ( "fixed evals {fixed_evals:?}" ) ;
210+
201211 let vanishing = vanishing. evaluate_after_x ( transcript) ?;
202212
203213 let permutations_common = vk. permutation . evaluate ( transcript) ?;
204214
215+ #[ cfg( feature = "plutus_debug" ) ]
216+ info ! ( "permutations common {permutations_common:?}" ) ;
217+
205218 let permutations_evaluated = permutations_committed
206219 . into_iter ( )
207220 . map ( |permutation| permutation. evaluate ( transcript) )
208221 . collect :: < Result < Vec < _ > , _ > > ( ) ?;
209222
223+ #[ cfg( feature = "plutus_debug" ) ]
224+ info ! ( "permutations evaluated {permutations_evaluated:?}" ) ;
225+
210226 let lookups_evaluated = lookups_committed
211227 . into_iter ( )
212228 . map ( |lookups| -> Result < Vec < _ > , _ > {
@@ -217,6 +233,9 @@ where
217233 } )
218234 . collect :: < Result < Vec < _ > , _ > > ( ) ?;
219235
236+ #[ cfg( feature = "plutus_debug" ) ]
237+ info ! ( "lookups evaluated {lookups_evaluated:?}" ) ;
238+
220239 // This check ensures the circuit is satisfied so long as the polynomial
221240 // commitments open to the correct values.
222241 let vanishing = {
@@ -355,6 +374,16 @@ where
355374 . chain ( permutations_common. queries ( & vk. permutation , x) )
356375 . chain ( vanishing. queries ( x) ) ;
357376
377+ #[ cfg( feature = "plutus_debug" ) ]
378+ {
379+ queries. clone ( ) . for_each ( |query| {
380+ info ! ( "------query----" ) ;
381+ info ! ( "( commitment: ( {:?} ), point: {:?}, evaluation: {:?} )" ,
382+ CS :: display( & query. commitment) , query. point, query. eval) ;
383+ info ! ( "---------------" ) ;
384+ } ) ;
385+ }
386+
358387 // We are now convinced the circuit is satisfied so long as the
359388 // polynomial commitments open to the correct values.
360389 CS :: multi_prepare ( queries, transcript) . map_err ( |_| Error :: Opening )
0 commit comments