@@ -233,6 +233,7 @@ function ZkProgram<
233233 [ I in keyof Config [ 'methods' ] ] : InferMethodType < Config > [ I ] ;
234234 } ;
235235 overrideWrapDomain ?: 0 | 1 | 2 ;
236+ chunks ?: number ;
236237 }
237238) : {
238239 name : string ;
@@ -388,6 +389,7 @@ function ZkProgram<
388389 overrideWrapDomain : config . overrideWrapDomain ,
389390 state : programState ,
390391 withRuntimeTables,
392+ chunks : config . chunks ,
391393 } ) ;
392394
393395 compileOutput = { provers, verify, maxProofsVerified } ;
@@ -692,6 +694,7 @@ async function compileProgram({
692694 overrideWrapDomain,
693695 state,
694696 withRuntimeTables,
697+ chunks,
695698} : {
696699 publicInputType : Provable < any > ;
697700 publicOutputType : Provable < any > ;
@@ -705,6 +708,7 @@ async function compileProgram({
705708 overrideWrapDomain ?: 0 | 1 | 2 ;
706709 state ?: ReturnType < typeof createProgramState > ;
707710 withRuntimeTables ?: boolean ;
711+ chunks ?: number ;
708712} ) {
709713 await initializeBindings ( ) ;
710714 if ( methodIntfs . length === 0 )
@@ -749,34 +753,36 @@ If you are using a SmartContract, make sure you are using the @method decorator.
749753 MlBool ( cache . canWrite ) ,
750754 ] ;
751755
752- let { verificationKey, provers, verify, tag } = await prettifyStacktracePromise (
753- withThreadPool ( async ( ) => {
754- let result : ReturnType < typeof Pickles . compile > ;
755- let id = snarkContext . enter ( { inCompile : true } ) ;
756- setSrsCache ( cache ) ;
757- try {
758- result = Pickles . compile ( MlArray . to ( rules ) , {
759- publicInputSize : publicInputType . sizeInFields ( ) ,
760- publicOutputSize : publicOutputType . sizeInFields ( ) ,
761- storable : picklesCache ,
762- overrideWrapDomain,
763- } ) ;
764- let { getVerificationKey, provers, verify, tag } = result ;
765- CompiledTag . store ( proofSystemTag , tag ) ;
766- let [ , data , hash ] = await getVerificationKey ( ) ;
767- let verificationKey = { data, hash : Field ( hash ) } ;
768- return {
769- verificationKey,
770- provers : MlArray . from ( provers ) ,
771- verify,
772- tag,
773- } ;
774- } finally {
775- snarkContext . leave ( id ) ;
776- unsetSrsCache ( ) ;
777- }
778- } )
779- ) ;
756+ let { verificationKey, provers, verify, tag } =
757+ await prettifyStacktracePromise (
758+ withThreadPool ( async ( ) => {
759+ let result : ReturnType < typeof Pickles . compile > ;
760+ let id = snarkContext . enter ( { inCompile : true } ) ;
761+ setSrsCache ( cache ) ;
762+ try {
763+ result = Pickles . compile ( MlArray . to ( rules ) , {
764+ publicInputSize : publicInputType . sizeInFields ( ) ,
765+ publicOutputSize : publicOutputType . sizeInFields ( ) ,
766+ storable : picklesCache ,
767+ overrideWrapDomain,
768+ chunks : chunks ?? 1 ,
769+ } ) ;
770+ let { getVerificationKey, provers, verify, tag } = result ;
771+ CompiledTag . store ( proofSystemTag , tag ) ;
772+ let [ , data , hash ] = await getVerificationKey ( ) ;
773+ let verificationKey = { data, hash : Field ( hash ) } ;
774+ return {
775+ verificationKey,
776+ provers : MlArray . from ( provers ) ,
777+ verify,
778+ tag,
779+ } ;
780+ } finally {
781+ snarkContext . leave ( id ) ;
782+ unsetSrsCache ( ) ;
783+ }
784+ } )
785+ ) ;
780786 // wrap provers
781787 let wrappedProvers = provers . map (
782788 ( prover ) : Pickles . Prover =>
0 commit comments