@agoric/cosmic-swingset 0.41.4-dev-074c43c.0 → 0.41.4-dev-97e3f7b.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/cosmic-swingset",
3
- "version": "0.41.4-dev-074c43c.0+074c43c",
3
+ "version": "0.41.4-dev-97e3f7b.0+97e3f7b",
4
4
  "description": "Agoric's Cosmos blockchain integration",
5
5
  "type": "module",
6
6
  "bin": {
@@ -22,15 +22,15 @@
22
22
  "author": "Agoric",
23
23
  "license": "Apache-2.0",
24
24
  "dependencies": {
25
- "@agoric/builders": "0.1.1-dev-074c43c.0+074c43c",
26
- "@agoric/cosmos": "0.34.2-dev-074c43c.0+074c43c",
27
- "@agoric/deploy-script-support": "0.10.4-dev-074c43c.0+074c43c",
28
- "@agoric/internal": "0.3.3-dev-074c43c.0+074c43c",
29
- "@agoric/store": "0.9.3-dev-074c43c.0+074c43c",
30
- "@agoric/swing-store": "0.9.2-dev-074c43c.0+074c43c",
31
- "@agoric/swingset-vat": "0.32.3-dev-074c43c.0+074c43c",
32
- "@agoric/telemetry": "0.6.3-dev-074c43c.0+074c43c",
33
- "@agoric/vm-config": "0.1.1-dev-074c43c.0+074c43c",
25
+ "@agoric/builders": "0.1.1-dev-97e3f7b.0+97e3f7b",
26
+ "@agoric/cosmos": "0.34.2-dev-97e3f7b.0+97e3f7b",
27
+ "@agoric/deploy-script-support": "0.10.4-dev-97e3f7b.0+97e3f7b",
28
+ "@agoric/internal": "0.3.3-dev-97e3f7b.0+97e3f7b",
29
+ "@agoric/store": "0.9.3-dev-97e3f7b.0+97e3f7b",
30
+ "@agoric/swing-store": "0.9.2-dev-97e3f7b.0+97e3f7b",
31
+ "@agoric/swingset-vat": "0.32.3-dev-97e3f7b.0+97e3f7b",
32
+ "@agoric/telemetry": "0.6.3-dev-97e3f7b.0+97e3f7b",
33
+ "@agoric/vm-config": "0.1.1-dev-97e3f7b.0+97e3f7b",
34
34
  "@endo/bundle-source": "^3.4.0",
35
35
  "@endo/env-options": "^1.1.5",
36
36
  "@endo/errors": "^1.2.4",
@@ -70,5 +70,5 @@
70
70
  "typeCoverage": {
71
71
  "atLeast": 80.6
72
72
  },
73
- "gitHead": "074c43c8204f46dbc5179a498b7f004514528296"
73
+ "gitHead": "97e3f7b0b45fca80599c8734e90362dcb6aa1071"
74
74
  }
package/src/chain-main.js CHANGED
@@ -64,6 +64,16 @@ const toNumber = specimen => {
64
64
  return number;
65
65
  };
66
66
 
67
+ /**
68
+ * The swingset config object parsed and resolved by cosmos in
69
+ * `golang/cosmos/x/swingset/config.go`. The shape should be kept in sync
70
+ * with `SwingsetConfig` defined there.
71
+ *
72
+ * @typedef {object} CosmosSwingsetConfig
73
+ * @property {string} [slogfile]
74
+ * @property {number} [maxVatsOnline]
75
+ */
76
+
67
77
  /**
68
78
  * A boot message consists of cosmosInitAction fields that are subject to
69
79
  * consensus. See cosmosInitAction in {@link ../../../golang/cosmos/app/app.go}.
@@ -90,6 +100,19 @@ const makeBootMsg = initAction => {
90
100
  };
91
101
  };
92
102
 
103
+ /**
104
+ * Extract local Swingset-specific configuration which is
105
+ * not part of the consensus.
106
+ *
107
+ * @param {CosmosSwingsetConfig} [resolvedConfig]
108
+ */
109
+ const makeSwingsetConfig = resolvedConfig => {
110
+ const { maxVatsOnline } = resolvedConfig || {};
111
+ return {
112
+ maxVatsOnline,
113
+ };
114
+ };
115
+
93
116
  /**
94
117
  * @template {unknown} [T=unknown]
95
118
  * @param {(req: string) => string} call
@@ -283,6 +306,8 @@ export default async function main(progname, args, { env, homedir, agcc }) {
283
306
  // eslint-disable-next-line dot-notation
284
307
  if (slogfile) env['SLOGFILE'] = slogfile;
285
308
 
309
+ const swingsetConfig = makeSwingsetConfig(initAction.resolvedConfig);
310
+
286
311
  const sendToChainStorage = msg => chainSend(portNums.storage, msg);
287
312
  // this object is used to store the mailbox state.
288
313
  const fromBridgeMailbox = data => {
@@ -515,6 +540,7 @@ export default async function main(progname, args, { env, homedir, agcc }) {
515
540
  swingStoreTraceFile,
516
541
  keepSnapshots,
517
542
  afterCommitCallback,
543
+ swingsetConfig,
518
544
  });
519
545
 
520
546
  const { blockingSend, shutdown } = s;
@@ -119,6 +119,7 @@ export async function buildSwingset(
119
119
  verbose,
120
120
  profileVats,
121
121
  debugVats,
122
+ warehousePolicy,
122
123
  },
123
124
  ) {
124
125
  const debugPrefix = debugName === undefined ? '' : `${debugName}:`;
@@ -226,6 +227,7 @@ export async function buildSwingset(
226
227
  verbose,
227
228
  profileVats,
228
229
  debugVats,
230
+ warehousePolicy,
229
231
  },
230
232
  );
231
233
 
@@ -330,6 +332,7 @@ export async function launch({
330
332
  swingStoreExportCallback,
331
333
  keepSnapshots,
332
334
  afterCommitCallback = async () => ({}),
335
+ swingsetConfig,
333
336
  }) {
334
337
  console.info('Launching SwingSet kernel');
335
338
 
@@ -394,6 +397,9 @@ export async function launch({
394
397
  });
395
398
 
396
399
  console.debug(`buildSwingset`);
400
+ const warehousePolicy = {
401
+ maxVatsOnline: swingsetConfig.maxVatsOnline,
402
+ };
397
403
  const {
398
404
  coreProposals: bootstrapCoreProposals,
399
405
  controller,
@@ -411,6 +417,7 @@ export async function launch({
411
417
  debugName,
412
418
  slogCallbacks,
413
419
  slogSender,
420
+ warehousePolicy,
414
421
  },
415
422
  );
416
423