@agoric/swingset-vat 0.32.3-dev-cbec0c6.0 → 0.32.3-dev-3573f79.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 +13 -12
- package/src/controller/controller.js +10 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/swingset-vat",
|
|
3
|
-
"version": "0.32.3-dev-
|
|
3
|
+
"version": "0.32.3-dev-3573f79.0+3573f79",
|
|
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/assert": "0.6.1-dev-
|
|
31
|
-
"@agoric/internal": "0.3.3-dev-
|
|
32
|
-
"@agoric/store": "0.9.3-dev-
|
|
33
|
-
"@agoric/swing-store": "0.9.2-dev-
|
|
34
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
35
|
-
"@agoric/swingset-xsnap-supervisor": "0.10.3-dev-
|
|
36
|
-
"@agoric/time": "0.3.3-dev-
|
|
37
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
38
|
-
"@agoric/xsnap": "0.14.3-dev-
|
|
39
|
-
"@agoric/xsnap-lockdown": "0.14.1-dev-
|
|
30
|
+
"@agoric/assert": "0.6.1-dev-3573f79.0+3573f79",
|
|
31
|
+
"@agoric/internal": "0.3.3-dev-3573f79.0+3573f79",
|
|
32
|
+
"@agoric/store": "0.9.3-dev-3573f79.0+3573f79",
|
|
33
|
+
"@agoric/swing-store": "0.9.2-dev-3573f79.0+3573f79",
|
|
34
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-3573f79.0+3573f79",
|
|
35
|
+
"@agoric/swingset-xsnap-supervisor": "0.10.3-dev-3573f79.0+3573f79",
|
|
36
|
+
"@agoric/time": "0.3.3-dev-3573f79.0+3573f79",
|
|
37
|
+
"@agoric/vat-data": "0.5.3-dev-3573f79.0+3573f79",
|
|
38
|
+
"@agoric/xsnap": "0.14.3-dev-3573f79.0+3573f79",
|
|
39
|
+
"@agoric/xsnap-lockdown": "0.14.1-dev-3573f79.0+3573f79",
|
|
40
40
|
"@endo/base64": "^0.2.32",
|
|
41
41
|
"@endo/bundle-source": "^2.5.2",
|
|
42
42
|
"@endo/captp": "^3.1.2",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"@endo/init": "^0.5.57",
|
|
49
49
|
"@endo/marshal": "^0.8.6",
|
|
50
50
|
"@endo/nat": "^4.1.28",
|
|
51
|
+
"@endo/patterns": "^0.2.3",
|
|
51
52
|
"@endo/promise-kit": "^0.2.57",
|
|
52
53
|
"@endo/ses-ava": "^0.2.41",
|
|
53
54
|
"@endo/zip": "^0.2.32",
|
|
@@ -93,5 +94,5 @@
|
|
|
93
94
|
"publishConfig": {
|
|
94
95
|
"access": "public"
|
|
95
96
|
},
|
|
96
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "3573f7960954eb22458f812066adcb0888e74363"
|
|
97
98
|
}
|
|
@@ -10,10 +10,11 @@ import { tmpName } from 'tmp';
|
|
|
10
10
|
import anylogger from 'anylogger';
|
|
11
11
|
import microtime from 'microtime';
|
|
12
12
|
|
|
13
|
-
import { assert, Fail
|
|
13
|
+
import { assert, Fail } from '@agoric/assert';
|
|
14
14
|
import { importBundle } from '@endo/import-bundle';
|
|
15
15
|
import { initSwingStore } from '@agoric/swing-store';
|
|
16
16
|
|
|
17
|
+
import { mustMatch, M } from '@endo/patterns';
|
|
17
18
|
import { checkBundle } from '@endo/check-bundle/lite.js';
|
|
18
19
|
import engineGC from '@agoric/internal/src/lib-nodejs/engine-gc.js';
|
|
19
20
|
import { startSubprocessWorker } from '@agoric/internal/src/lib-nodejs/spawnSubprocessWorker.js';
|
|
@@ -33,6 +34,12 @@ import {
|
|
|
33
34
|
import { makeStartXSnap } from './startXSnap.js';
|
|
34
35
|
import { makeStartSubprocessWorkerNode } from './startNodeSubprocess.js';
|
|
35
36
|
|
|
37
|
+
const endoZipBase64Sha512Shape = harden({
|
|
38
|
+
moduleFormat: 'endoZipBase64',
|
|
39
|
+
endoZipBase64: M.string(harden({ stringLengthLimit: Infinity })),
|
|
40
|
+
endoZipBase64Sha512: M.string(),
|
|
41
|
+
});
|
|
42
|
+
|
|
36
43
|
/** @param {Uint8Array} bytes */
|
|
37
44
|
export function computeSha512(bytes) {
|
|
38
45
|
const hash = crypto.createHash('sha512');
|
|
@@ -258,21 +265,11 @@ export async function makeSwingsetController(
|
|
|
258
265
|
* @param {BundleID} [allegedBundleID]
|
|
259
266
|
* @returns {Promise<BundleID>}
|
|
260
267
|
*/
|
|
261
|
-
async function validateAndInstallBundle(bundle, allegedBundleID) {
|
|
268
|
+
async function validateAndInstallBundle(bundle, allegedBundleID = undefined) {
|
|
262
269
|
// TODO The following assertion may be removed when checkBundle subsumes
|
|
263
270
|
// the responsibility to verify the permanence of a bundle's properties.
|
|
264
271
|
// https://github.com/endojs/endo/issues/1106
|
|
265
|
-
|
|
266
|
-
Object.values(Object.getOwnPropertyDescriptors(bundle)).every(
|
|
267
|
-
({ value, get, writable, configurable }) =>
|
|
268
|
-
typeof value === 'string' &&
|
|
269
|
-
get === undefined &&
|
|
270
|
-
// @ts-ignore `isFake` purposely omitted from type
|
|
271
|
-
(harden.isFake || (writable === false && configurable === false)),
|
|
272
|
-
) ||
|
|
273
|
-
Fail`Bundle with alleged ID ${q(
|
|
274
|
-
allegedBundleID,
|
|
275
|
-
)} must be a frozen object with only string value properties, no accessors`;
|
|
272
|
+
mustMatch(bundle, endoZipBase64Sha512Shape);
|
|
276
273
|
await checkBundle(bundle, computeSha512, allegedBundleID);
|
|
277
274
|
const { endoZipBase64Sha512 } = bundle;
|
|
278
275
|
assert.typeof(endoZipBase64Sha512, 'string');
|