@agoric/swingset-vat 0.32.3-dev-4989f26.0 → 0.32.3-dev-779b73d.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-4989f26.0+4989f26",
3
+ "version": "0.32.3-dev-779b73d.0+779b73d",
4
4
  "description": "Vat/Container Launcher",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -28,16 +28,16 @@
28
28
  "yargs-parser": "^21.1.1"
29
29
  },
30
30
  "dependencies": {
31
- "@agoric/assert": "0.6.1-dev-4989f26.0+4989f26",
32
- "@agoric/internal": "0.3.3-dev-4989f26.0+4989f26",
33
- "@agoric/store": "0.9.3-dev-4989f26.0+4989f26",
34
- "@agoric/swing-store": "0.9.2-dev-4989f26.0+4989f26",
35
- "@agoric/swingset-liveslots": "0.10.3-dev-4989f26.0+4989f26",
36
- "@agoric/swingset-xsnap-supervisor": "0.10.3-dev-4989f26.0+4989f26",
37
- "@agoric/time": "0.3.3-dev-4989f26.0+4989f26",
38
- "@agoric/vat-data": "0.5.3-dev-4989f26.0+4989f26",
39
- "@agoric/xsnap": "0.14.3-dev-4989f26.0+4989f26",
40
- "@agoric/xsnap-lockdown": "0.14.1-dev-4989f26.0+4989f26",
31
+ "@agoric/assert": "0.6.1-dev-779b73d.0+779b73d",
32
+ "@agoric/internal": "0.3.3-dev-779b73d.0+779b73d",
33
+ "@agoric/store": "0.9.3-dev-779b73d.0+779b73d",
34
+ "@agoric/swing-store": "0.9.2-dev-779b73d.0+779b73d",
35
+ "@agoric/swingset-liveslots": "0.10.3-dev-779b73d.0+779b73d",
36
+ "@agoric/swingset-xsnap-supervisor": "0.10.3-dev-779b73d.0+779b73d",
37
+ "@agoric/time": "0.3.3-dev-779b73d.0+779b73d",
38
+ "@agoric/vat-data": "0.5.3-dev-779b73d.0+779b73d",
39
+ "@agoric/xsnap": "0.14.3-dev-779b73d.0+779b73d",
40
+ "@agoric/xsnap-lockdown": "0.14.1-dev-779b73d.0+779b73d",
41
41
  "@endo/base64": "^0.2.31",
42
42
  "@endo/bundle-source": "^2.5.1",
43
43
  "@endo/captp": "^3.1.1",
@@ -92,5 +92,5 @@
92
92
  "publishConfig": {
93
93
  "access": "public"
94
94
  },
95
- "gitHead": "4989f26753580251326c40fd6a7a7e3b853aff01"
95
+ "gitHead": "779b73d11992c1e00cfe99bfe3444081107a34a1"
96
96
  }
@@ -168,7 +168,7 @@ export async function makeSwingsetController(
168
168
  writeSlogObject({ type: 'kernel-init-start' });
169
169
 
170
170
  writeSlogObject({ type: 'bundle-kernel-start' });
171
- // eslint-disable-next-line @jessie.js/no-nested-await
171
+ await null;
172
172
  const { kernelBundle = await buildKernelBundle() } = runtimeOptions;
173
173
  writeSlogObject({ type: 'bundle-kernel-finish' });
174
174
 
@@ -473,8 +473,8 @@ export async function buildVatController(
473
473
  };
474
474
  const initializationOptions = { verbose, kernelBundles };
475
475
  let bootstrapResult;
476
+ await null;
476
477
  if (!swingsetIsInitialized(kernelStorage)) {
477
- // eslint-disable-next-line @jessie.js/no-nested-await
478
478
  bootstrapResult = await initializeSwingset(
479
479
  config,
480
480
  argv,
@@ -63,6 +63,7 @@ export async function initializeKernel(config, kernelStorage, options = {}) {
63
63
  let gotVatAdminRootKref;
64
64
 
65
65
  // generate the genesis vats
66
+ await null;
66
67
  if (config.vats) {
67
68
  for (const name of Object.keys(config.vats)) {
68
69
  const {
@@ -91,7 +92,6 @@ export async function initializeKernel(config, kernelStorage, options = {}) {
91
92
 
92
93
  const source = { bundleID };
93
94
  const staticOptions = { name, ...creationOptions };
94
- // eslint-disable-next-line @jessie.js/no-nested-await,no-await-in-loop
95
95
  await optionRecorder.recordStatic(vatID, source, staticOptions);
96
96
 
97
97
  kernelKeeper.addToAcceptanceQueue(
@@ -34,9 +34,10 @@ const { keys, values, fromEntries } = Object;
34
34
  * @returns {Promise<Record<string, V>>}
35
35
  * @template V
36
36
  */
37
- const allValues = async obj =>
38
- // eslint-disable-next-line @jessie.js/no-nested-await
39
- fromEntries(zip(keys(obj), await Promise.all(values(obj))));
37
+ const allValues = async obj => {
38
+ const vs = await Promise.all(values(obj));
39
+ return fromEntries(zip(keys(obj), vs));
40
+ };
40
41
 
41
42
  const bundleRelative = rel =>
42
43
  bundleSource(new URL(rel, import.meta.url).pathname);
@@ -172,8 +173,8 @@ export function loadBasedir(basedir, options = {}) {
172
173
  * determined.
173
174
  */
174
175
  async function resolveSpecFromConfig(referrer, specPath) {
176
+ await null;
175
177
  try {
176
- // eslint-disable-next-line @jessie.js/no-nested-await
177
178
  return new URL(await resolveModuleSpecifier(specPath, referrer)).pathname;
178
179
  } catch (e) {
179
180
  if (e.code !== 'MODULE_NOT_FOUND' && e.code !== 'ERR_MODULE_NOT_FOUND') {
@@ -233,15 +234,14 @@ async function normalizeConfigDescriptor(desc, referrer, expectParameters) {
233
234
  * invalid.
234
235
  */
235
236
  export async function loadSwingsetConfigFile(configPath) {
237
+ await null;
236
238
  try {
237
239
  const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
238
240
  const referrer = new URL(
239
241
  configPath,
240
242
  `file:///${process.cwd()}/`,
241
243
  ).toString();
242
- // eslint-disable-next-line @jessie.js/no-nested-await
243
244
  await normalizeConfigDescriptor(config.vats, referrer, true);
244
- // eslint-disable-next-line @jessie.js/no-nested-await
245
245
  await normalizeConfigDescriptor(config.bundles, referrer, false);
246
246
  // await normalizeConfigDescriptor(config.devices, referrer, true); // TODO: represent devices
247
247
  config.bootstrap || Fail`no designated bootstrap vat in ${configPath}`;
@@ -138,8 +138,8 @@ export function makeStartXSnap(options) {
138
138
  ) {
139
139
  const meterOpts = metered ? {} : { meteringLimit: 0 };
140
140
  const snapshotLoadOpts = getSnapshotLoadOptions(initDetails);
141
+ await null;
141
142
  if (snapshotLoadOpts) {
142
- // eslint-disable-next-line @jessie.js/no-nested-await
143
143
  const xs = await doXSnap({
144
144
  name,
145
145
  handleCommand,
@@ -147,7 +147,6 @@ export function makeStartXSnap(options) {
147
147
  ...meterOpts,
148
148
  ...xsnapOpts,
149
149
  });
150
- // eslint-disable-next-line @jessie.js/no-nested-await
151
150
  await xs.isReady();
152
151
  return xs;
153
152
  }
@@ -164,7 +163,6 @@ export function makeStartXSnap(options) {
164
163
  bundles = overrideBundles; // ignore the usual bundles
165
164
  } else {
166
165
  const bundlePs = bundleIDs.map(id => bundleHandler.getBundle(id));
167
- // eslint-disable-next-line @jessie.js/no-nested-await
168
166
  bundles = await Promise.all(bundlePs);
169
167
  }
170
168
 
@@ -173,7 +171,6 @@ export function makeStartXSnap(options) {
173
171
  if (moduleFormat !== 'getExport' && moduleFormat !== 'nestedEvaluate') {
174
172
  throw Fail`unexpected moduleFormat: ${moduleFormat}`;
175
173
  }
176
- // eslint-disable-next-line no-await-in-loop, @jessie.js/no-nested-await
177
174
  await worker.evaluate(`(${bundle.source}\n)()`.trim());
178
175
  }
179
176
  return worker;
@@ -397,9 +397,9 @@ export default function buildKernel(
397
397
  assert(vatWarehouse.lookup(vatID));
398
398
  // Ensure that the vatSlogger is available before clist translation.
399
399
  const vs = kernelSlog.provideVatSlogger(vatID).vatSlog;
400
+ await null;
400
401
  try {
401
402
  /** @type { VatDeliveryResult } */
402
- // eslint-disable-next-line @jessie.js/no-nested-await
403
403
  const deliveryResult = await vatWarehouse.deliverToVat(vatID, kd, vd, vs);
404
404
  insistVatDeliveryResult(deliveryResult);
405
405
  // const [ ok, problem, usage ] = deliveryResult;
@@ -424,7 +424,6 @@ export default function buildKernel(
424
424
  // Kinds, and we're not going to use the worker
425
425
  //
426
426
  // So in all cases, our caller should abandon the worker.
427
- // eslint-disable-next-line @jessie.js/no-nested-await
428
427
  await vatWarehouse.stopWorker(vatID);
429
428
  // TODO: does stopWorker work if the worker process just died?
430
429
  status.deliveryError = deliveryResult[1];
@@ -696,7 +695,6 @@ export default function buildKernel(
696
695
  // supervisor bundles are bad.
697
696
 
698
697
  try {
699
- // eslint-disable-next-line @jessie.js/no-nested-await
700
698
  await vatWarehouse.createDynamicVat(vatID);
701
699
  } catch (err) {
702
700
  console.log('error during createDynamicVat', err);
@@ -834,7 +832,6 @@ export default function buildKernel(
834
832
  const abortUpgrade = async (badDeliveryResults, errorCapData) => {
835
833
  // get rid of the worker, so the next delivery to this vat will
836
834
  // re-create one from the previous state
837
- // eslint-disable-next-line @jessie.js/no-nested-await
838
835
  await vatWarehouse.stopWorker(vatID);
839
836
 
840
837
  // notify vat-admin of the failed upgrade without revealing error details
@@ -897,7 +894,6 @@ export default function buildKernel(
897
894
  `WARNING: vat ${vatID} failed to upgrade from incarnation ${oldIncarnation} (BOYD)`,
898
895
  );
899
896
  const { info: errorCapData } = boydResults.terminate;
900
- // eslint-disable-next-line @jessie.js/no-nested-await
901
897
  const results = await abortUpgrade(boydResults, errorCapData);
902
898
  return results;
903
899
  }
@@ -961,7 +957,6 @@ export default function buildKernel(
961
957
  `WARNING: vat ${vatID} failed to upgrade from incarnation ${oldIncarnation} (startVat)`,
962
958
  );
963
959
  const { info: errorCapData } = startVatResults.terminate;
964
- // eslint-disable-next-line @jessie.js/no-nested-await
965
960
  const results = await abortUpgrade(startVatResults, errorCapData);
966
961
  return results;
967
962
  }
@@ -1279,7 +1274,6 @@ export default function buildKernel(
1279
1274
  } else {
1280
1275
  const vatID = crankResults.didDelivery;
1281
1276
  if (vatID) {
1282
- // eslint-disable-next-line @jessie.js/no-nested-await
1283
1277
  await vatWarehouse.maybeSaveSnapshot(vatID);
1284
1278
  }
1285
1279
  }
@@ -1312,7 +1306,6 @@ export default function buildKernel(
1312
1306
  kdebug(`vat terminated: ${JSON.stringify(info)}`);
1313
1307
  kernelSlog.terminateVat(vatID, reject, info);
1314
1308
  // this deletes state, rejects promises, notifies vat-admin
1315
- // eslint-disable-next-line @jessie.js/no-nested-await
1316
1309
  await terminateVat(vatID, reject, info);
1317
1310
  }
1318
1311
 
@@ -1348,8 +1341,8 @@ export default function buildKernel(
1348
1341
  Fail`Kernel reentrancy is forbidden`;
1349
1342
  }
1350
1343
  processQueueRunning = Error('here');
1344
+ await null;
1351
1345
  try {
1352
- // eslint-disable-next-line @jessie.js/no-nested-await
1353
1346
  const result = await processor(message);
1354
1347
  processQueueRunning = undefined;
1355
1348
  return result;
@@ -1650,7 +1643,6 @@ export default function buildKernel(
1650
1643
 
1651
1644
  const bundle = kernelKeeper.getBundle(source.bundleID);
1652
1645
  assert(bundle);
1653
- // eslint-disable-next-line no-await-in-loop, @jessie.js/no-nested-await
1654
1646
  const NS = await importBundle(bundle, {
1655
1647
  filePrefix: `dev-${name}/...`,
1656
1648
  endowments: harden({ ...vatEndowments, console: devConsole, assert }),
@@ -1762,12 +1754,12 @@ export default function buildKernel(
1762
1754
  throw Error('must do kernel.start() before step()');
1763
1755
  }
1764
1756
  kernelKeeper.startCrank();
1757
+ await null;
1765
1758
  try {
1766
1759
  kernelKeeper.establishCrankSavepoint('start');
1767
1760
  const { processor, message } = getNextMessageAndProcessor();
1768
1761
  // process a single message
1769
1762
  if (message) {
1770
- // eslint-disable-next-line @jessie.js/no-nested-await
1771
1763
  await tryProcessMessage(processor, message);
1772
1764
  if (kernelPanic) {
1773
1765
  throw kernelPanic;
@@ -1796,6 +1788,7 @@ export default function buildKernel(
1796
1788
  throw Error('must do kernel.start() before run()');
1797
1789
  }
1798
1790
  let count = 0;
1791
+ await null;
1799
1792
  for (;;) {
1800
1793
  kernelKeeper.startCrank();
1801
1794
  try {
@@ -1806,7 +1799,6 @@ export default function buildKernel(
1806
1799
  }
1807
1800
  count += 1;
1808
1801
  /** @type { PolicyInput } */
1809
- // eslint-disable-next-line no-await-in-loop, @jessie.js/no-nested-await
1810
1802
  const policyInput = await tryProcessMessage(processor, message);
1811
1803
  if (kernelPanic) {
1812
1804
  throw kernelPanic;
@@ -93,8 +93,8 @@ export function makeLocalVatManagerFactory({
93
93
  return vatNS;
94
94
  }
95
95
 
96
+ await null;
96
97
  if (enableSetup) {
97
- // eslint-disable-next-line @jessie.js/no-nested-await
98
98
  const vatNS = await buildVatNamespace({}, {});
99
99
  const setup = vatNS.default;
100
100
  setup || Fail`vat source bundle lacks (default) setup() function`;
@@ -165,7 +165,6 @@ export function makeXsSubprocessFactory({
165
165
  parentLog(vatID, `snapshot loaded. dispatch ready.`);
166
166
  } else {
167
167
  parentLog(vatID, `instructing worker to load bundle..`);
168
- // eslint-disable-next-line @jessie.js/no-nested-await
169
168
  const { reply: bundleReply } = await issueTagged([
170
169
  'setBundle',
171
170
  vatID,
@@ -188,8 +187,8 @@ export function makeXsSubprocessFactory({
188
187
  parentLog(vatID, `sending delivery`, delivery);
189
188
  /** @type { WorkerResults } */
190
189
  let result;
190
+ await null;
191
191
  try {
192
- // eslint-disable-next-line @jessie.js/no-nested-await
193
192
  result = await issueTagged(['deliver', delivery]);
194
193
  } catch (err) {
195
194
  parentLog('issueTagged error:', err.code, err.message);
@@ -371,7 +371,6 @@ export function makeVatWarehouse({
371
371
  const { enablePipelining = false } = options;
372
372
 
373
373
  if (options.useTranscript) {
374
- // eslint-disable-next-line @jessie.js/no-nested-await
375
374
  await replayTranscript(vatID, vatKeeper, manager);
376
375
  }
377
376
 
@@ -419,7 +418,6 @@ export function makeVatWarehouse({
419
418
  break;
420
419
  }
421
420
  logStartup(`provideVatKeeper for vat ${name} as vat ${vatID}`);
422
- // eslint-disable-next-line no-await-in-loop
423
421
  await ensureVatOnline(vatID, recreate);
424
422
  numPreloaded += 1;
425
423
  }
@@ -431,7 +429,6 @@ export function makeVatWarehouse({
431
429
  break;
432
430
  }
433
431
  logStartup(`provideVatKeeper for dynamic vat ${vatID}`);
434
- // eslint-disable-next-line no-await-in-loop
435
432
  await ensureVatOnline(vatID, recreate);
436
433
  numPreloaded += 1;
437
434
  }
@@ -668,9 +665,9 @@ export function makeVatWarehouse({
668
665
  */
669
666
  async function stopWorker(vatID) {
670
667
  // worker may or may not be online
668
+ await null;
671
669
  if (ephemeral.vats.has(vatID)) {
672
670
  try {
673
- // eslint-disable-next-line @jessie.js/no-nested-await
674
671
  await evict(vatID);
675
672
  } catch (err) {
676
673
  console.debug('vat termination was already reported; ignoring:', err);
@@ -4,10 +4,10 @@
4
4
  * @returns {Promise<import("../types-internal").WorkerOptions>}
5
5
  */
6
6
  export async function makeWorkerOptions(managerType, bundleHandler) {
7
+ await null;
7
8
  if (managerType === 'local') {
8
9
  return harden({ type: 'local' });
9
10
  } else if (managerType === 'xsnap' || managerType === 'xs-worker') {
10
- // eslint-disable-next-line @jessie.js/no-nested-await, no-await-in-loop
11
11
  const bundleIDs = await bundleHandler.getCurrentBundleIDs();
12
12
  return harden({ type: 'xsnap', bundleIDs });
13
13
  }
@@ -24,10 +24,10 @@ export async function updateWorkerOptions(
24
24
  { bundleHandler },
25
25
  ) {
26
26
  const { type } = origWorkerOptions;
27
+ await null;
27
28
  if (type === 'local') {
28
29
  return origWorkerOptions;
29
30
  } else if (type === 'xsnap') {
30
- // eslint-disable-next-line @jessie.js/no-nested-await, no-await-in-loop
31
31
  const bundleIDs = await bundleHandler.getCurrentBundleIDs();
32
32
  return harden({ ...origWorkerOptions, bundleIDs });
33
33
  }
@@ -228,19 +228,17 @@ export function buildRootObject(vatPowers, _vatParameters, baggage) {
228
228
  }
229
229
 
230
230
  async function upgradeStaticVat(vatID, pauseTarget, bundleID, options) {
231
+ await null;
231
232
  if (pauseTarget) {
232
- // eslint-disable-next-line @jessie.js/no-nested-await
233
233
  await E(pauseTarget)
234
234
  .pauseService()
235
235
  .catch(() => true);
236
236
  }
237
237
  let status;
238
238
  try {
239
- // eslint-disable-next-line @jessie.js/no-nested-await
240
239
  status = await upgradeVat(vatID, bundleID, options);
241
240
  } catch (e) {
242
241
  if (pauseTarget) {
243
- // eslint-disable-next-line @jessie.js/no-nested-await
244
242
  await E(pauseTarget)
245
243
  .resumeService()
246
244
  .catch(() => true);