@@ -19,9 +19,11 @@ async function getCircuit(name: string) {
19
19
return compiled . program ;
20
20
}
21
21
22
+ const cores = 12 ;
23
+
22
24
async function fullNoirFromCircuit ( circuitName : string ) : Promise < FullNoir > {
23
25
const circuit : CompiledCircuit = await getCircuit ( circuitName ) ;
24
- const backend : BarretenbergBackend = new BarretenbergBackend ( circuit , { threads : 8 } ) ;
26
+ const backend : BarretenbergBackend = new BarretenbergBackend ( circuit , { threads : cores } ) ;
25
27
const noir : Noir = new Noir ( circuit , backend ) ;
26
28
return { circuit, backend, noir } ;
27
29
}
@@ -50,7 +52,6 @@ async function start() {
50
52
simple . backend . destroy ( ) ;
51
53
52
54
// Generate and verify outer proof
53
- console . log ( "Generating outer proof..." ) ;
54
55
const outerInput = {
55
56
verification_key : artifacts1 . vkAsFields ,
56
57
public_inputs : [ "1" ] , // expect output of inner call to be "true"
@@ -61,11 +62,16 @@ async function start() {
61
62
const outerWitness = ( await outer . noir . execute (
62
63
outerInput
63
64
) ) . witness ;
64
- const outerProof : ProofData = await outer . backend . generateProof ( outerWitness ) ;
65
-
66
- console . log ( "Verifying outer proof..." ) ;
67
- const res : boolean = await outer . backend . verifyProof ( outerProof ) ;
68
- console . log ( "Verification" , res ? "PASSED" : "failed" ) ;
65
+ try {
66
+ console . log ( "Generating outer proof..." ) ;
67
+ const outerProof : ProofData = await outer . backend . generateProof ( outerWitness ) ;
68
+ console . log ( "Verifying outer proof..." ) ;
69
+ const res : boolean = await outer . backend . verifyProof ( outerProof ) ;
70
+ console . log ( "Verification" , res ? "PASSED" : "failed" ) ;
71
+ }
72
+ catch ( e ) {
73
+ console . log ( e ) ;
74
+ }
69
75
70
76
outer . backend . destroy ( ) ;
71
77
}
0 commit comments