@agoric/swingset-vat 0.32.3-dev-1c730f2.0 → 0.32.3-dev-26cd420.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 +12 -12
- package/src/devices/bridge/device-bridge.js +2 -0
- package/src/devices/timer/device-timer.js +2 -0
- package/src/types-external.js +7 -0
- package/src/vats/plugin-manager.js +2 -7
- package/src/vats/timer/vat-timer.js +12 -5
- package/src/vats/vat-admin/vat-vat-admin.js +2 -2
- package/tools/manual-timer.js +2 -0
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-26cd420.0+26cd420",
|
|
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-26cd420.0+26cd420",
|
|
31
|
+
"@agoric/kmarshal": "0.1.1-dev-26cd420.0+26cd420",
|
|
32
|
+
"@agoric/store": "0.9.3-dev-26cd420.0+26cd420",
|
|
33
|
+
"@agoric/swing-store": "0.9.2-dev-26cd420.0+26cd420",
|
|
34
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-26cd420.0+26cd420",
|
|
35
|
+
"@agoric/swingset-xsnap-supervisor": "0.10.3-dev-26cd420.0+26cd420",
|
|
36
|
+
"@agoric/time": "0.3.3-dev-26cd420.0+26cd420",
|
|
37
|
+
"@agoric/vat-data": "0.5.3-dev-26cd420.0+26cd420",
|
|
38
|
+
"@agoric/xsnap-lockdown": "0.14.1-dev-26cd420.0+26cd420",
|
|
39
39
|
"@endo/base64": "^1.0.9",
|
|
40
40
|
"@endo/bundle-source": "^4.0.0",
|
|
41
41
|
"@endo/captp": "^4.4.5",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"access": "public"
|
|
101
101
|
},
|
|
102
102
|
"typeCoverage": {
|
|
103
|
-
"atLeast": 76.
|
|
103
|
+
"atLeast": 76.47
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "26cd420bec244f459c724a5ca83316c2ecc0187e"
|
|
106
106
|
}
|
|
@@ -223,6 +223,7 @@ export function buildRootDeviceNode(tools) {
|
|
|
223
223
|
// The latest time poll() was called. This might be a block height or it
|
|
224
224
|
// might be a time from Date.now(). The current time is not reflected back
|
|
225
225
|
// to the user.
|
|
226
|
+
/** @type {bigint} */
|
|
226
227
|
let lastPolled = restart ? restart.lastPolled : 0n;
|
|
227
228
|
let nextRepeater = restart ? restart.nextRepeater : 0;
|
|
228
229
|
|
|
@@ -311,6 +312,7 @@ export function buildRootDeviceNode(tools) {
|
|
|
311
312
|
},
|
|
312
313
|
});
|
|
313
314
|
}
|
|
315
|
+
/** @typedef {import('../../types-external.js').Device<ReturnType<typeof buildRootDeviceNode>>} TimerDevice */
|
|
314
316
|
|
|
315
317
|
// exported for testing. Only buildRootDeviceNode is intended for production
|
|
316
318
|
// use.
|
package/src/types-external.js
CHANGED
|
@@ -12,6 +12,13 @@ export {};
|
|
|
12
12
|
* includes standard services which user-provided vat code might interact
|
|
13
13
|
* with, like VatAdminService. */
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* @template T
|
|
17
|
+
* @typedef {'Device' & { __deviceType__: T }} Device
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/** @typedef {<T>(target: Device<T>) => T} DProxy (approximately) */
|
|
21
|
+
|
|
15
22
|
/**
|
|
16
23
|
* @typedef {(extraProps?: SlogDurationProps) => void} FinishSlogDuration
|
|
17
24
|
*/
|
|
@@ -7,6 +7,8 @@ import { Far, E } from '@endo/far';
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @import {ERef} from '@endo/far';
|
|
10
|
+
* @import {MapStore} from '@agoric/store';
|
|
11
|
+
* @import {Device, DProxy} from '@agoric/swingset-vat/src/types-external.js';
|
|
10
12
|
*/
|
|
11
13
|
|
|
12
14
|
/** @type {{ onReset: (firstTime: Promise<boolean>) => void}} */
|
|
@@ -15,13 +17,6 @@ const DEFAULT_RESETTER = Far('resetter', { onReset: _ => {} });
|
|
|
15
17
|
/** @type {{ walk: (pluginRootP: any) => any }} */
|
|
16
18
|
const DEFAULT_WALKER = Far('walker', { walk: pluginRootP => pluginRootP });
|
|
17
19
|
|
|
18
|
-
/**
|
|
19
|
-
* @template T
|
|
20
|
-
* @typedef {'Device' & { __deviceType__: T }} Device
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
/** @typedef {<T>(target: Device<T>) => T} DProxy (approximately) */
|
|
24
|
-
|
|
25
20
|
/**
|
|
26
21
|
* @callback LoadPlugin
|
|
27
22
|
* @param {string} specifier
|
|
@@ -15,9 +15,11 @@ import { TimeMath } from '@agoric/time';
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* @import {LegacyWeakMap, WeakMapStore} from '@agoric/store';
|
|
18
|
-
* @import {MapStore} from '@agoric/swingset-liveslots';
|
|
18
|
+
* @import {Baggage, MapStore} from '@agoric/swingset-liveslots';
|
|
19
19
|
* @import {Passable, RemotableObject} from '@endo/pass-style';
|
|
20
20
|
* @import {Key} from '@endo/patterns';
|
|
21
|
+
* @import {TimerDevice} from '../../devices/timer/device-timer.js';
|
|
22
|
+
* @import {DProxy} from '../../types-external.js';
|
|
21
23
|
*/
|
|
22
24
|
|
|
23
25
|
// This consumes O(N) RAM only for outstanding promises, via wakeAt(),
|
|
@@ -237,9 +239,17 @@ const measureInterval = (start, interval, now) => {
|
|
|
237
239
|
return { latest, next };
|
|
238
240
|
};
|
|
239
241
|
|
|
242
|
+
/**
|
|
243
|
+
* @param {{
|
|
244
|
+
* D: DProxy;
|
|
245
|
+
* }} vatPowers
|
|
246
|
+
* @param {{}} _vatParameters
|
|
247
|
+
* @param {Baggage} baggage
|
|
248
|
+
*/
|
|
240
249
|
export const buildRootObject = (vatPowers, _vatParameters, baggage) => {
|
|
241
250
|
const { D } = vatPowers;
|
|
242
251
|
|
|
252
|
+
/** @type {TimerDevice} */
|
|
243
253
|
let timerDevice;
|
|
244
254
|
const insistDevice = () => {
|
|
245
255
|
assert(timerDevice, 'TimerService used before createTimerService()');
|
|
@@ -455,9 +465,6 @@ export const buildRootObject = (vatPowers, _vatParameters, baggage) => {
|
|
|
455
465
|
},
|
|
456
466
|
};
|
|
457
467
|
|
|
458
|
-
/**
|
|
459
|
-
* @returns { PromiseEvent }
|
|
460
|
-
*/
|
|
461
468
|
const makePromiseEvent = prepareKind(
|
|
462
469
|
baggage,
|
|
463
470
|
'promiseEvent',
|
|
@@ -948,7 +955,7 @@ export const buildRootObject = (vatPowers, _vatParameters, baggage) => {
|
|
|
948
955
|
* device, but we don't prohibit it from being called again (to
|
|
949
956
|
* replace the device), just in case that's useful someday
|
|
950
957
|
*
|
|
951
|
-
* @param {
|
|
958
|
+
* @param {TimerDevice} timerNode
|
|
952
959
|
* @returns {TimerService}
|
|
953
960
|
*/
|
|
954
961
|
const createTimerService = timerNode => {
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* @import {VatAdminRootDeviceNode} from '../../devices/vat-admin/device-vat-admin.js';
|
|
23
|
-
* @import {DProxy} from'
|
|
23
|
+
* @import {DProxy} from'../../types-external.js';
|
|
24
24
|
* @import {Baggage} from '@agoric/vat-data';
|
|
25
25
|
*/
|
|
26
26
|
|
|
@@ -49,7 +49,7 @@ export function buildRootObject(vatPowers, _vatParameters, baggage) {
|
|
|
49
49
|
const pendingBundles = new Map();
|
|
50
50
|
const pendingUpgrades = new Map(); // upgradeID -> Promise<UpgradeResults>
|
|
51
51
|
|
|
52
|
-
/** @type {import('
|
|
52
|
+
/** @type {import('../../types-external.js').Device<VatAdminRootDeviceNode>} */
|
|
53
53
|
let vatAdminDev;
|
|
54
54
|
|
|
55
55
|
const runningVats = new Map(); // vatID -> [doneP, { resolve, reject }]
|
package/tools/manual-timer.js
CHANGED
|
@@ -34,6 +34,7 @@ const setup = callbacks => {
|
|
|
34
34
|
currentWakeup: undefined,
|
|
35
35
|
currentHandler: undefined,
|
|
36
36
|
};
|
|
37
|
+
/** @type {any} */
|
|
37
38
|
const deviceMarker = harden({});
|
|
38
39
|
const timerDeviceFuncs = harden({
|
|
39
40
|
getLastPolled: () => state.now,
|
|
@@ -54,6 +55,7 @@ const setup = callbacks => {
|
|
|
54
55
|
state.currentHandler = undefined;
|
|
55
56
|
},
|
|
56
57
|
});
|
|
58
|
+
/** @type {any} */
|
|
57
59
|
const D = node => {
|
|
58
60
|
assert.equal(node, deviceMarker, 'fake D only supports devices.timer');
|
|
59
61
|
return timerDeviceFuncs;
|