Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP feat: reduce number of online vats #158

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/synthetic-chain/src/cli/dockerfileGen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
`;
},
};
Expand Down
13 changes: 13 additions & 0 deletions patches/min-vats-online.patch
Original file line number Diff line number Diff line change
@@ -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 } =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know whether this PR is a good idea, but if it goes forward I would suggest setting the option instead of changing the default.

I.e. adding a warehousePolicy to the runtimeOptions param here: https://github.com/Agoric/agoric-sdk/blob/50f94936e038d6b8872dfde77b5f54811f339ccd/packages/cosmic-swingset/src/launch-chain.js#L221-L233

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. I wanted to experiment without making a change in agoric-sdk to verify that it works, and then make the change in agoric-sdk so that we don't need a patch here.

warehousePolicy || {};
// Often a large contract evaluation is among the first few deliveries,
// so let's do a snapshot after just a few deliveries.