From b29242078bcf88005272b0fabfaf876e4a63f0f5 Mon Sep 17 00:00:00 2001 From: NicoSerranoP Date: Tue, 26 Nov 2024 11:54:36 -0500 Subject: [PATCH 1/7] fix: increase memory limit for verify contribution cf --- packages/backend/src/functions/circuit.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/functions/circuit.ts b/packages/backend/src/functions/circuit.ts index cc0a870d..1d991a5e 100644 --- a/packages/backend/src/functions/circuit.ts +++ b/packages/backend/src/functions/circuit.ts @@ -460,7 +460,7 @@ const checkIfVMRunning = async (ec2: EC2Client, vmInstanceId: string, attempts = * 2) Send all updates atomically to the Firestore database. */ export const verifycontribution = functionsV2.https.onCall( - { memory: "16GiB", timeoutSeconds: 3600, region: "europe-west1" }, + { memory: "32GiB", timeoutSeconds: 3600, region: "europe-west1" }, async (request: functionsV2.https.CallableRequest): Promise => { try { if (!request.auth || (!request.auth.token.participant && !request.auth.token.coordinator)) @@ -895,7 +895,7 @@ export const verifycontribution = functionsV2.https.onCall( } } catch (error: any) { logAndThrowError(makeError("unknown", error)) - } + } } ) From a37008fed060987801dd108b05e4f41d9bb4522a Mon Sep 17 00:00:00 2001 From: NicoSerranoP Date: Tue, 26 Nov 2024 12:26:24 -0500 Subject: [PATCH 2/7] fix: increase cpu use --- packages/backend/src/functions/circuit.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/functions/circuit.ts b/packages/backend/src/functions/circuit.ts index 1d991a5e..96e58148 100644 --- a/packages/backend/src/functions/circuit.ts +++ b/packages/backend/src/functions/circuit.ts @@ -460,7 +460,7 @@ const checkIfVMRunning = async (ec2: EC2Client, vmInstanceId: string, attempts = * 2) Send all updates atomically to the Firestore database. */ export const verifycontribution = functionsV2.https.onCall( - { memory: "32GiB", timeoutSeconds: 3600, region: "europe-west1" }, + { memory: "32GiB", timeoutSeconds: 3600, region: "europe-west1", cpu: "6" }, async (request: functionsV2.https.CallableRequest): Promise => { try { if (!request.auth || (!request.auth.token.participant && !request.auth.token.coordinator)) From 06d1ee9074ca8fee8f6038bb859d1c05d0c8d91b Mon Sep 17 00:00:00 2001 From: NicoSerranoP Date: Tue, 26 Nov 2024 13:23:46 -0500 Subject: [PATCH 3/7] fix: send cpu value as number --- packages/backend/src/functions/circuit.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/functions/circuit.ts b/packages/backend/src/functions/circuit.ts index 96e58148..680f377a 100644 --- a/packages/backend/src/functions/circuit.ts +++ b/packages/backend/src/functions/circuit.ts @@ -460,7 +460,7 @@ const checkIfVMRunning = async (ec2: EC2Client, vmInstanceId: string, attempts = * 2) Send all updates atomically to the Firestore database. */ export const verifycontribution = functionsV2.https.onCall( - { memory: "32GiB", timeoutSeconds: 3600, region: "europe-west1", cpu: "6" }, + { memory: "32GiB", timeoutSeconds: 3600, region: "europe-west1", cpu: 6 }, async (request: functionsV2.https.CallableRequest): Promise => { try { if (!request.auth || (!request.auth.token.participant && !request.auth.token.coordinator)) From bbaaa16c7a8a13b680ad7a2b1c02ef85775ba6d7 Mon Sep 17 00:00:00 2001 From: NicoSerranoP Date: Tue, 26 Nov 2024 15:30:35 -0500 Subject: [PATCH 4/7] fix: memory increase to 24gb --- packages/backend/src/functions/circuit.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/functions/circuit.ts b/packages/backend/src/functions/circuit.ts index 680f377a..1c82a357 100644 --- a/packages/backend/src/functions/circuit.ts +++ b/packages/backend/src/functions/circuit.ts @@ -460,7 +460,7 @@ const checkIfVMRunning = async (ec2: EC2Client, vmInstanceId: string, attempts = * 2) Send all updates atomically to the Firestore database. */ export const verifycontribution = functionsV2.https.onCall( - { memory: "32GiB", timeoutSeconds: 3600, region: "europe-west1", cpu: 6 }, + { memory: "24GiB", timeoutSeconds: 3600, region: "europe-west1", cpu: 6 }, async (request: functionsV2.https.CallableRequest): Promise => { try { if (!request.auth || (!request.auth.token.participant && !request.auth.token.coordinator)) From 156891dd5a8c626695eeb79c4d8c1933669db3c1 Mon Sep 17 00:00:00 2001 From: NicoSerranoP Date: Tue, 26 Nov 2024 15:56:54 -0500 Subject: [PATCH 5/7] fix: try different set --- packages/backend/src/functions/circuit.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/functions/circuit.ts b/packages/backend/src/functions/circuit.ts index 1c82a357..96bb6c32 100644 --- a/packages/backend/src/functions/circuit.ts +++ b/packages/backend/src/functions/circuit.ts @@ -460,7 +460,7 @@ const checkIfVMRunning = async (ec2: EC2Client, vmInstanceId: string, attempts = * 2) Send all updates atomically to the Firestore database. */ export const verifycontribution = functionsV2.https.onCall( - { memory: "24GiB", timeoutSeconds: 3600, region: "europe-west1", cpu: 6 }, + { memory: "32GiB", timeoutSeconds: 3600, region: "europe-west1", cpu: 8 }, async (request: functionsV2.https.CallableRequest): Promise => { try { if (!request.auth || (!request.auth.token.participant && !request.auth.token.coordinator)) From c5bd5d37bfbeb28ba551e2896dbb8c51fbdb75dc Mon Sep 17 00:00:00 2001 From: NicoSerranoP Date: Tue, 26 Nov 2024 17:41:28 -0500 Subject: [PATCH 6/7] fix: increase bandada memory limit --- packages/backend/src/functions/bandada.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/functions/bandada.ts b/packages/backend/src/functions/bandada.ts index d7c74794..2e3af603 100644 --- a/packages/backend/src/functions/bandada.ts +++ b/packages/backend/src/functions/bandada.ts @@ -15,7 +15,7 @@ const bandadaApi = new ApiSdk(BANDADA_API_URL) export const bandadaValidateProof = functions .region("europe-west1") .runWith({ - memory: "512MB" + memory: "1GB" }) .https.onCall(async (data: BandadaValidateProof): Promise => { const VKEY_DATA = { From 40b9b6e26bfc38d820fd18e0b0b2d6153688f3d0 Mon Sep 17 00:00:00 2001 From: NicoSerranoP Date: Tue, 26 Nov 2024 17:56:55 -0500 Subject: [PATCH 7/7] fix: increase memory in initEmptyWaitingQueueForCircuit --- packages/backend/src/functions/ceremony.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/functions/ceremony.ts b/packages/backend/src/functions/ceremony.ts index 2fa47434..1f80d1cb 100644 --- a/packages/backend/src/functions/ceremony.ts +++ b/packages/backend/src/functions/ceremony.ts @@ -232,7 +232,7 @@ export const setupCeremony = functions export const initEmptyWaitingQueueForCircuit = functions .region("europe-west1") .runWith({ - memory: "512MB" + memory: "1GB" }) .firestore.document( `/${commonTerms.collections.ceremonies.name}/{ceremony}/${commonTerms.collections.circuits.name}/{circuit}`