1- import type { UltraHonkBackend } from "@aztec/bb.js" ;
1+ import { UltraHonkBackend } from "@aztec/bb.js" ;
22import { utils } from "@repo/utils" ;
3+ import os from "node:os" ;
34import type { AsyncOrSync } from "ts-essentials" ;
45import { NativeUltraHonkBackend } from "./NativeUltraHonkBackend" ;
56import { RollupService } from "./RollupOnlyService" ;
@@ -14,11 +15,14 @@ export function createBackendSdk(
1415 const rollup = new RollupService ( coreSdk . contract , trees , {
1516 rollup : utils . iife ( async ( ) => {
1617 const { Noir } = await import ( "@noir-lang/noir_js" ) ;
17- const noir = new Noir ( await compiledCircuits . rollup ) ;
18- const backend = new NativeUltraHonkBackend (
19- `${ process . env . HOME } /.bb/bb` ,
20- await compiledCircuits . rollup ,
21- ) as unknown as UltraHonkBackend ;
18+ const circuit = await compiledCircuits . rollup ;
19+ const noir = new Noir ( circuit ) ;
20+ const backend = process . env . CI
21+ ? new UltraHonkBackend ( circuit . bytecode , { threads : os . cpus ( ) . length } )
22+ : ( new NativeUltraHonkBackend (
23+ `${ process . env . HOME } /.bb/bb` ,
24+ circuit ,
25+ ) as unknown as UltraHonkBackend ) ;
2226 return { noir, backend } ;
2327 } ) ,
2428 } ) ;
0 commit comments