@agoric/swingset-vat 0.32.3-upgrade-18-dev-6ddbef0.0 → 0.32.3-upgrade-19-dev-c605745.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 +33 -34
- package/src/controller/controller.js +47 -44
- package/src/controller/initializeKernel.js +0 -3
- package/src/controller/initializeSwingset.js +86 -80
- package/src/controller/upgradeSwingset.js +50 -37
- package/src/devices/bridge/device-bridge.js +3 -2
- package/src/devices/lib/deviceTools.js +0 -1
- package/src/index.js +1 -0
- package/src/kernel/kernel.js +7 -10
- package/src/kernel/slogger.js +124 -121
- package/src/kernel/state/kernelKeeper.js +65 -59
- package/src/kernel/state/vatKeeper.js +64 -84
- package/src/kernel/vat-loader/manager-factory.js +26 -45
- package/src/kernel/vat-loader/manager-subprocess-xsnap.js +26 -2
- package/src/kernel/vat-loader/vat-loader.js +3 -3
- package/src/kernel/vat-warehouse.js +22 -16
- package/src/supervisors/subprocess-node/supervisor-subprocess-node.js +1 -0
- package/src/supervisors/supervisor-helper.js +9 -10
- package/src/typeGuards.js +22 -19
- package/src/types-external.js +39 -38
- package/src/types-internal.js +2 -3
- package/src/vats/comms/delivery.js +0 -2
- package/src/vats/comms/state.js +0 -4
- package/src/vats/timer/vat-timer.js +2 -2
- package/src/vats/vat-admin/vat-vat-admin.js +0 -4
- package/tools/baggage-check.js +0 -2
- package/tools/bootstrap-dvo-test.js +0 -1
- package/tools/bootstrap-relay.js +9 -0
- package/tools/bundleTool.js +5 -1
- package/tools/run-utils.js +63 -54
- package/tools/vat-puppet.js +111 -0
|
@@ -97,6 +97,7 @@ export function makeSyscallSimulator(
|
|
|
97
97
|
deliveryNum,
|
|
98
98
|
transcriptEntry,
|
|
99
99
|
) {
|
|
100
|
+
const context = `anachrophobia in ${vatID} delivery d${deliveryNum}`;
|
|
100
101
|
const syscallsExpected = [...transcriptEntry.sc]; // copy
|
|
101
102
|
const syscallsMade = [];
|
|
102
103
|
// syscallStatus's length will be max(syscallsExpected,
|
|
@@ -107,31 +108,36 @@ export function makeSyscallSimulator(
|
|
|
107
108
|
let replayError; // sticky
|
|
108
109
|
|
|
109
110
|
const explain = () => {
|
|
110
|
-
console.log(
|
|
111
|
+
console.log(
|
|
112
|
+
`anachrophobia strikes ${vatID} delivery d${deliveryNum} syscalls`,
|
|
113
|
+
);
|
|
111
114
|
for (const [idx, status] of syscallStatus.entries()) {
|
|
112
115
|
const expected = syscallsExpected[idx];
|
|
113
116
|
const got = syscallsMade[idx];
|
|
114
117
|
switch (status) {
|
|
115
118
|
case 'ok': {
|
|
116
|
-
console.log(`sc
|
|
119
|
+
console.log(`sc${idx}: ok: ${djson.stringify(got)}`);
|
|
117
120
|
break;
|
|
118
121
|
}
|
|
119
122
|
case 'wrong': {
|
|
120
|
-
console.log(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
+
console.log(
|
|
124
|
+
`
|
|
125
|
+
sc${idx}: WRONG
|
|
126
|
+
expected: ${djson.stringify(expected.s)}
|
|
127
|
+
got : ${djson.stringify(got)}`.trimStart(),
|
|
128
|
+
);
|
|
123
129
|
break;
|
|
124
130
|
}
|
|
125
131
|
case 'extra': {
|
|
126
|
-
console.log(`sc
|
|
132
|
+
console.log(`sc${idx}: EXTRA: ${djson.stringify(got)}`);
|
|
127
133
|
break;
|
|
128
134
|
}
|
|
129
135
|
case 'missing': {
|
|
130
|
-
console.log(`sc
|
|
136
|
+
console.log(`sc${idx}: MISSING: ${djson.stringify(expected.s)}`);
|
|
131
137
|
break;
|
|
132
138
|
}
|
|
133
139
|
default:
|
|
134
|
-
Fail`bad ${status}`;
|
|
140
|
+
Fail`sc${idx}: bad status ${status}`;
|
|
135
141
|
}
|
|
136
142
|
}
|
|
137
143
|
};
|
|
@@ -140,16 +146,16 @@ export function makeSyscallSimulator(
|
|
|
140
146
|
// slog entries have no kernel-translated kso/ksr
|
|
141
147
|
const finish = kernelSlog.syscall(vatID, undefined, vso);
|
|
142
148
|
const expected = syscallsExpected[syscallsMade.length];
|
|
143
|
-
syscallsMade.push(vso);
|
|
149
|
+
const idx = syscallsMade.push(vso) - 1;
|
|
144
150
|
if (!expected) {
|
|
145
151
|
syscallStatus.push('extra');
|
|
146
|
-
const error = Error(
|
|
152
|
+
const error = Error(`${context}: extra syscall at index sc${idx}`);
|
|
147
153
|
replayError ||= error;
|
|
148
154
|
throw error;
|
|
149
155
|
}
|
|
150
156
|
if (!syscallsAreIdentical(expected.s, vso)) {
|
|
151
157
|
syscallStatus.push('wrong');
|
|
152
|
-
const error = Error(
|
|
158
|
+
const error = Error(`${context}: wrong syscall at index sc${idx}`);
|
|
153
159
|
replayError ||= error;
|
|
154
160
|
throw error;
|
|
155
161
|
}
|
|
@@ -159,12 +165,14 @@ export function makeSyscallSimulator(
|
|
|
159
165
|
};
|
|
160
166
|
|
|
161
167
|
const finishSimulation = () => {
|
|
162
|
-
|
|
163
|
-
|
|
168
|
+
const missing = syscallsExpected.length - syscallsMade.length;
|
|
169
|
+
if (missing > 0) {
|
|
164
170
|
for (let i = 0; i < missing; i += 1) {
|
|
165
171
|
syscallStatus.push('missing');
|
|
166
172
|
}
|
|
167
|
-
const error = Error(
|
|
173
|
+
const error = Error(
|
|
174
|
+
`${context}: missing ${missing} syscall(s) at index sc${syscallsMade.length}`,
|
|
175
|
+
);
|
|
168
176
|
replayError ||= error;
|
|
169
177
|
}
|
|
170
178
|
|
|
@@ -389,7 +397,6 @@ export function makeVatWarehouse({
|
|
|
389
397
|
// entriesReplayed, // retval of replayTranscript() above
|
|
390
398
|
// );
|
|
391
399
|
ephemeral.vats.set(vatID, result);
|
|
392
|
-
// eslint-disable-next-line no-use-before-define
|
|
393
400
|
await applyAvailabilityPolicy(vatID);
|
|
394
401
|
return result;
|
|
395
402
|
}
|
|
@@ -596,7 +603,6 @@ export function makeVatWarehouse({
|
|
|
596
603
|
//
|
|
597
604
|
/** @type { KernelDeliveryObject } */
|
|
598
605
|
const kd = harden(['bringOutYourDead']);
|
|
599
|
-
// eslint-disable-next-line no-use-before-define
|
|
600
606
|
const vd = kernelDeliveryToVatDelivery(vatID, kd);
|
|
601
607
|
const vs = kernelSlog.provideVatSlogger(vatID).vatSlog;
|
|
602
608
|
await deliverToVat(vatID, kd, vd, vs);
|
|
@@ -32,16 +32,15 @@ function makeSupervisorDispatch(dispatch) {
|
|
|
32
32
|
async function dispatchToVat(delivery) {
|
|
33
33
|
// the (low-level) vat is responsible for giving up agency, but we still
|
|
34
34
|
// protect against exceptions
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
);
|
|
35
|
+
await null;
|
|
36
|
+
try {
|
|
37
|
+
const res = await dispatch(delivery);
|
|
38
|
+
return harden(['ok', res, null]);
|
|
39
|
+
} catch (err) {
|
|
40
|
+
// TODO react more thoughtfully, maybe terminate the vat
|
|
41
|
+
console.warn(`error during vat dispatch() of ${delivery}`, err);
|
|
42
|
+
return harden(['error', `${err}`, null]);
|
|
43
|
+
}
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
return harden(dispatchToVat);
|
package/src/typeGuards.js
CHANGED
|
@@ -10,37 +10,40 @@ export const ManagerType = M.or(
|
|
|
10
10
|
|
|
11
11
|
const Bundle = M.splitRecord({ moduleType: M.string() });
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const VatConfigOptions = harden({
|
|
14
14
|
creationOptions: M.splitRecord({}, { critical: M.boolean() }),
|
|
15
15
|
parameters: M.recordOf(M.string(), M.any()),
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
const
|
|
19
|
-
M.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
)
|
|
18
|
+
const makeSwingSetConfigProperties = (required = {}, optional = {}, rest) =>
|
|
19
|
+
M.or(
|
|
20
|
+
M.splitRecord({ sourceSpec: M.string(), ...required }, optional, rest),
|
|
21
|
+
M.splitRecord({ bundleSpec: M.string(), ...required }, optional, rest),
|
|
22
|
+
M.splitRecord({ bundle: Bundle, ...required }, optional, rest),
|
|
23
|
+
);
|
|
24
|
+
const makeSwingSetConfigDescriptor = (required, optional, rest) =>
|
|
25
|
+
M.recordOf(
|
|
26
|
+
M.string(),
|
|
27
|
+
makeSwingSetConfigProperties(required, optional, rest),
|
|
28
|
+
);
|
|
27
29
|
|
|
28
30
|
/**
|
|
29
31
|
* NOTE: this pattern suffices for PSM bootstrap,
|
|
30
32
|
* but does not cover the whole SwingSet config syntax.
|
|
31
33
|
*
|
|
32
34
|
* {@link ./docs/configuration.md}
|
|
33
|
-
* TODO: move this to swingset?
|
|
34
35
|
*
|
|
35
36
|
* @see SwingSetConfig
|
|
36
37
|
* in ./types-external.js
|
|
37
38
|
*/
|
|
38
|
-
export const SwingSetConfig = M.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
export const SwingSetConfig = M.splitRecord(
|
|
40
|
+
{ vats: makeSwingSetConfigDescriptor(undefined, VatConfigOptions) },
|
|
41
|
+
{
|
|
42
|
+
defaultManagerType: ManagerType,
|
|
43
|
+
includeDevDependencies: M.boolean(),
|
|
44
|
+
defaultReapInterval: M.number(),
|
|
45
|
+
snapshotInterval: M.number(),
|
|
46
|
+
bootstrap: M.string(),
|
|
47
|
+
bundles: makeSwingSetConfigDescriptor(undefined, undefined, {}),
|
|
48
|
+
},
|
|
46
49
|
);
|
package/src/types-external.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/** @import { ERef } from '@endo/far'; */
|
|
2
|
-
|
|
3
1
|
export {};
|
|
4
2
|
|
|
5
3
|
/**
|
|
6
4
|
* @import {Guarded} from '@endo/exo';
|
|
5
|
+
* @import {ERef} from '@endo/far';
|
|
7
6
|
* @import {Passable, RemotableObject} from '@endo/pass-style';
|
|
7
|
+
* @import {LimitedConsole} from '@agoric/internal/src/js-utils.js';
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/* This file defines types that part of the external API of swingset. That
|
|
@@ -129,14 +129,6 @@ export {};
|
|
|
129
129
|
* @typedef { (dr: VatDeliveryResult) => void } SlogFinishDelivery
|
|
130
130
|
* @typedef { (ksr: KernelSyscallResult, vsr: VatSyscallResult) => void } SlogFinishSyscall
|
|
131
131
|
* @typedef { { write: ({}) => void,
|
|
132
|
-
* vatConsole: (vatID: string, origConsole: {}) => {},
|
|
133
|
-
* delivery: (vatID: string,
|
|
134
|
-
* newCrankNum: BigInt, newDeliveryNum: BigInt,
|
|
135
|
-
* kd: KernelDeliveryObject, vd: VatDeliveryObject,
|
|
136
|
-
* replay?: boolean) => SlogFinishDelivery,
|
|
137
|
-
* syscall: (vatID: string,
|
|
138
|
-
* ksc: KernelSyscallObject | undefined,
|
|
139
|
-
* vsc: VatSyscallObject) => SlogFinishSyscall,
|
|
140
132
|
* provideVatSlogger: (vatID: string,
|
|
141
133
|
* dynamic?: boolean,
|
|
142
134
|
* description?: string,
|
|
@@ -144,6 +136,20 @@ export {};
|
|
|
144
136
|
* vatSourceBundle?: unknown,
|
|
145
137
|
* managerType?: string,
|
|
146
138
|
* vatParameters?: unknown) => { vatSlog: VatSlog },
|
|
139
|
+
* vatConsole: (vatID: string, origConsole: LimitedConsole) => LimitedConsole,
|
|
140
|
+
* startup: (vatID: string) => () => void,
|
|
141
|
+
* delivery: (vatID: string,
|
|
142
|
+
* newCrankNum: BigInt, newDeliveryNum: BigInt,
|
|
143
|
+
* kd: KernelDeliveryObject, vd: VatDeliveryObject,
|
|
144
|
+
* replay?: boolean) => SlogFinishDelivery,
|
|
145
|
+
* syscall: (vatID: string,
|
|
146
|
+
* ksc: KernelSyscallObject | undefined,
|
|
147
|
+
* vsc: VatSyscallObject) => SlogFinishSyscall,
|
|
148
|
+
* changeCList: (vatID: string,
|
|
149
|
+
* crankNum: BigInt,
|
|
150
|
+
* mode: 'import' | 'export' | 'drop',
|
|
151
|
+
* kernelSlot: string,
|
|
152
|
+
* vatSlot: string) => void,
|
|
147
153
|
* terminateVat: (vatID: string, shouldReject: boolean, info: SwingSetCapData) => void,
|
|
148
154
|
* } } KernelSlog
|
|
149
155
|
* @typedef {{
|
|
@@ -154,27 +160,25 @@ export {};
|
|
|
154
160
|
*/
|
|
155
161
|
|
|
156
162
|
/**
|
|
163
|
+
* @typedef {{ bundle: Bundle }} BundleRef a bundle object
|
|
164
|
+
* @typedef {{ bundleName: string }} BundleName a name identifying a property in the `bundles` of a SwingSetOptions object
|
|
165
|
+
* @typedef {{ bundleSpec: string }} BundleSpec a path to a bundle file
|
|
166
|
+
* @typedef {{ sourceSpec: string }} SourceSpec a package specifier such as "@agoric/swingset-vat/tools/vat-puppet.js"
|
|
167
|
+
*
|
|
157
168
|
* @typedef {{
|
|
158
|
-
* sourceSpec: string // path to pre-bundled root
|
|
159
|
-
* }} SourceSpec
|
|
160
|
-
* @typedef {{
|
|
161
|
-
* bundleSpec: string // path to bundled code
|
|
162
|
-
* }} BundleSpec
|
|
163
|
-
* @typedef {{
|
|
164
|
-
* bundle: Bundle
|
|
165
|
-
* }} BundleRef
|
|
166
|
-
* @typedef {{
|
|
167
|
-
* bundleName: string
|
|
168
|
-
* }} BundleName
|
|
169
|
-
* @typedef {(SourceSpec | BundleSpec | BundleRef | BundleName ) & {
|
|
170
169
|
* bundleID?: BundleID,
|
|
171
|
-
* creationOptions?:
|
|
170
|
+
* creationOptions?: StaticVatOptions,
|
|
172
171
|
* parameters?: Record<string, any>,
|
|
173
|
-
* }}
|
|
172
|
+
* }} VatConfigOptions
|
|
173
|
+
*/
|
|
174
|
+
/**
|
|
175
|
+
* @template [Fields=object]
|
|
176
|
+
* @typedef {(SourceSpec | BundleSpec | BundleName | BundleRef) & Fields} SwingSetConfigProperties
|
|
174
177
|
*/
|
|
175
178
|
|
|
176
179
|
/**
|
|
177
|
-
* @
|
|
180
|
+
* @template [Fields=object]
|
|
181
|
+
* @typedef {Record<string, SwingSetConfigProperties<Fields>>} SwingSetConfigDescriptor
|
|
178
182
|
* Where the property name is the name of the vat. Note that
|
|
179
183
|
* the `bootstrap` property names the vat that should be used as the bootstrap vat. Although a swingset
|
|
180
184
|
* configuration can designate any vat as its bootstrap vat, `loadBasedir` will always look for a file named
|
|
@@ -188,7 +192,7 @@ export {};
|
|
|
188
192
|
* `devDependencies` of the surrounding `package.json` should be accessible to
|
|
189
193
|
* bundles.
|
|
190
194
|
* @property {string} [bundleCachePath] if present, SwingSet will use a bundle cache at this path
|
|
191
|
-
* @property {SwingSetConfigDescriptor} vats
|
|
195
|
+
* @property {SwingSetConfigDescriptor<VatConfigOptions>} vats
|
|
192
196
|
* @property {SwingSetConfigDescriptor} [bundles]
|
|
193
197
|
* @property {BundleFormat} [bundleFormat] the bundle source / import bundle
|
|
194
198
|
* format.
|
|
@@ -206,7 +210,7 @@ export {};
|
|
|
206
210
|
*/
|
|
207
211
|
|
|
208
212
|
/**
|
|
209
|
-
* @typedef {
|
|
213
|
+
* @typedef {BundleName | BundleRef | {bundleID: BundleID}} SourceOfBundle
|
|
210
214
|
*/
|
|
211
215
|
/**
|
|
212
216
|
* @typedef { import('@agoric/swing-store').KVStore } KVStore
|
|
@@ -295,12 +299,8 @@ export {};
|
|
|
295
299
|
* Vat Creation and Management
|
|
296
300
|
*
|
|
297
301
|
* @typedef { string } BundleID
|
|
298
|
-
* @typedef {any} BundleCap
|
|
302
|
+
* @typedef { any } BundleCap
|
|
299
303
|
* @typedef { { moduleFormat: 'endoZipBase64', endoZipBase64: string, endoZipBase64Sha512: string } } EndoZipBase64Bundle
|
|
300
|
-
*
|
|
301
|
-
* @typedef { unknown } Meter
|
|
302
|
-
*
|
|
303
|
-
* E(vatAdminService).createVat(bundle, options: DynamicVatOptions)
|
|
304
304
|
*/
|
|
305
305
|
|
|
306
306
|
/**
|
|
@@ -326,8 +326,6 @@ export {};
|
|
|
326
326
|
* types are then defined as amendments to this base type.
|
|
327
327
|
*
|
|
328
328
|
* @typedef { object } BaseVatOptions
|
|
329
|
-
* @property { string } name
|
|
330
|
-
* @property { * } [vatParameters]
|
|
331
329
|
* @property { boolean } [enableSetup]
|
|
332
330
|
* If true, permits the vat to construct itself using the
|
|
333
331
|
* `setup()` API, which bypasses the imposition of LiveSlots but
|
|
@@ -346,6 +344,10 @@ export {};
|
|
|
346
344
|
* outbound syscalls so that the vat's internal state can be
|
|
347
345
|
* reconstructed via replay. If false, no such record is kept.
|
|
348
346
|
* Defaults to true.
|
|
347
|
+
* @property { ManagerType } [managerType]
|
|
348
|
+
* @property { boolean } [neverReap]
|
|
349
|
+
* If true, disables automatic bringOutYourDead deliveries to a vat.
|
|
350
|
+
* Defaults to false.
|
|
349
351
|
* @property { number | 'never' } [reapInterval]
|
|
350
352
|
* Trigger a bringOutYourDead after the vat has received
|
|
351
353
|
* this many deliveries. If the value is 'never',
|
|
@@ -360,7 +362,7 @@ export {};
|
|
|
360
362
|
*/
|
|
361
363
|
|
|
362
364
|
/**
|
|
363
|
-
* @typedef { { meter?:
|
|
365
|
+
* @typedef { { meter?: unknown } } OptMeter
|
|
364
366
|
* If a meter is provided, the new dynamic vat is limited to a fixed
|
|
365
367
|
* amount of computation and allocation that can occur during any
|
|
366
368
|
* given crank. Peak stack frames are limited as well. In addition,
|
|
@@ -370,14 +372,13 @@ export {};
|
|
|
370
372
|
* terminated. If undefined, the vat is unmetered. Static vats
|
|
371
373
|
* cannot be metered.
|
|
372
374
|
*
|
|
373
|
-
* @typedef { {
|
|
374
|
-
* @typedef { BaseVatOptions & OptMeter & OptManagerType } DynamicVatOptions
|
|
375
|
+
* @typedef { BaseVatOptions & { name: string, vatParameters?: object } & OptMeter } DynamicVatOptions
|
|
375
376
|
*
|
|
376
377
|
* config.vats[name].creationOptions: StaticVatOptions
|
|
377
378
|
*
|
|
378
379
|
* @typedef { { enableDisavow?: boolean } } OptEnableDisavow
|
|
379
380
|
* @typedef { { nodeOptions?: string[] } } OptNodeOptions
|
|
380
|
-
* @typedef { BaseVatOptions &
|
|
381
|
+
* @typedef { BaseVatOptions & OptEnableDisavow & OptNodeOptions } StaticVatOptions
|
|
381
382
|
*
|
|
382
383
|
* @typedef { { vatParameters?: object, upgradeMessage?: string } } VatUpgradeOptions
|
|
383
384
|
* @typedef { { incarnationNumber: number } } VatUpgradeResults
|
package/src/types-internal.js
CHANGED
|
@@ -29,7 +29,6 @@ export {};
|
|
|
29
29
|
* @typedef { string } MeterID
|
|
30
30
|
* @typedef { { meterID?: MeterID } } OptMeterID
|
|
31
31
|
* @typedef { import('./types-external.js').BaseVatOptions } BaseVatOptions
|
|
32
|
-
* @typedef { import('./types-external.js').OptManagerType } OptManagerType
|
|
33
32
|
* @typedef { import('@agoric/swingset-liveslots').VatDeliveryObject } VatDeliveryObject
|
|
34
33
|
* @typedef { import('@agoric/swingset-liveslots').VatDeliveryResult } VatDeliveryResult
|
|
35
34
|
* @typedef { import('@agoric/swingset-liveslots').VatSyscallObject } VatSyscallObject
|
|
@@ -38,7 +37,7 @@ export {};
|
|
|
38
37
|
*
|
|
39
38
|
* // used by vatKeeper.setSourceAndOptions(source, RecordedVatOptions)
|
|
40
39
|
*
|
|
41
|
-
* @typedef { BaseVatOptions & OptMeterID
|
|
40
|
+
* @typedef { BaseVatOptions & OptMeterID } InternalDynamicVatOptions
|
|
42
41
|
*
|
|
43
42
|
* RecordedVatOptions is fully-specified, no optional fields
|
|
44
43
|
*
|
|
@@ -112,7 +111,7 @@ export {};
|
|
|
112
111
|
* enableDisavow: boolean,
|
|
113
112
|
* useTranscript: boolean,
|
|
114
113
|
* name: string,
|
|
115
|
-
* sourcedConsole:
|
|
114
|
+
* sourcedConsole: import('@agoric/internal/src/js-utils.js').LimitedConsole,
|
|
116
115
|
* enableSetup: boolean,
|
|
117
116
|
* setup?: unknown,
|
|
118
117
|
* retainSyscall?: boolean
|
package/src/vats/comms/state.js
CHANGED
|
@@ -150,7 +150,6 @@ export function makeState(syscall) {
|
|
|
150
150
|
store.set('r.nextID', '1');
|
|
151
151
|
store.set('initialized', 'true');
|
|
152
152
|
if (controller) {
|
|
153
|
-
// eslint-disable-next-line no-use-before-define
|
|
154
153
|
addMetaObject(controller);
|
|
155
154
|
cdebug(`comms controller is ${controller}`);
|
|
156
155
|
}
|
|
@@ -393,7 +392,6 @@ export function makeState(syscall) {
|
|
|
393
392
|
// the object is unreachable
|
|
394
393
|
|
|
395
394
|
const { owner, isReachable, isRecognizable } =
|
|
396
|
-
// eslint-disable-next-line no-use-before-define
|
|
397
395
|
getOwnerAndStatus(lref);
|
|
398
396
|
if (isReachable) {
|
|
399
397
|
// but the exporter doesn't realize it yet, so schedule a
|
|
@@ -558,7 +556,6 @@ export function makeState(syscall) {
|
|
|
558
556
|
isReachable = isReachableByKernel(lref);
|
|
559
557
|
isRecognizable = !!mapToKernel(lref);
|
|
560
558
|
} else {
|
|
561
|
-
// eslint-disable-next-line no-use-before-define
|
|
562
559
|
const remote = getRemote(owner);
|
|
563
560
|
isReachable = remote.isReachable(lref);
|
|
564
561
|
isRecognizable = !!remote.mapToRemote(lref);
|
|
@@ -794,7 +791,6 @@ export function makeState(syscall) {
|
|
|
794
791
|
insistPromiseIsUnresolved,
|
|
795
792
|
markPromiseAsResolved,
|
|
796
793
|
|
|
797
|
-
// eslint-disable-next-line no-use-before-define
|
|
798
794
|
getRemote,
|
|
799
795
|
addRemote,
|
|
800
796
|
getRemoteIDForName,
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable no-use-before-define */
|
|
2
|
-
|
|
3
1
|
import { assert } from '@endo/errors';
|
|
4
2
|
import { Far, E, passStyleOf } from '@endo/far';
|
|
5
3
|
import { makePromiseKit } from '@endo/promise-kit';
|
|
@@ -16,6 +14,8 @@ import { makeScalarWeakMapStore } from '@agoric/store';
|
|
|
16
14
|
import { TimeMath } from '@agoric/time';
|
|
17
15
|
|
|
18
16
|
/**
|
|
17
|
+
* @import {LegacyWeakMap, WeakMapStore} from '@agoric/store';
|
|
18
|
+
* @import {MapStore} from '@agoric/swingset-liveslots';
|
|
19
19
|
* @import {Passable, RemotableObject} from '@endo/pass-style';
|
|
20
20
|
* @import {Key} from '@endo/patterns';
|
|
21
21
|
*/
|
|
@@ -100,7 +100,6 @@ export function buildRootObject(vatPowers, _vatParameters, baggage) {
|
|
|
100
100
|
// getNotifier: ({ state }) => state.notifier, // XXX RESTORE
|
|
101
101
|
getNotifier: ({ _self }) => Fail`not implemented, see #7234`, // XXX TEMP
|
|
102
102
|
},
|
|
103
|
-
// eslint-disable-next-line no-use-before-define
|
|
104
103
|
{ finish: finishMeter },
|
|
105
104
|
);
|
|
106
105
|
|
|
@@ -120,18 +119,15 @@ export function buildRootObject(vatPowers, _vatParameters, baggage) {
|
|
|
120
119
|
// getNotifier: ({ state }) => state.notifier, // will never fire // XXX RESTORE
|
|
121
120
|
getNotifier: ({ _self }) => Fail`not implemented, see #7234`, // XXX TEMP
|
|
122
121
|
},
|
|
123
|
-
// eslint-disable-next-line no-use-before-define
|
|
124
122
|
{ finish: finishMeter },
|
|
125
123
|
);
|
|
126
124
|
|
|
127
125
|
function finishMeter({ state, self }) {
|
|
128
|
-
// eslint-disable-next-line no-use-before-define
|
|
129
126
|
meterByID.init(
|
|
130
127
|
state.meterID,
|
|
131
128
|
// harden({ meter: self, updater: state.updater }), // XXX RESTORE
|
|
132
129
|
harden({ meter: self }), // XXX TEMP
|
|
133
130
|
);
|
|
134
|
-
// eslint-disable-next-line no-use-before-define
|
|
135
131
|
meterIDByMeter.set(self, state.meterID);
|
|
136
132
|
}
|
|
137
133
|
|
package/tools/baggage-check.js
CHANGED
package/tools/bootstrap-relay.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Source code for a bootstrap vat that runs blockchain behaviors (such as
|
|
3
|
+
* bridge vat integration) and exposes reflective methods for use in testing.
|
|
4
|
+
*
|
|
5
|
+
* TODO: Build from ./vat-puppet.js makeReflectionMethods
|
|
6
|
+
* and share code with packages/vats/tools/vat-reflective-chain-bootstrap.js
|
|
7
|
+
* (which basically extends this for better [mock] blockchain integration).
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
import { Fail, q } from '@endo/errors';
|
|
2
11
|
import { objectMap } from '@agoric/internal';
|
|
3
12
|
import { Far, E } from '@endo/far';
|
package/tools/bundleTool.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { makeNodeBundleCache as wrappedMaker } from '@endo/bundle-source/cache.js';
|
|
2
2
|
import styles from 'ansi-styles'; // less authority than 'chalk'
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @import {EReturn} from '@endo/far';
|
|
6
|
+
*/
|
|
7
|
+
|
|
4
8
|
/** @type {typeof wrappedMaker} */
|
|
5
9
|
export const makeNodeBundleCache = async (dest, options, loadModule, pid) => {
|
|
6
10
|
const log = (...args) => {
|
|
@@ -17,7 +21,7 @@ export const makeNodeBundleCache = async (dest, options, loadModule, pid) => {
|
|
|
17
21
|
};
|
|
18
22
|
return wrappedMaker(dest, { log, ...options }, loadModule, pid);
|
|
19
23
|
};
|
|
20
|
-
/** @typedef {
|
|
24
|
+
/** @typedef {EReturn<typeof makeNodeBundleCache>} BundleCache */
|
|
21
25
|
|
|
22
26
|
/** @type {Map<string, Promise<BundleCache>>} */
|
|
23
27
|
const providedCaches = new Map();
|