This repository was archived by the owner on Apr 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +29
-10
lines changed
Expand file tree Collapse file tree 2 files changed +29
-10
lines changed Original file line number Diff line number Diff line change @@ -169,10 +169,6 @@ pub fn gen_recursion_pk<ST: StateTransition>(
169169 mut rng : impl Rng + Send ,
170170 path : Option < & Path > ,
171171) -> ProvingKey < G1Affine > {
172- // TODO: it seems the "dummy app snark" is not correct when
173- // app has accumulator
174- assert_eq ! ( ST :: num_accumulator_instance( ) , 0 ,
175- "can not build dummy snark for app with accumulator" ) ;
176172
177173 let app_snark =
178174 gen_dummy_snark :: < ST :: Circuit > ( app_params, app_vk, & [ ST :: num_instance ( ) ] , & mut rng) ;
Original file line number Diff line number Diff line change @@ -213,6 +213,23 @@ mod app {
213213 fn state_transition ( & self , _: usize ) -> Self :: Input {
214214 self . 0 . square ( ) . square ( )
215215 }
216+
217+ fn num_additional_instance ( ) -> usize {
218+ 2
219+ }
220+
221+ fn state_indices ( ) -> Vec < usize > {
222+ let beg = 13 + Self :: num_transition_instance ( ) ;
223+ ( beg..beg + Self :: num_transition_instance ( ) ) . collect ( )
224+ }
225+
226+ fn state_prev_indices ( ) -> Vec < usize > {
227+ ( 13 ..13 + Self :: num_transition_instance ( ) ) . collect ( )
228+ }
229+
230+ fn additional_indices ( ) -> Vec < usize > {
231+ vec ! [ 12 , 13 + Self :: num_transition_instance( ) * 2 ]
232+ }
216233 }
217234
218235
@@ -302,9 +319,9 @@ mod app {
302319
303320}
304321
322+ mod app_add_inst {
323+ use super :: * ;
305324
306- #[ test]
307- fn test_recursion_add_inst ( ) {
308325 #[ derive( Clone , Default ) ]
309326 struct Square ( Fr ) ;
310327
@@ -393,8 +410,14 @@ fn test_recursion_add_inst() {
393410 }
394411 }
395412
396- test_recursion_impl :: < Square > (
397- 4 ,
398- Fr :: from ( 2u64 ) ,
399- ) ;
413+ #[ test]
414+ fn test_recursion_circuit ( ) {
415+ test_recursion_impl :: < Square > (
416+ 4 ,
417+ Fr :: from ( 2u64 ) ,
418+ ) ;
419+ }
420+
421+
400422}
423+
You can’t perform that action at this time.
0 commit comments