@@ -233,7 +233,7 @@ function ZkProgram<
233233 [ I in keyof Config [ 'methods' ] ] : InferMethodType < Config > [ I ] ;
234234 } ;
235235 overrideWrapDomain ?: 0 | 1 | 2 ;
236- chunks ?: number ;
236+ numChunks ?: number ;
237237 }
238238) : {
239239 name : string ;
@@ -244,6 +244,7 @@ function ZkProgram<
244244 forceRecompile ?: boolean ;
245245 proofsEnabled ?: boolean ;
246246 withRuntimeTables ?: boolean ;
247+ numChunks ?: number ;
247248 } ) => Promise < {
248249 verificationKey : { data : string ; hash : Field } ;
249250 } > ;
@@ -387,9 +388,9 @@ function ZkProgram<
387388 cache,
388389 forceRecompile,
389390 overrideWrapDomain : config . overrideWrapDomain ,
391+ numChunks : config . numChunks ,
390392 state : programState ,
391393 withRuntimeTables,
392- chunks : config . chunks ,
393394 } ) ;
394395
395396 compileOutput = { provers, verify, maxProofsVerified } ;
@@ -692,9 +693,9 @@ async function compileProgram({
692693 cache,
693694 forceRecompile,
694695 overrideWrapDomain,
696+ numChunks,
695697 state,
696698 withRuntimeTables,
697- chunks,
698699} : {
699700 publicInputType : Provable < any > ;
700701 publicOutputType : Provable < any > ;
@@ -706,9 +707,9 @@ async function compileProgram({
706707 cache : Cache ;
707708 forceRecompile : boolean ;
708709 overrideWrapDomain ?: 0 | 1 | 2 ;
710+ numChunks ?: number ;
709711 state ?: ReturnType < typeof createProgramState > ;
710712 withRuntimeTables ?: boolean ;
711- chunks ?: number ;
712713} ) {
713714 await initializeBindings ( ) ;
714715 if ( methodIntfs . length === 0 )
@@ -753,36 +754,35 @@ If you are using a SmartContract, make sure you are using the @method decorator.
753754 MlBool ( cache . canWrite ) ,
754755 ] ;
755756
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- ) ;
757+ let { verificationKey, provers, verify, tag } = 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+ numChunks : numChunks ?? 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+ ) ;
786786 // wrap provers
787787 let wrappedProvers = provers . map (
788788 ( prover ) : Pickles . Prover =>
0 commit comments