From e013ac262ee2540116e5afa198ff42c5cd7d68d0 Mon Sep 17 00:00:00 2001 From: nt <42067723+phi7@users.noreply.github.com> Date: Sat, 23 Sep 2023 09:13:02 +0900 Subject: [PATCH 1/2] change to permanent urls --- src/resources.ts | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/resources.ts b/src/resources.ts index ed8319ae..efb7b870 100644 --- a/src/resources.ts +++ b/src/resources.ts @@ -3,17 +3,17 @@ import { VerificationKey } from './types' import axios from 'axios' type ICircuitParams = { - wasmFile: string | Uint8Array, - finalZkey: string | Uint8Array, + wasmFile: string | Uint8Array; + finalZkey: string | Uint8Array; } type IRLNParams = ICircuitParams & { verificationKey: VerificationKey } type IWithdrawParams = ICircuitParams -// TODO: Change to a more permanent URL after trusted setup is complete -const resourcesURL = 'https://rln-resources-temp.s3.us-west-1.amazonaws.com/resources' +const resourcesURL = + 'https://rln-trusted-setup-ceremony-pse-p0tion-production.s3.eu-central-1.amazonaws.com/circuits' const rln20URL = `${resourcesURL}/rln-20` -const withdrawURL = `${resourcesURL}/withdraw` +const withdrawURL = `${resourcesURL}/rln-withdraw` const treeDepthToDefaultRLNParamsURL = { '20': rln20URL, } @@ -32,7 +32,8 @@ function parseVerificationKeyJSON(o: any): VerificationKey { if (!o.vk_beta_2) throw new Error('Verification key has no vk_beta_2') if (!o.vk_gamma_2) throw new Error('Verification key has no vk_gamma_2') if (!o.vk_delta_2) throw new Error('Verification key has no vk_delta_2') - if (!o.vk_alphabeta_12) throw new Error('Verification key has no vk_alphabeta_12') + if (!o.vk_alphabeta_12) + throw new Error('Verification key has no vk_alphabeta_12') if (!o.IC) throw new Error('Verification key has no IC') return o } @@ -47,9 +48,12 @@ export async function getDefaultRLNParams(treeDepth: number): Promise { - const wasmFileURL = `${withdrawURL}/circuit.wasm` - const finalZkeyURL = `${withdrawURL}/final.zkey` + const wasmFileURL = `${withdrawURL}/RLN-Withdraw.wasm` + const finalZkeyURL = `${withdrawURL}/contributions/rln-withdraw_final.zkey` const [wasmFile, finalZkey] = await Promise.all([ downloadBinary(wasmFileURL), downloadBinary(finalZkeyURL), @@ -74,5 +78,3 @@ export async function getDefaultWithdrawParams(): Promise { finalZkey, } } - - From ffd84cbfd71b2f9250f67db196bad7d26f029c89 Mon Sep 17 00:00:00 2001 From: nt <42067723+phi7@users.noreply.github.com> Date: Wed, 27 Sep 2023 11:45:06 +0900 Subject: [PATCH 2/2] delete consolelog --- src/resources.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/resources.ts b/src/resources.ts index efb7b870..662c052b 100644 --- a/src/resources.ts +++ b/src/resources.ts @@ -50,9 +50,6 @@ export async function getDefaultRLNParams(treeDepth: number): Promise