@agoric/swingset-vat 0.32.3-dev-0303d15.0 → 0.32.3-dev-e393fda.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-0303d15.0+0303d15",
3
+ "version": "0.32.3-dev-e393fda.0+e393fda",
4
4
  "description": "Vat/Container Launcher",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -27,15 +27,15 @@
27
27
  "@types/yargs-parser": "^21.0.0"
28
28
  },
29
29
  "dependencies": {
30
- "@agoric/internal": "0.3.3-dev-0303d15.0+0303d15",
31
- "@agoric/kmarshal": "0.1.1-dev-0303d15.0+0303d15",
32
- "@agoric/store": "0.9.3-dev-0303d15.0+0303d15",
33
- "@agoric/swing-store": "0.9.2-dev-0303d15.0+0303d15",
34
- "@agoric/swingset-liveslots": "0.10.3-dev-0303d15.0+0303d15",
35
- "@agoric/swingset-xsnap-supervisor": "0.10.3-dev-0303d15.0+0303d15",
36
- "@agoric/time": "0.3.3-dev-0303d15.0+0303d15",
37
- "@agoric/vat-data": "0.5.3-dev-0303d15.0+0303d15",
38
- "@agoric/xsnap-lockdown": "0.14.1-dev-0303d15.0+0303d15",
30
+ "@agoric/internal": "0.3.3-dev-e393fda.0+e393fda",
31
+ "@agoric/kmarshal": "0.1.1-dev-e393fda.0+e393fda",
32
+ "@agoric/store": "0.9.3-dev-e393fda.0+e393fda",
33
+ "@agoric/swing-store": "0.9.2-dev-e393fda.0+e393fda",
34
+ "@agoric/swingset-liveslots": "0.10.3-dev-e393fda.0+e393fda",
35
+ "@agoric/swingset-xsnap-supervisor": "0.10.3-dev-e393fda.0+e393fda",
36
+ "@agoric/time": "0.3.3-dev-e393fda.0+e393fda",
37
+ "@agoric/vat-data": "0.5.3-dev-e393fda.0+e393fda",
38
+ "@agoric/xsnap-lockdown": "0.14.1-dev-e393fda.0+e393fda",
39
39
  "@endo/base64": "^1.0.9",
40
40
  "@endo/bundle-source": "^3.5.1",
41
41
  "@endo/captp": "^4.4.4",
@@ -57,7 +57,7 @@
57
57
  "ansi-styles": "^6.2.1",
58
58
  "anylogger": "^0.21.0",
59
59
  "better-sqlite3": "^9.1.1",
60
- "import-meta-resolve": "^2.2.1",
60
+ "import-meta-resolve": "^4.1.0",
61
61
  "microtime": "^3.1.0",
62
62
  "semver": "^6.3.0",
63
63
  "tmp": "^0.2.1",
@@ -102,5 +102,5 @@
102
102
  "typeCoverage": {
103
103
  "atLeast": 76.28
104
104
  },
105
- "gitHead": "0303d15e3238f29fa106e103e54103c2beabc895"
105
+ "gitHead": "e393fda2039f1b32543bf529a846d626319233df"
106
106
  }
@@ -677,13 +677,7 @@ export function makeVatKeeper(
677
677
  restartWorker,
678
678
  );
679
679
 
680
- const {
681
- hash: snapshotID,
682
- uncompressedSize,
683
- dbSaveSeconds,
684
- compressedSize,
685
- compressSeconds,
686
- } = info;
680
+ const { hash: snapshotID } = info;
687
681
 
688
682
  // push a save-snapshot transcript entry
689
683
  addToTranscript(makeSaveSnapshotItem(snapshotID));
@@ -695,18 +689,6 @@ export function makeVatKeeper(
695
689
  // always starts with an initialize-worker or load-snapshot
696
690
  // pseudo-delivery
697
691
  addToTranscript(makeLoadSnapshotItem(snapshotID));
698
-
699
- kernelSlog.write({
700
- type: 'heap-snapshot-save',
701
- vatID,
702
- snapshotID,
703
- uncompressedSize,
704
- dbSaveSeconds,
705
- compressedSize,
706
- compressSeconds,
707
- endPosition,
708
- restartWorker,
709
- });
710
692
  }
711
693
 
712
694
  /**
@@ -128,8 +128,10 @@ export function makeXsSubprocessFactory({
128
128
 
129
129
  const vatKeeper = kernelKeeper.provideVatKeeper(vatID);
130
130
  const snapshotInfo = vatKeeper.getSnapshotInfo();
131
+ let uncompressedSizeLoaded = null;
131
132
  if (snapshotInfo) {
132
133
  kernelSlog.write({ type: 'heap-snapshot-load', vatID, ...snapshotInfo });
134
+ uncompressedSizeLoaded = snapshotInfo.uncompressedSize;
133
135
  }
134
136
 
135
137
  // `startXSnap` adds `nameDisplayArg` as a dummy argument so that 'ps'
@@ -240,9 +242,31 @@ export function makeXsSubprocessFactory({
240
242
  async function makeSnapshot(snapPos, snapStore, restartWorker) {
241
243
  const snapshotDescription = `${vatID}-${snapPos}`;
242
244
  const snapshotStream = worker.makeSnapshotStream(snapshotDescription);
245
+ const saveSnapshot = async saveStream => {
246
+ const results = await snapStore.saveSnapshot(
247
+ vatID,
248
+ snapPos,
249
+ saveStream,
250
+ );
251
+ const { hash: snapshotID, ...metrics } = results;
252
+ const uncompressedSizeDelta =
253
+ uncompressedSizeLoaded &&
254
+ metrics.uncompressedSize - uncompressedSizeLoaded;
255
+ uncompressedSizeLoaded = results.uncompressedSize;
256
+ kernelSlog.write({
257
+ type: 'heap-snapshot-save',
258
+ vatID,
259
+ snapshotID,
260
+ endPosition: snapPos,
261
+ ...metrics,
262
+ uncompressedSizeDelta,
263
+ restartWorker,
264
+ });
265
+ return results;
266
+ };
243
267
 
244
268
  if (!restartWorker) {
245
- return snapStore.saveSnapshot(vatID, snapPos, snapshotStream);
269
+ return saveSnapshot(snapshotStream);
246
270
  }
247
271
 
248
272
  /** @type {AsyncGenerator<Uint8Array, void, void>[]} */
@@ -268,7 +292,7 @@ export function makeXsSubprocessFactory({
268
292
  snapshotDescription,
269
293
  },
270
294
  }),
271
- snapStore.saveSnapshot(vatID, snapPos, snapStoreSaveStream),
295
+ saveSnapshot(snapStoreSaveStream),
272
296
  ]);
273
297
  await closeP;
274
298