@agoric/swingset-vat 0.32.3-dev-17c73b7.0 → 0.32.3-dev-074c43c.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-17c73b7.0+17c73b7",
3
+ "version": "0.32.3-dev-074c43c.0+074c43c",
4
4
  "description": "Vat/Container Launcher",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -27,18 +27,18 @@
27
27
  "@types/yargs-parser": "^21.0.0"
28
28
  },
29
29
  "dependencies": {
30
- "@agoric/internal": "0.3.3-dev-17c73b7.0+17c73b7",
31
- "@agoric/kmarshal": "0.1.1-dev-17c73b7.0+17c73b7",
32
- "@agoric/store": "0.9.3-dev-17c73b7.0+17c73b7",
33
- "@agoric/swing-store": "0.9.2-dev-17c73b7.0+17c73b7",
34
- "@agoric/swingset-liveslots": "0.10.3-dev-17c73b7.0+17c73b7",
35
- "@agoric/swingset-xsnap-supervisor": "0.10.3-dev-17c73b7.0+17c73b7",
36
- "@agoric/time": "0.3.3-dev-17c73b7.0+17c73b7",
37
- "@agoric/vat-data": "0.5.3-dev-17c73b7.0+17c73b7",
38
- "@agoric/xsnap": "0.14.3-dev-17c73b7.0+17c73b7",
39
- "@agoric/xsnap-lockdown": "0.14.1-dev-17c73b7.0+17c73b7",
30
+ "@agoric/internal": "0.3.3-dev-074c43c.0+074c43c",
31
+ "@agoric/kmarshal": "0.1.1-dev-074c43c.0+074c43c",
32
+ "@agoric/store": "0.9.3-dev-074c43c.0+074c43c",
33
+ "@agoric/swing-store": "0.9.2-dev-074c43c.0+074c43c",
34
+ "@agoric/swingset-liveslots": "0.10.3-dev-074c43c.0+074c43c",
35
+ "@agoric/swingset-xsnap-supervisor": "0.10.3-dev-074c43c.0+074c43c",
36
+ "@agoric/time": "0.3.3-dev-074c43c.0+074c43c",
37
+ "@agoric/vat-data": "0.5.3-dev-074c43c.0+074c43c",
38
+ "@agoric/xsnap": "0.14.3-dev-074c43c.0+074c43c",
39
+ "@agoric/xsnap-lockdown": "0.14.1-dev-074c43c.0+074c43c",
40
40
  "@endo/base64": "^1.0.6",
41
- "@endo/bundle-source": "^3.3.0",
41
+ "@endo/bundle-source": "^3.4.0",
42
42
  "@endo/captp": "^4.2.2",
43
43
  "@endo/check-bundle": "^1.0.8",
44
44
  "@endo/compartment-mapper": "^1.2.1",
@@ -103,5 +103,5 @@
103
103
  "typeCoverage": {
104
104
  "atLeast": 75.1
105
105
  },
106
- "gitHead": "17c73b7b23d3d58778baab75343ea0e6d99e4d84"
106
+ "gitHead": "074c43c8204f46dbc5179a498b7f004514528296"
107
107
  }
@@ -82,6 +82,7 @@ bundleID before submitting to the kernel), or (temporarily) a full bundle.
82
82
  * @typedef { string } VatID
83
83
  * @typedef { string } UpgradeID
84
84
  * @typedef {{
85
+ * changeOptions: (vatID: string, options: {}) => void;
85
86
  * createMeter: (remaining: bigint, threshold: bigint) => MeterID
86
87
  * createUnlimitedMeter: () => MeterID
87
88
  * addMeterRemaining: (meterID: MeterID, delta: bigint) => void
@@ -89,7 +90,8 @@ bundleID before submitting to the kernel), or (temporarily) a full bundle.
89
90
  * getMeter: (meterID: MeterID) => { remaining: bigint, threshold: bigint }
90
91
  * createByBundle: (bundle: Bundle, options: {}) => VatID
91
92
  * createByBundleID: (bundleID: BundleID, options: {}) => VatID
92
- * upgradeVat: (bundleID: BundleID, vatParameters: {}) => UpgradeID
93
+ * getBundleIDByName: (name: string) => string;
94
+ * upgradeVat: (vatID: string, bundleID: BundleID, _vatParameters: unknown, upgradeMessage: string) => UpgradeID;
93
95
  * terminateWithFailure: (vatID: VatID, reason: {}) => void
94
96
  * getBundleCap: (bundleID: BundleID) => BundleCap
95
97
  * getNamedBundleCap: (name: string) => BundleCap
@@ -18,6 +18,12 @@ import {
18
18
  prepareSingleton,
19
19
  } from '@agoric/vat-data';
20
20
 
21
+ /**
22
+ * @import {VatAdminRootDeviceNode} from '../../devices/vat-admin/device-vat-admin.js';
23
+ * @import {DProxy} from'../plugin-manager.js';
24
+ * @import {Baggage} from '@agoric/vat-data';
25
+ */
26
+
21
27
  const managerTypes = ['local', 'node-subprocess', 'xsnap', 'xs-worker']; // xs-worker is alias
22
28
 
23
29
  function producePRR() {
@@ -25,14 +31,25 @@ function producePRR() {
25
31
  return /** @type {const} */ ([promise, { resolve, reject }]);
26
32
  }
27
33
 
34
+ /**
35
+ * Build root object of the bootstrap vat.
36
+ *
37
+ * @param {VatPowers & {
38
+ * D: DProxy;
39
+ * }} vatPowers
40
+ * @param {never} _vatParameters
41
+ * @param {Baggage} baggage
42
+ */
28
43
  export function buildRootObject(vatPowers, _vatParameters, baggage) {
29
44
  const criticalVatKey = prepareSingleton(baggage, 'criticalVatKey', {});
30
45
 
31
46
  const { D } = vatPowers;
32
47
  const pendingVatCreations = new Map(); // vatID -> { resolve, reject } for promise
33
- const pendingBundles = new Map(); // bundleID -> Promise<BundleCap>
48
+ /** @type {Map<BundleID, PromiseKit<BundleCap>>} */
49
+ const pendingBundles = new Map();
34
50
  const pendingUpgrades = new Map(); // upgradeID -> Promise<UpgradeResults>
35
51
 
52
+ /** @type {import('../plugin-manager.js').Device<VatAdminRootDeviceNode>} */
36
53
  let vatAdminDev;
37
54
 
38
55
  const runningVats = new Map(); // vatID -> [doneP, { resolve, reject }]
@@ -200,7 +217,7 @@ export function buildRootObject(vatPowers, _vatParameters, baggage) {
200
217
  console.log(`bundle ${bundleID} missing, hoping for reinstall`);
201
218
  return;
202
219
  }
203
- pendingBundles.get(bundleID).resolve(bundlecap);
220
+ pendingBundles.get(bundleID)?.resolve(bundlecap);
204
221
  pendingBundles.delete(bundleID);
205
222
  checkForQuiescence();
206
223
  }
@@ -418,8 +435,9 @@ export function buildRootObject(vatPowers, _vatParameters, baggage) {
418
435
  if (!pendingBundles.has(bundleID)) {
419
436
  pendingBundles.set(bundleID, makePromiseKit());
420
437
  }
421
- return pendingBundles.get(bundleID).promise;
438
+ return pendingBundles.get(bundleID)?.promise;
422
439
  },
440
+ /** @type {(bundleID: BundleID) => BundleCap} */
423
441
  getBundleCap(bundleID) {
424
442
  const bundlecap = D(vatAdminDev).getBundleCap(bundleID);
425
443
  if (bundlecap) {