@@ -29,7 +29,7 @@ const BYTES_PER_CELL = 2048
2929 *
3030 * @returns object - the KZG methods required for all 4844 related operations
3131 */
32- export const loadKZG = async ( trustedSetup : TrustedSetup = mainnetTrustedSetup , precompute : number = 8 ) => {
32+ export const loadKZG = async ( precompute : number = 0 , trustedSetup : TrustedSetup = mainnetTrustedSetup ) => {
3333 // In Node.js environment, preload the WASM binary to avoid path resolution issues
3434 let wasmBinary = await loadWasmModule ( ) ;
3535
@@ -55,7 +55,7 @@ export const loadKZG = async (trustedSetup: TrustedSetup = mainnetTrustedSetup,
5555 * @param trustedSetup - an optional trusted setup parameter provided by the user
5656 * @returns 0 if loaded successfully or non zero otherwise
5757 */
58- const loadTrustedSetup = ( trustedSetup : TrustedSetup = mainnetTrustedSetup , precompute : number = 8 ) => {
58+ const loadTrustedSetup = ( precompute : number = 0 , trustedSetup : TrustedSetup = mainnetTrustedSetup ) => {
5959 if ( trustedSetup . g1_monomial . length != 48 * 4096 * 2 ) {
6060 throw new Error ( `trusted setup g1_monomial must be 48 * 4096 bytes long, not ${ trustedSetup . g1_monomial . length } ` )
6161 }
@@ -293,7 +293,7 @@ export const loadKZG = async (trustedSetup: TrustedSetup = mainnetTrustedSetup,
293293 return res === 'true'
294294 }
295295
296- const loadResult = loadTrustedSetup ( trustedSetup , precompute ) ;
296+ const loadResult = loadTrustedSetup ( precompute , trustedSetup ) ;
297297 if ( loadResult !== 0 ) {
298298 throw new Error ( `Failed to load trusted setup, error code: ${ loadResult } ` ) ;
299299 }
0 commit comments