From 1a7c6ff5ffcb1cc3c41cf06f899b41472c365906 Mon Sep 17 00:00:00 2001 From: Touseef Liaqat Date: Thu, 23 May 2024 18:47:15 -0700 Subject: [PATCH] feat: reduce number of online vats --- packages/synthetic-chain/src/cli/dockerfileGen.ts | 9 +++++++++ patches/min-vats-online.patch | 13 +++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 patches/min-vats-online.patch diff --git a/packages/synthetic-chain/src/cli/dockerfileGen.ts b/packages/synthetic-chain/src/cli/dockerfileGen.ts index cf925c0b..4452913a 100755 --- a/packages/synthetic-chain/src/cli/dockerfileGen.ts +++ b/packages/synthetic-chain/src/cli/dockerfileGen.ts @@ -184,6 +184,15 @@ ENTRYPOINT ./run_test.sh ${path} return ` # LAST FROM ${useImage} as latest + +# Patching SwingSet to reduce the number of online vats +COPY ./patches/min-vats-online.patch /usr/src/agoric-sdk/ +WORKDIR /usr/src/agoric-sdk/ +RUN git apply min-vats-online.patch +WORKDIR /usr/src/agoric-sdk/packages/cosmic-swingset +RUN make build + +WORKDIR /usr/src/upgrade-test-scripts `; }, }; diff --git a/patches/min-vats-online.patch b/patches/min-vats-online.patch new file mode 100644 index 00000000..209b60c7 --- /dev/null +++ b/patches/min-vats-online.patch @@ -0,0 +1,13 @@ +diff --git a/packages/SwingSet/src/kernel/vat-warehouse.js b/packages/SwingSet/src/kernel/vat-warehouse.js +index 327b74fd4..c6d6668bb 100644 +--- a/packages/SwingSet/src/kernel/vat-warehouse.js ++++ b/packages/SwingSet/src/kernel/vat-warehouse.js +@@ -243,7 +243,7 @@ export function makeVatWarehouse({ + panic, + warehousePolicy, + }) { +- const { maxVatsOnline = 50, restartWorkerOnSnapshot = true } = ++ const { maxVatsOnline = 5, restartWorkerOnSnapshot = true } = + warehousePolicy || {}; + // Often a large contract evaluation is among the first few deliveries, + // so let's do a snapshot after just a few deliveries.