@agoric/swingset-vat 0.32.3-dev-9c73ae4.0 → 0.32.3-dev-d122756.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/swingset-vat",
3
- "version": "0.32.3-dev-9c73ae4.0+9c73ae4",
3
+ "version": "0.32.3-dev-d122756.0+d122756",
4
4
  "description": "Vat/Container Launcher",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -27,16 +27,16 @@
27
27
  "@types/yargs-parser": "^21.0.0"
28
28
  },
29
29
  "dependencies": {
30
- "@agoric/internal": "0.3.3-dev-9c73ae4.0+9c73ae4",
31
- "@agoric/kmarshal": "0.1.1-dev-9c73ae4.0+9c73ae4",
32
- "@agoric/store": "0.9.3-dev-9c73ae4.0+9c73ae4",
33
- "@agoric/swing-store": "0.9.2-dev-9c73ae4.0+9c73ae4",
34
- "@agoric/swingset-liveslots": "0.10.3-dev-9c73ae4.0+9c73ae4",
35
- "@agoric/swingset-xsnap-supervisor": "0.10.3-dev-9c73ae4.0+9c73ae4",
36
- "@agoric/time": "0.3.3-dev-9c73ae4.0+9c73ae4",
37
- "@agoric/vat-data": "0.5.3-dev-9c73ae4.0+9c73ae4",
38
- "@agoric/xsnap": "0.14.3-dev-9c73ae4.0+9c73ae4",
39
- "@agoric/xsnap-lockdown": "0.14.1-dev-9c73ae4.0+9c73ae4",
30
+ "@agoric/internal": "0.3.3-dev-d122756.0+d122756",
31
+ "@agoric/kmarshal": "0.1.1-dev-d122756.0+d122756",
32
+ "@agoric/store": "0.9.3-dev-d122756.0+d122756",
33
+ "@agoric/swing-store": "0.9.2-dev-d122756.0+d122756",
34
+ "@agoric/swingset-liveslots": "0.10.3-dev-d122756.0+d122756",
35
+ "@agoric/swingset-xsnap-supervisor": "0.10.3-dev-d122756.0+d122756",
36
+ "@agoric/time": "0.3.3-dev-d122756.0+d122756",
37
+ "@agoric/vat-data": "0.5.3-dev-d122756.0+d122756",
38
+ "@agoric/xsnap": "0.14.3-dev-d122756.0+d122756",
39
+ "@agoric/xsnap-lockdown": "0.14.1-dev-d122756.0+d122756",
40
40
  "@endo/base64": "^1.0.8",
41
41
  "@endo/bundle-source": "^3.4.2",
42
42
  "@endo/captp": "^4.4.2",
@@ -103,5 +103,5 @@
103
103
  "typeCoverage": {
104
104
  "atLeast": 75.82
105
105
  },
106
- "gitHead": "9c73ae4bfa7d48114690e694b065ee0a1ce99e30"
106
+ "gitHead": "d122756b667949664b0259f0a58f61d1d1f14d03"
107
107
  }
@@ -752,6 +752,8 @@ export default function buildKernel(
752
752
  kdebug(`vat ${vatID} terminated before startVat delivered`);
753
753
  return NO_DELIVERY_CRANK_RESULTS;
754
754
  }
755
+ const vatKeeper = kernelKeeper.provideVatKeeper(vatID);
756
+ vatKeeper.setVatParameters(vatParameters);
755
757
  const { meterID } = vatInfo;
756
758
  /** @type { KernelDeliveryStartVat } */
757
759
  const kd = harden(['startVat', vatParameters]);
@@ -1052,6 +1054,7 @@ export default function buildKernel(
1052
1054
  });
1053
1055
  const vatOptions = harden({ ...origOptions, workerOptions });
1054
1056
  vatKeeper.setSourceAndOptions(source, vatOptions);
1057
+ vatKeeper.setVatParameters(vatParameters);
1055
1058
  // TODO: decref the bundleID once setSourceAndOptions increfs it
1056
1059
 
1057
1060
  // pause, take a deep breath, appreciate this moment of silence
@@ -119,6 +119,8 @@ export const CURRENT_SCHEMA_VERSION = 3;
119
119
  // old (v0): v$NN.reapCountdown = $NN or 'never'
120
120
  // v$NN.reapDirt = JSON({ deliveries, gcKrefs, computrons }) // missing keys treated as zero
121
121
  // (leave room for v$NN.snapshotDirt and options.snapshotDirtThreshold for #6786)
122
+ // v$NN.vatParameters = JSON(capdata) // missing for vats created/upgraded before #8947
123
+ //
122
124
  // exclude from consensus
123
125
  // local.*
124
126
 
@@ -7,6 +7,7 @@ import { isObject } from '@endo/marshal';
7
7
  import { parseKernelSlot } from '../parseKernelSlots.js';
8
8
  import { makeVatSlot, parseVatSlot } from '../../lib/parseVatSlots.js';
9
9
  import { insistVatID } from '../../lib/id.js';
10
+ import { insistCapData } from '../../lib/capdata.js';
10
11
  import { kdebug } from '../../lib/kdebug.js';
11
12
  import {
12
13
  parseReachableAndVatSlot,
@@ -173,6 +174,35 @@ export function makeVatKeeper(
173
174
  return harden(options);
174
175
  }
175
176
 
177
+ /**
178
+ * @param {SwingSetCapData} newVPCD
179
+ */
180
+ function setVatParameters(newVPCD) {
181
+ insistCapData(newVPCD);
182
+ const key = `${vatID}.vatParameters`;
183
+ // increment-before-decrement to minimize spurious rc=0 checks
184
+ for (const kref of newVPCD.slots) {
185
+ incrementRefCount(kref, `${vatID}.vatParameters`);
186
+ }
187
+ const old = kvStore.get(key) || '{"slots":[]}';
188
+ for (const kref of JSON.parse(old).slots) {
189
+ decrementRefCount(kref, `${vatID}.vatParameters`);
190
+ }
191
+ kvStore.set(key, JSON.stringify(newVPCD));
192
+ }
193
+
194
+ /**
195
+ * @returns {SwingSetCapData | undefined} vpcd
196
+ */
197
+ function getVatParameters() {
198
+ const key = `${vatID}.vatParameters`;
199
+ const old = kvStore.get(key);
200
+ if (old) {
201
+ return JSON.parse(old);
202
+ }
203
+ return undefined;
204
+ }
205
+
176
206
  // This is named "addDirt" because it should increment all dirt
177
207
  // counters (both for reap/BOYD and for heap snapshotting). We don't
178
208
  // have `heapSnapshotDirt` yet, but when we do, it should get
@@ -768,6 +798,8 @@ export function makeVatKeeper(
768
798
  setSourceAndOptions,
769
799
  getSourceAndOptions,
770
800
  getOptions,
801
+ setVatParameters,
802
+ getVatParameters,
771
803
  addDirt,
772
804
  getReapDirt,
773
805
  clearReapDirt,