@agoric/swingset-vat 0.32.3-dev-987bcf1.0 → 0.32.3-dev-fe64626.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-
|
|
3
|
+
"version": "0.32.3-dev-fe64626.0+fe64626",
|
|
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-
|
|
31
|
-
"@agoric/kmarshal": "0.1.1-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-lockdown": "0.14.1-dev-
|
|
30
|
+
"@agoric/internal": "0.3.3-dev-fe64626.0+fe64626",
|
|
31
|
+
"@agoric/kmarshal": "0.1.1-dev-fe64626.0+fe64626",
|
|
32
|
+
"@agoric/store": "0.9.3-dev-fe64626.0+fe64626",
|
|
33
|
+
"@agoric/swing-store": "0.9.2-dev-fe64626.0+fe64626",
|
|
34
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-fe64626.0+fe64626",
|
|
35
|
+
"@agoric/swingset-xsnap-supervisor": "0.10.3-dev-fe64626.0+fe64626",
|
|
36
|
+
"@agoric/time": "0.3.3-dev-fe64626.0+fe64626",
|
|
37
|
+
"@agoric/vat-data": "0.5.3-dev-fe64626.0+fe64626",
|
|
38
|
+
"@agoric/xsnap-lockdown": "0.14.1-dev-fe64626.0+fe64626",
|
|
39
39
|
"@endo/base64": "^1.0.9",
|
|
40
40
|
"@endo/bundle-source": "^3.5.1",
|
|
41
41
|
"@endo/captp": "^4.4.4",
|
|
@@ -102,5 +102,5 @@
|
|
|
102
102
|
"typeCoverage": {
|
|
103
103
|
"atLeast": 76.28
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "fe64626676ae80ae48d4beee23d2d75f71cf1031"
|
|
106
106
|
}
|
package/src/kernel/kernel.js
CHANGED
|
@@ -9,7 +9,7 @@ import { makeUpgradeDisconnection } from '@agoric/internal/src/upgrade-api.js';
|
|
|
9
9
|
import { kser, kslot, makeError } from '@agoric/kmarshal';
|
|
10
10
|
import { assertKnownOptions } from '../lib/assertOptions.js';
|
|
11
11
|
import { foreverPolicy } from '../lib/runPolicies.js';
|
|
12
|
-
import {
|
|
12
|
+
import { makeVatManagerMaker } from './vat-loader/manager-factory.js';
|
|
13
13
|
import { makeVatWarehouse } from './vat-warehouse.js';
|
|
14
14
|
import makeDeviceManager from './deviceManager.js';
|
|
15
15
|
import makeKernelKeeper, {
|
|
@@ -1557,7 +1557,7 @@ export default function buildKernel(
|
|
|
1557
1557
|
gcAndFinalize,
|
|
1558
1558
|
meterControl: makeDummyMeterControl(),
|
|
1559
1559
|
});
|
|
1560
|
-
const
|
|
1560
|
+
const makeVatManager = makeVatManagerMaker({
|
|
1561
1561
|
allVatPowers,
|
|
1562
1562
|
kernelKeeper,
|
|
1563
1563
|
vatEndowments,
|
|
@@ -1652,7 +1652,7 @@ export default function buildKernel(
|
|
|
1652
1652
|
}
|
|
1653
1653
|
|
|
1654
1654
|
const vatLoader = makeVatLoader({
|
|
1655
|
-
|
|
1655
|
+
makeVatManager,
|
|
1656
1656
|
kernelSlog,
|
|
1657
1657
|
makeSourcedConsole,
|
|
1658
1658
|
kernelKeeper,
|
|
@@ -4,7 +4,7 @@ import { makeLocalVatManagerFactory } from './manager-local.js';
|
|
|
4
4
|
import { makeNodeSubprocessFactory } from './manager-subprocess-node.js';
|
|
5
5
|
import { makeXsSubprocessFactory } from './manager-subprocess-xsnap.js';
|
|
6
6
|
|
|
7
|
-
export function
|
|
7
|
+
export function makeVatManagerMaker({
|
|
8
8
|
allVatPowers,
|
|
9
9
|
kernelKeeper,
|
|
10
10
|
vatEndowments,
|
|
@@ -18,14 +18,12 @@ export function makeVatManagerFactory({
|
|
|
18
18
|
vatEndowments,
|
|
19
19
|
gcTools,
|
|
20
20
|
});
|
|
21
|
-
|
|
22
21
|
const nodeSubprocessFactory = makeNodeSubprocessFactory({
|
|
23
22
|
startSubprocessWorker: startSubprocessWorkerNode,
|
|
24
23
|
kernelKeeper,
|
|
25
24
|
kernelSlog,
|
|
26
25
|
testLog: allVatPowers.testLog,
|
|
27
26
|
});
|
|
28
|
-
|
|
29
27
|
const xsWorkerFactory = makeXsSubprocessFactory({
|
|
30
28
|
startXSnap,
|
|
31
29
|
kernelKeeper,
|
|
@@ -69,58 +67,41 @@ export function makeVatManagerFactory({
|
|
|
69
67
|
* @param {import('@agoric/swingset-liveslots').LiveSlotsOptions} options.liveSlotsOptions
|
|
70
68
|
* @returns { Promise<import('../../types-internal.js').VatManager> }
|
|
71
69
|
*/
|
|
72
|
-
async function
|
|
73
|
-
|
|
74
|
-
{ managerOptions, liveSlotsOptions },
|
|
75
|
-
) {
|
|
70
|
+
async function makeVatManager(vatID, options) {
|
|
71
|
+
const { managerOptions, liveSlotsOptions } = options;
|
|
76
72
|
validateManagerOptions(managerOptions);
|
|
77
73
|
const { workerOptions, enableSetup } = managerOptions;
|
|
78
74
|
const { type } = workerOptions;
|
|
79
75
|
|
|
80
|
-
if (type !== 'local' && 'setup' in managerOptions) {
|
|
81
|
-
console.warn(`TODO: stop using setup() with ${type}`);
|
|
82
|
-
}
|
|
83
|
-
if (enableSetup) {
|
|
84
|
-
if (managerOptions.setup) {
|
|
85
|
-
return localFactory.createFromSetup(vatID, managerOptions);
|
|
86
|
-
} else {
|
|
87
|
-
return localFactory.createFromBundle(
|
|
88
|
-
vatID,
|
|
89
|
-
managerOptions.bundle,
|
|
90
|
-
managerOptions,
|
|
91
|
-
liveSlotsOptions,
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
} else if (type === 'local') {
|
|
95
|
-
return localFactory.createFromBundle(
|
|
96
|
-
vatID,
|
|
97
|
-
managerOptions.bundle,
|
|
98
|
-
managerOptions,
|
|
99
|
-
liveSlotsOptions,
|
|
100
|
-
);
|
|
76
|
+
if (type !== 'local' && (enableSetup || 'setup' in managerOptions)) {
|
|
77
|
+
console.warn(`TODO: stop using enableSetup and setup() with ${type}`);
|
|
101
78
|
}
|
|
102
79
|
|
|
103
|
-
if (
|
|
104
|
-
return
|
|
105
|
-
vatID,
|
|
106
|
-
managerOptions.bundle,
|
|
107
|
-
managerOptions,
|
|
108
|
-
liveSlotsOptions,
|
|
109
|
-
);
|
|
80
|
+
if (enableSetup && managerOptions.setup) {
|
|
81
|
+
return localFactory.createFromSetup(vatID, managerOptions);
|
|
110
82
|
}
|
|
111
83
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
);
|
|
84
|
+
/** @type {Pick<typeof xsWorkerFactory, 'createFromBundle'>} */
|
|
85
|
+
let factory;
|
|
86
|
+
if (enableSetup || type === 'local') {
|
|
87
|
+
factory = localFactory;
|
|
88
|
+
} else if (type === 'node-subprocess') {
|
|
89
|
+
factory = nodeSubprocessFactory;
|
|
90
|
+
} else if (type === 'xsnap') {
|
|
91
|
+
assert(managerOptions.bundle, 'worker type xsnap requires a bundle');
|
|
92
|
+
factory = xsWorkerFactory;
|
|
93
|
+
} else {
|
|
94
|
+
throw Error(`unknown vat worker type ${type}`);
|
|
120
95
|
}
|
|
121
96
|
|
|
122
|
-
|
|
97
|
+
return factory.createFromBundle(
|
|
98
|
+
vatID,
|
|
99
|
+
// @ts-expect-error managerOptions.bundle might be undefined
|
|
100
|
+
managerOptions.bundle,
|
|
101
|
+
managerOptions,
|
|
102
|
+
liveSlotsOptions,
|
|
103
|
+
);
|
|
123
104
|
}
|
|
124
105
|
|
|
125
|
-
return harden(
|
|
106
|
+
return harden(makeVatManager);
|
|
126
107
|
}
|
|
@@ -9,7 +9,7 @@ export function makeVatRootObjectSlot() {
|
|
|
9
9
|
export function makeVatLoader(stuff) {
|
|
10
10
|
const {
|
|
11
11
|
overrideVatManagerOptions = {},
|
|
12
|
-
|
|
12
|
+
makeVatManager,
|
|
13
13
|
kernelSlog,
|
|
14
14
|
makeSourcedConsole,
|
|
15
15
|
kernelKeeper,
|
|
@@ -127,7 +127,7 @@ export function makeVatLoader(stuff) {
|
|
|
127
127
|
};
|
|
128
128
|
|
|
129
129
|
const finish = starting && kernelSlog.startup(vatID);
|
|
130
|
-
const manager = await
|
|
130
|
+
const manager = await makeVatManager(vatID, {
|
|
131
131
|
managerOptions,
|
|
132
132
|
liveSlotsOptions,
|
|
133
133
|
});
|
|
@@ -150,7 +150,7 @@ export function makeVatLoader(stuff) {
|
|
|
150
150
|
...overrideVatManagerOptions,
|
|
151
151
|
};
|
|
152
152
|
const liveSlotsOptions = {};
|
|
153
|
-
const manager = await
|
|
153
|
+
const manager = await makeVatManager(vatID, {
|
|
154
154
|
managerOptions,
|
|
155
155
|
liveSlotsOptions,
|
|
156
156
|
});
|