From 93280733c28458a0d76772bdb80ba142f23e5a37 Mon Sep 17 00:00:00 2001 From: Pierre Jeanjacquot <26487010+PierreJeanjacquot@users.noreply.github.com> Date: Thu, 24 Jul 2025 16:19:49 +0200 Subject: [PATCH 1/4] fix: disable wasm trap handler to avoid memory exhaustion by default wasm allocates 10GB virtual memory cage which too big for current scone heap (1GB) https://github.com/nodejs/node/blob/v24.4.1/doc/changelogs/CHANGELOG_V20.md#cli-allow-running-wasm-in-limited-vmem-with---disable-wasm-trap-handler --- .github/workflows/dapp-deploy.yml | 2 +- .github/workflows/dapp-release.yml | 2 +- dapp/Dockerfile | 4 ++-- deployment-dapp/src/singleFunction/deployApp.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dapp-deploy.yml b/.github/workflows/dapp-deploy.yml index fefec8c2..df424896 100644 --- a/.github/workflows/dapp-deploy.yml +++ b/.github/workflows/dapp-deploy.yml @@ -63,7 +63,7 @@ jobs: docker-registry: docker.io sconify-version: '5.9.0-v15' binary: /usr/local/bin/node - command: node /app/src/app.js + command: node host-path: | /etc/hosts /etc/resolv.conf diff --git a/.github/workflows/dapp-release.yml b/.github/workflows/dapp-release.yml index 1e2b064b..6bb9a23c 100644 --- a/.github/workflows/dapp-release.yml +++ b/.github/workflows/dapp-release.yml @@ -44,7 +44,7 @@ jobs: docker-registry: docker.io sconify-version: '5.9.0-v15' binary: /usr/local/bin/node - command: node /app/src/app.js + command: node host-path: | /etc/hosts /etc/resolv.conf diff --git a/dapp/Dockerfile b/dapp/Dockerfile index 432de36c..be23f330 100644 --- a/dapp/Dockerfile +++ b/dapp/Dockerfile @@ -1,6 +1,6 @@ -FROM node:20-alpine3.22 +FROM node:20.19-alpine3.22 WORKDIR /app COPY package*.json ./ RUN npm ci --production COPY ./src . -ENTRYPOINT [ "node", "/app/app.js"] +ENTRYPOINT [ "node", "--disable-wasm-trap-handler", "/app/app.js" ] diff --git a/deployment-dapp/src/singleFunction/deployApp.ts b/deployment-dapp/src/singleFunction/deployApp.ts index 1a506cf2..410ea81b 100644 --- a/deployment-dapp/src/singleFunction/deployApp.ts +++ b/deployment-dapp/src/singleFunction/deployApp.ts @@ -27,7 +27,7 @@ export const deployApp = async ({ const mrenclave = { framework: 'SCONE' as any, // workaround framework not auto capitalized version: 'v5.9', - entrypoint: 'node /app/app.js', + entrypoint: 'node --disable-wasm-trap-handler /app/app.js', heapSize: 1073741824, fingerprint, }; From 20e218b3855c9e5a91a2209126c530293292a573 Mon Sep 17 00:00:00 2001 From: Pierre Jeanjacquot <26487010+PierreJeanjacquot@users.noreply.github.com> Date: Mon, 28 Jul 2025 10:18:20 +0200 Subject: [PATCH 2/4] fix: upgrade scone heap size to 7G --- .github/workflows/dapp-deploy.yml | 2 +- .github/workflows/dapp-release.yml | 2 +- deployment-dapp/src/singleFunction/deployApp.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dapp-deploy.yml b/.github/workflows/dapp-deploy.yml index df424896..4e0ab224 100644 --- a/.github/workflows/dapp-deploy.yml +++ b/.github/workflows/dapp-deploy.yml @@ -69,7 +69,7 @@ jobs: /etc/resolv.conf binary-fs: true fs-dir: /app - heap: 1G + heap: 7G dlopen: 1 mprotect: 1 secrets: diff --git a/.github/workflows/dapp-release.yml b/.github/workflows/dapp-release.yml index 6bb9a23c..959f704d 100644 --- a/.github/workflows/dapp-release.yml +++ b/.github/workflows/dapp-release.yml @@ -50,7 +50,7 @@ jobs: /etc/resolv.conf binary-fs: true fs-dir: /app - heap: 1G + heap: 7G dlopen: 1 mprotect: 1 secrets: diff --git a/deployment-dapp/src/singleFunction/deployApp.ts b/deployment-dapp/src/singleFunction/deployApp.ts index 410ea81b..44760f9a 100644 --- a/deployment-dapp/src/singleFunction/deployApp.ts +++ b/deployment-dapp/src/singleFunction/deployApp.ts @@ -28,7 +28,7 @@ export const deployApp = async ({ framework: 'SCONE' as any, // workaround framework not auto capitalized version: 'v5.9', entrypoint: 'node --disable-wasm-trap-handler /app/app.js', - heapSize: 1073741824, + heapSize: 7516192768, fingerprint, }; const app = { From fb988449b9627681d9a8e4d7af68074615251800 Mon Sep 17 00:00:00 2001 From: Pierre Jeanjacquot <26487010+PierreJeanjacquot@users.noreply.github.com> Date: Mon, 28 Jul 2025 11:14:58 +0200 Subject: [PATCH 3/4] ci: fix dapp test --- .github/workflows/dapp-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dapp-ci.yml b/.github/workflows/dapp-ci.yml index 9f6fbefe..e5c859d1 100644 --- a/.github/workflows/dapp-ci.yml +++ b/.github/workflows/dapp-ci.yml @@ -47,7 +47,7 @@ jobs: MJ_APIKEY_PRIVATE: ${{ secrets.MAILJET_APIKEY_PRIVATE }} MJ_SENDER: ${{ secrets.MAILJET_SENDER }} MAILGUN_APIKEY: ${{ secrets.MAILGUN_APIKEY }} - WEB3MAIL_WHITELISTED_APPS: ${{ secrets.WEB3MAIL_WHITELISTED_APPS }} + WEB3MAIL_WHITELISTED_APPS: ${{ vars.WEB3MAIL_WHITELISTED_APPS }} steps: - uses: actions/checkout@v4 From aa6818027e5913649076e2c0cd7c3ccbdf185f42 Mon Sep 17 00:00:00 2001 From: Pierre Jeanjacquot <26487010+PierreJeanjacquot@users.noreply.github.com> Date: Mon, 28 Jul 2025 11:17:02 +0200 Subject: [PATCH 4/4] ci: remove duplicated test --- .github/workflows/dapp-ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/dapp-ci.yml b/.github/workflows/dapp-ci.yml index e5c859d1..cf15e723 100644 --- a/.github/workflows/dapp-ci.yml +++ b/.github/workflows/dapp-ci.yml @@ -60,8 +60,5 @@ jobs: - name: Install Dependencies run: npm ci - - name: Test unit - run: npm run test - - name: Test with coverage run: npm run ctest