From eb564f9635397c0706e1f8255b3e125681e2d031 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Tue, 5 Dec 2023 17:12:25 -0600 Subject: [PATCH 01/58] feat: add exporter.getHostKV() API Add a new API to the exporter, `exporter.getHostKV(key)`, so that the cosmic-swingset state-sync exporter process can query `host.height` without accidentally creating a read-write transaction too. refs #8523 --- .../cosmic-swingset/src/import-kernel-db.js | 3 ++ packages/swing-store/src/exporter.js | 33 +++++++++++++++++++ packages/swing-store/test/exports.js | 3 ++ packages/swing-store/test/test-bundles.js | 6 ++++ packages/swing-store/test/test-export.js | 9 +++++ 5 files changed, 54 insertions(+) diff --git a/packages/cosmic-swingset/src/import-kernel-db.js b/packages/cosmic-swingset/src/import-kernel-db.js index d41e6309cd1..93f9f18ae51 100755 --- a/packages/cosmic-swingset/src/import-kernel-db.js +++ b/packages/cosmic-swingset/src/import-kernel-db.js @@ -145,6 +145,9 @@ export const performStateSyncImport = async ( // Represent the data in `exportDir` as a SwingSetExporter object. /** @type {import('@agoric/swing-store').SwingStoreExporter} */ const exporter = harden({ + getHostKV(_key) { + return undefined; + }, async *getExportData() { log?.('importing export data'); const exportData = createReadStream( diff --git a/packages/swing-store/src/exporter.js b/packages/swing-store/src/exporter.js index 777340c4d0f..5d74bb92dd4 100644 --- a/packages/swing-store/src/exporter.js +++ b/packages/swing-store/src/exporter.js @@ -36,6 +36,11 @@ import { validateArtifactMode } from './internal.js'; * the concurrent activity of other swingStore instances, the data representing * the commit point will stay consistent and available. * + * @property {(key: string) => string | undefined} getHostKV + * + * Retrieve a value from the "host" portion of the kvStore, just like + * hostStorage.hostKVStore.get() would do. + * * @property {() => AnyIterableIterator} getExportData * * Get a full copy of the first-stage export data (key-value pairs) from the @@ -112,6 +117,33 @@ export function makeSwingStoreExporter(dirPath, options = {}) { assertComplete(internal, artifactMode); } + const sqlKVGet = db.prepare(` + SELECT value + FROM kvStore + WHERE key = ? + `); + sqlKVGet.pluck(true); + + /** + * Obtain the value stored for a given host key. This is for the + * benefit of clients who need to briefly query the DB to ensure + * they are exporting the right thing, and need to avoid modifying + * anything (or creating a read-write DB lock) in the process. + * + * @param {string} key The key whose value is sought. + * + * @returns {string | undefined} the (string) value for the given key, or + * undefined if there is no such value. + * + * @throws if key is not a string, or the key is not in the host + * section + */ + function getHostKV(key) { + typeof key === 'string' || Fail`key must be a string`; + getKeyType(key) === 'host' || Fail`getHostKV requires host keys`; + return sqlKVGet.get(key); + } + const sqlGetAllKVData = db.prepare(` SELECT key, value FROM kvStore @@ -173,6 +205,7 @@ export function makeSwingStoreExporter(dirPath, options = {}) { } return harden({ + getHostKV, getExportData, getArtifactNames, getArtifact, diff --git a/packages/swing-store/test/exports.js b/packages/swing-store/test/exports.js index f2d5bdaa0b0..8839024bfc0 100644 --- a/packages/swing-store/test/exports.js +++ b/packages/swing-store/test/exports.js @@ -76,6 +76,9 @@ export function buildData() { */ export function makeExporter(exportData, artifacts) { return { + getHostKV(_key) { + return undefined; + }, async *getExportData() { for (const [key, value] of exportData.entries()) { /** @type { import('../src/exporter.js').KVPair } */ diff --git a/packages/swing-store/test/test-bundles.js b/packages/swing-store/test/test-bundles.js index a8267102870..65d65ee412d 100644 --- a/packages/swing-store/test/test-bundles.js +++ b/packages/swing-store/test/test-bundles.js @@ -106,6 +106,9 @@ test('b0 import', async t => { const idA = makeB0ID(b0A); const nameA = `bundle.${idA}`; const exporter = { + getHostKV(_key) { + return undefined; + }, async *getExportData() { yield /** @type {const} */ ([nameA, idA]); }, @@ -134,6 +137,9 @@ test('b0 bad import', async t => { const idA = makeB0ID(b0A); const nameA = `bundle.${idA}`; const exporter = { + getHostKV(_key) { + return undefined; + }, async *getExportData() { yield /** @type {const} */ ([nameA, idA]); }, diff --git a/packages/swing-store/test/test-export.js b/packages/swing-store/test/test-export.js index d93560ad91f..6e388c7a7f0 100644 --- a/packages/swing-store/test/test-export.js +++ b/packages/swing-store/test/test-export.js @@ -34,6 +34,8 @@ const exportTest = test.macro(async (t, mode) => { const ss1 = initSwingStore(dbDir, options); const ks = ss1.kernelStorage; + ss1.hostStorage.kvStore.set('host.h1', 'hostvalue1'); + // build a DB with four spans (one in an old incarnation, two // historical but current incarnation, only one inUse) and two // snapshots (only one inUSe) @@ -86,6 +88,13 @@ const exportTest = test.macro(async (t, mode) => { } const exporter = makeSwingStoreExporter(dbDir, { artifactMode }); + // hostKV + t.is(exporter.getHostKV('host.h1'), 'hostvalue1'); + t.is(exporter.getHostKV('host.hmissing'), undefined); + t.throws(() => exporter.getHostKV('nonhost'), { + message: 'getHostKV requires host keys', + }); + // exportData { const exportData = new Map(); From 3bc37990fd813136dab33dd93a1dcec073b187f9 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Tue, 5 Dec 2023 17:28:01 -0600 Subject: [PATCH 02/58] fix: export state-sync snapshot without a DB write-lock Exporting a state-sync snapshot is a read-only operation, and is designed to run "in the background", i.e. in parallel with normal mutating operations. It accomplishes this by opening a read-only transaction right away, effectively capturing a snapshot of the SQLite database state, to insulate the export process from ongoing writes by the execution host. The cosmic-swingset exporter starts with a query of `host.height`, to confirm that the database has not already advanced to a new block before this snapshot/read-transaction can be taken. Previously, this query worked by using `openSwingStore`, and then calling `hostStorage.hostKVStore.get('host.height')`. This had two problems: * TOCTTOU: the `hostKVStore.get` used a different DB connection (and different txn) than the exporter, so it might return a different height, negating the accuracy of the consistency check * read-write txn: `openSwingStore` creates a read-*write* txn, even when merely opening the DB (because it might need to create the initial tables). This txn is closed right away, before `openSwingStore()` returns, so it did not present a threat to ongoing operations. But if the exporter was created while the ongoing execution side already had its own read-write txn open (e.g. while `controller.run()` was running), then it would fail, and `makeSwingStoreExporter` would fail with `SQLITE_BUSY` Instead, we take advantage of the new `swingStoreExporter.getHostKV()` API, and use *it* to fetch `host.height`. Unlike the normal swingstore, the swingstore-exporter refrains from creating read-write transactions entirely. So the cosmic-swingset export code can safely query the height without fear of getting the wrong value or failing because of an ongoing write transaction. We think this should fix the SQLITE_BUSY errors. refs #8523 --- packages/cosmic-swingset/src/export-kernel-db.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/cosmic-swingset/src/export-kernel-db.js b/packages/cosmic-swingset/src/export-kernel-db.js index 2da9b2e3d94..e2ee16555c1 100755 --- a/packages/cosmic-swingset/src/export-kernel-db.js +++ b/packages/cosmic-swingset/src/export-kernel-db.js @@ -14,7 +14,7 @@ import { makePromiseKit } from '@endo/promise-kit'; import { Fail, q } from '@agoric/assert'; import { makeAggregateError } from '@agoric/internal'; import { makeShutdown } from '@agoric/internal/src/node/shutdown.js'; -import { openSwingStore, makeSwingStoreExporter } from '@agoric/swing-store'; +import { makeSwingStoreExporter } from '@agoric/swing-store'; import { isEntrypoint } from './helpers/is-entrypoint.js'; import { makeProcessValue } from './helpers/process-value.js'; @@ -144,7 +144,6 @@ export const validateExporterOptions = options => { * @param {Pick} powers.fs * @param {import('path')['resolve']} powers.pathResolve * @param {typeof import('@agoric/swing-store')['makeSwingStoreExporter']} [powers.makeSwingStoreExporter] - * @param {typeof import('@agoric/swing-store')['openSwingStore']} [powers.openSwingStore] * @param {null | ((...args: any[]) => void)} [powers.log] * @returns {StateSyncExporter} */ @@ -154,7 +153,6 @@ export const initiateSwingStoreExport = ( fs: { open, writeFile }, pathResolve, makeSwingStoreExporter: makeExporter = makeSwingStoreExporter, - openSwingStore: openDB = openSwingStore, log = console.log, }, ) => { @@ -183,10 +181,7 @@ export const initiateSwingStoreExport = ( }); cleanup.push(async () => swingStoreExporter.close()); - const { hostStorage } = openDB(stateDir); - - savedBlockHeight = Number(hostStorage.kvStore.get('host.height')) || 0; - await hostStorage.close(); + savedBlockHeight = Number(swingStoreExporter.getHostKV('host.height')) || 0; if (blockHeight) { blockHeight === savedBlockHeight || From 8129d45b4943ff5ed627133b5bb9d295272000b7 Mon Sep 17 00:00:00 2001 From: Chris Hibbert Date: Tue, 5 Dec 2023 15:32:35 -0800 Subject: [PATCH 03/58] test: support for watchedPromises in fakeVirtualSupport Needed by #8488 --- .../test-virtualObjectManager.js | 126 +++++++++++++++++- .../tools/fakeVirtualSupport.js | 13 +- 2 files changed, 131 insertions(+), 8 deletions(-) diff --git a/packages/swingset-liveslots/test/virtual-objects/test-virtualObjectManager.js b/packages/swingset-liveslots/test/virtual-objects/test-virtualObjectManager.js index 859d152bf96..6730608f62b 100644 --- a/packages/swingset-liveslots/test/virtual-objects/test-virtualObjectManager.js +++ b/packages/swingset-liveslots/test/virtual-objects/test-virtualObjectManager.js @@ -590,12 +590,12 @@ test('durable kind IDs can be reanimated', t => { // Store it in the store without having used it placeToPutIt.init('savedKindID', kindHandle); - t.is(log.shift(), 'get vc.1.ssavedKindID => undefined'); + t.is(log.shift(), 'get vc.4.ssavedKindID => undefined'); t.is(log.shift(), `get vom.rc.${khid} => undefined`); t.is(log.shift(), `set vom.rc.${khid} 1`); - t.is(log.shift(), `set vc.1.ssavedKindID ${vstr(kind)}`); - t.is(log.shift(), 'get vc.1.|entryCount => 0'); - t.is(log.shift(), 'set vc.1.|entryCount 1'); + t.is(log.shift(), `set vc.4.ssavedKindID ${vstr(kind)}`); + t.is(log.shift(), 'get vc.4.|entryCount => 0'); + t.is(log.shift(), 'set vc.4.|entryCount 1'); t.deepEqual(log, []); // Forget its Representative @@ -609,7 +609,7 @@ test('durable kind IDs can be reanimated', t => { // Fetch it from the store, which should reanimate it const fetchedKindID = placeToPutIt.get('savedKindID'); - t.is(log.shift(), `get vc.1.ssavedKindID => ${vstr(kind)}`); + t.is(log.shift(), `get vc.4.ssavedKindID => ${vstr(kind)}`); t.is( log.shift(), 'get vom.dkind.10.descriptor => {"kindID":"10","tag":"testkind"}', @@ -658,9 +658,23 @@ test('virtual object gc', t => { ]; t.is(log.shift(), `get storeKindIDTable => undefined`); t.is(log.shift(), `set ${skit[0]} ${skit[1]}`); + t.is(log.shift(), 'set vc.1.|nextOrdinal 1'); + t.is(log.shift(), 'set vc.1.|entryCount 0'); + t.is(log.shift(), 'get watcherTableID => undefined'); + t.is(log.shift(), 'set vc.2.|nextOrdinal 1'); + t.is(log.shift(), 'set vc.2.|entryCount 0'); + t.is(log.shift(), 'set watcherTableID o+d6/2'); + t.is(log.shift(), 'get vom.rc.o+d6/2 => undefined'); + t.is(log.shift(), 'set vom.rc.o+d6/2 1'); + t.is(log.shift(), 'get watchedPromiseTableID => undefined'); + t.is(log.shift(), 'set vc.3.|nextOrdinal 1'); + t.is(log.shift(), 'set vc.3.|entryCount 0'); + t.is(log.shift(), 'set watchedPromiseTableID o+d6/3'); + t.is(log.shift(), 'get vom.rc.o+d6/3 => undefined'); + t.is(log.shift(), 'set vom.rc.o+d6/3 1'); t.is( log.shift(), - `set vom.vkind.10.descriptor {"kindID":"10","tag":"thing"}`, + 'set vom.vkind.10.descriptor {"kindID":"10","tag":"thing"}', ); t.is(log.shift(), `set vom.vkind.11.descriptor {"kindID":"11","tag":"ref"}`); t.deepEqual(log, []); @@ -686,6 +700,12 @@ test('virtual object gc', t => { t.deepEqual(dumpStore(), [ ['kindIDID', '1'], skit, + ['vc.1.|entryCount', '0'], + ['vc.1.|nextOrdinal', '1'], + ['vc.2.|entryCount', '0'], + ['vc.2.|nextOrdinal', '1'], + ['vc.3.|entryCount', '0'], + ['vc.3.|nextOrdinal', '1'], [`vom.${tbase}/1`, minThing('thing #1')], [`vom.${tbase}/2`, minThing('thing #2')], [`vom.${tbase}/3`, minThing('thing #3')], @@ -695,8 +715,12 @@ test('virtual object gc', t => { [`vom.${tbase}/7`, minThing('thing #7')], [`vom.${tbase}/8`, minThing('thing #8')], [`vom.${tbase}/9`, minThing('thing #9')], + ['vom.rc.o+d6/2', '1'], + ['vom.rc.o+d6/3', '1'], ['vom.vkind.10.descriptor', '{"kindID":"10","tag":"thing"}'], ['vom.vkind.11.descriptor', '{"kindID":"11","tag":"ref"}'], + ['watchedPromiseTableID', 'o+d6/3'], + ['watcherTableID', 'o+d6/2'], ]); // This is what the finalizer would do if the local reference was dropped and GC'd @@ -722,6 +746,12 @@ test('virtual object gc', t => { t.deepEqual(dumpStore(), [ ['kindIDID', '1'], skit, + ['vc.1.|entryCount', '0'], + ['vc.1.|nextOrdinal', '1'], + ['vc.2.|entryCount', '0'], + ['vc.2.|nextOrdinal', '1'], + ['vc.3.|entryCount', '0'], + ['vc.3.|nextOrdinal', '1'], [`vom.es.${tbase}/1`, 'r'], [`vom.${tbase}/1`, minThing('thing #1')], [`vom.${tbase}/2`, minThing('thing #2')], @@ -732,8 +762,12 @@ test('virtual object gc', t => { [`vom.${tbase}/7`, minThing('thing #7')], [`vom.${tbase}/8`, minThing('thing #8')], [`vom.${tbase}/9`, minThing('thing #9')], + ['vom.rc.o+d6/2', '1'], + ['vom.rc.o+d6/3', '1'], ['vom.vkind.10.descriptor', '{"kindID":"10","tag":"thing"}'], ['vom.vkind.11.descriptor', '{"kindID":"11","tag":"ref"}'], + ['watchedPromiseTableID', 'o+d6/3'], + ['watcherTableID', 'o+d6/2'], ]); // drop export -- should delete @@ -763,6 +797,12 @@ test('virtual object gc', t => { t.deepEqual(dumpStore(), [ ['kindIDID', '1'], skit, + ['vc.1.|entryCount', '0'], + ['vc.1.|nextOrdinal', '1'], + ['vc.2.|entryCount', '0'], + ['vc.2.|nextOrdinal', '1'], + ['vc.3.|entryCount', '0'], + ['vc.3.|nextOrdinal', '1'], [`vom.${tbase}/2`, minThing('thing #2')], [`vom.${tbase}/3`, minThing('thing #3')], [`vom.${tbase}/4`, minThing('thing #4')], @@ -771,8 +811,12 @@ test('virtual object gc', t => { [`vom.${tbase}/7`, minThing('thing #7')], [`vom.${tbase}/8`, minThing('thing #8')], [`vom.${tbase}/9`, minThing('thing #9')], + ['vom.rc.o+d6/2', '1'], + ['vom.rc.o+d6/3', '1'], ['vom.vkind.10.descriptor', '{"kindID":"10","tag":"thing"}'], ['vom.vkind.11.descriptor', '{"kindID":"11","tag":"ref"}'], + ['watchedPromiseTableID', 'o+d6/3'], + ['watcherTableID', 'o+d6/2'], ]); // case 2: export, drop export, drop local ref @@ -790,6 +834,12 @@ test('virtual object gc', t => { t.deepEqual(dumpStore(), [ ['kindIDID', '1'], skit, + ['vc.1.|entryCount', '0'], + ['vc.1.|nextOrdinal', '1'], + ['vc.2.|entryCount', '0'], + ['vc.2.|nextOrdinal', '1'], + ['vc.3.|entryCount', '0'], + ['vc.3.|nextOrdinal', '1'], [`vom.es.${tbase}/2`, 's'], [`vom.${tbase}/2`, minThing('thing #2')], [`vom.${tbase}/3`, minThing('thing #3')], @@ -799,8 +849,12 @@ test('virtual object gc', t => { [`vom.${tbase}/7`, minThing('thing #7')], [`vom.${tbase}/8`, minThing('thing #8')], [`vom.${tbase}/9`, minThing('thing #9')], + ['vom.rc.o+d6/2', '1'], + ['vom.rc.o+d6/3', '1'], ['vom.vkind.10.descriptor', '{"kindID":"10","tag":"thing"}'], ['vom.vkind.11.descriptor', '{"kindID":"11","tag":"ref"}'], + ['watchedPromiseTableID', 'o+d6/3'], + ['watcherTableID', 'o+d6/2'], ]); // drop local ref -- should delete @@ -821,6 +875,12 @@ test('virtual object gc', t => { t.deepEqual(dumpStore(), [ ['kindIDID', '1'], skit, + ['vc.1.|entryCount', '0'], + ['vc.1.|nextOrdinal', '1'], + ['vc.2.|entryCount', '0'], + ['vc.2.|nextOrdinal', '1'], + ['vc.3.|entryCount', '0'], + ['vc.3.|nextOrdinal', '1'], [`vom.${tbase}/3`, minThing('thing #3')], [`vom.${tbase}/4`, minThing('thing #4')], [`vom.${tbase}/5`, minThing('thing #5')], @@ -828,8 +888,12 @@ test('virtual object gc', t => { [`vom.${tbase}/7`, minThing('thing #7')], [`vom.${tbase}/8`, minThing('thing #8')], [`vom.${tbase}/9`, minThing('thing #9')], + ['vom.rc.o+d6/2', '1'], + ['vom.rc.o+d6/3', '1'], ['vom.vkind.10.descriptor', '{"kindID":"10","tag":"thing"}'], ['vom.vkind.11.descriptor', '{"kindID":"11","tag":"ref"}'], + ['watchedPromiseTableID', 'o+d6/3'], + ['watcherTableID', 'o+d6/2'], ]); // case 3: drop local ref with no prior export @@ -851,14 +915,24 @@ test('virtual object gc', t => { t.deepEqual(dumpStore(), [ ['kindIDID', '1'], skit, + ['vc.1.|entryCount', '0'], + ['vc.1.|nextOrdinal', '1'], + ['vc.2.|entryCount', '0'], + ['vc.2.|nextOrdinal', '1'], + ['vc.3.|entryCount', '0'], + ['vc.3.|nextOrdinal', '1'], [`vom.${tbase}/4`, minThing('thing #4')], [`vom.${tbase}/5`, minThing('thing #5')], [`vom.${tbase}/6`, minThing('thing #6')], [`vom.${tbase}/7`, minThing('thing #7')], [`vom.${tbase}/8`, minThing('thing #8')], [`vom.${tbase}/9`, minThing('thing #9')], + ['vom.rc.o+d6/2', '1'], + ['vom.rc.o+d6/3', '1'], ['vom.vkind.10.descriptor', '{"kindID":"10","tag":"thing"}'], ['vom.vkind.11.descriptor', '{"kindID":"11","tag":"ref"}'], + ['watchedPromiseTableID', 'o+d6/3'], + ['watcherTableID', 'o+d6/2'], ]); // case 4: ref virtually, export, drop local ref, drop export @@ -871,15 +945,25 @@ test('virtual object gc', t => { t.deepEqual(dumpStore(), [ ['kindIDID', '1'], skit, + ['vc.1.|entryCount', '0'], + ['vc.1.|nextOrdinal', '1'], + ['vc.2.|entryCount', '0'], + ['vc.2.|nextOrdinal', '1'], + ['vc.3.|entryCount', '0'], + ['vc.3.|nextOrdinal', '1'], [`vom.${tbase}/4`, minThing('thing #4')], [`vom.${tbase}/5`, minThing('thing #5')], [`vom.${tbase}/6`, minThing('thing #6')], [`vom.${tbase}/7`, minThing('thing #7')], [`vom.${tbase}/8`, minThing('thing #8')], [`vom.${tbase}/9`, minThing('thing #9')], + ['vom.rc.o+d6/2', '1'], + ['vom.rc.o+d6/3', '1'], [`vom.rc.${tbase}/4`, '1'], ['vom.vkind.10.descriptor', '{"kindID":"10","tag":"thing"}'], ['vom.vkind.11.descriptor', '{"kindID":"11","tag":"ref"}'], + ['watchedPromiseTableID', 'o+d6/3'], + ['watcherTableID', 'o+d6/2'], ]); // export setExportStatus(`${tbase}/4`, 'reachable'); @@ -913,6 +997,12 @@ test('virtual object gc', t => { t.deepEqual(dumpStore(), [ ['kindIDID', '1'], skit, + ['vc.1.|entryCount', '0'], + ['vc.1.|nextOrdinal', '1'], + ['vc.2.|entryCount', '0'], + ['vc.2.|nextOrdinal', '1'], + ['vc.3.|entryCount', '0'], + ['vc.3.|nextOrdinal', '1'], [`vom.es.${tbase}/4`, 's'], [`vom.es.${tbase}/5`, 'r'], [`vom.${tbase}/4`, minThing('thing #4')], @@ -921,10 +1011,14 @@ test('virtual object gc', t => { [`vom.${tbase}/7`, minThing('thing #7')], [`vom.${tbase}/8`, minThing('thing #8')], [`vom.${tbase}/9`, minThing('thing #9')], + ['vom.rc.o+d6/2', '1'], + ['vom.rc.o+d6/3', '1'], [`vom.rc.${tbase}/4`, '1'], [`vom.rc.${tbase}/5`, '1'], ['vom.vkind.10.descriptor', '{"kindID":"10","tag":"thing"}'], ['vom.vkind.11.descriptor', '{"kindID":"11","tag":"ref"}'], + ['watchedPromiseTableID', 'o+d6/3'], + ['watcherTableID', 'o+d6/2'], ]); // drop local ref -- should not delete because ref'd virtually AND exported pretendGC(`${tbase}/5`, false); @@ -948,6 +1042,12 @@ test('virtual object gc', t => { t.deepEqual(dumpStore(), [ ['kindIDID', '1'], skit, + ['vc.1.|entryCount', '0'], + ['vc.1.|nextOrdinal', '1'], + ['vc.2.|entryCount', '0'], + ['vc.2.|nextOrdinal', '1'], + ['vc.3.|entryCount', '0'], + ['vc.3.|nextOrdinal', '1'], [`vom.es.${tbase}/4`, 's'], [`vom.es.${tbase}/5`, 's'], [`vom.${tbase}/4`, minThing('thing #4')], @@ -956,11 +1056,15 @@ test('virtual object gc', t => { [`vom.${tbase}/7`, minThing('thing #7')], [`vom.${tbase}/8`, minThing('thing #8')], [`vom.${tbase}/9`, minThing('thing #9')], + ['vom.rc.o+d6/2', '1'], + ['vom.rc.o+d6/3', '1'], [`vom.rc.${tbase}/4`, '1'], [`vom.rc.${tbase}/5`, '1'], [`vom.rc.${tbase}/6`, '1'], ['vom.vkind.10.descriptor', '{"kindID":"10","tag":"thing"}'], ['vom.vkind.11.descriptor', '{"kindID":"11","tag":"ref"}'], + ['watchedPromiseTableID', 'o+d6/3'], + ['watcherTableID', 'o+d6/2'], ]); // drop local ref -- should not delete because ref'd virtually pretendGC(`${tbase}/6`, false); @@ -970,6 +1074,12 @@ test('virtual object gc', t => { t.deepEqual(dumpStore(), [ ['kindIDID', '1'], skit, + ['vc.1.|entryCount', '0'], + ['vc.1.|nextOrdinal', '1'], + ['vc.2.|entryCount', '0'], + ['vc.2.|nextOrdinal', '1'], + ['vc.3.|entryCount', '0'], + ['vc.3.|nextOrdinal', '1'], [`vom.es.${tbase}/4`, 's'], [`vom.es.${tbase}/5`, 's'], [`vom.${tbase}/4`, minThing('thing #4')], @@ -978,11 +1088,15 @@ test('virtual object gc', t => { [`vom.${tbase}/7`, minThing('thing #7')], [`vom.${tbase}/8`, minThing('thing #8')], [`vom.${tbase}/9`, minThing('thing #9')], + ['vom.rc.o+d6/2', '1'], + ['vom.rc.o+d6/3', '1'], [`vom.rc.${tbase}/4`, '1'], [`vom.rc.${tbase}/5`, '1'], [`vom.rc.${tbase}/6`, '1'], ['vom.vkind.10.descriptor', '{"kindID":"10","tag":"thing"}'], ['vom.vkind.11.descriptor', '{"kindID":"11","tag":"ref"}'], + ['watchedPromiseTableID', 'o+d6/3'], + ['watcherTableID', 'o+d6/2'], ]); }); diff --git a/packages/swingset-liveslots/tools/fakeVirtualSupport.js b/packages/swingset-liveslots/tools/fakeVirtualSupport.js index e2b5d95da17..512fa1e4a0c 100644 --- a/packages/swingset-liveslots/tools/fakeVirtualSupport.js +++ b/packages/swingset-liveslots/tools/fakeVirtualSupport.js @@ -2,8 +2,9 @@ /* eslint-disable max-classes-per-file */ import { makeMarshal } from '@endo/marshal'; import { assert } from '@agoric/assert'; -import { parseVatSlot } from '../src/parseVatSlots.js'; +import { isPromise } from '@endo/promise-kit'; +import { parseVatSlot } from '../src/parseVatSlots.js'; import { makeVirtualReferenceManager } from '../src/virtualReferences.js'; import { makeWatchedPromiseManager } from '../src/watchedPromises.js'; import { makeFakeVirtualObjectManager } from './fakeVirtualObjectManager.js'; @@ -163,6 +164,10 @@ export function makeFakeLiveSlotsStuff(options = {}) { return vrm.allocateNextID('exportID'); } + function allocatePromiseID() { + return vrm.allocateNextID('promiseID'); + } + function allocateCollectionID() { return vrm.allocateNextID('collectionID'); } @@ -195,7 +200,9 @@ export function makeFakeLiveSlotsStuff(options = {}) { function convertValToSlot(val) { if (!valToSlot.has(val)) { - const slot = `o+${allocateExportID()}`; + const slot = isPromise(val) + ? `p+${allocatePromiseID()}` + : `o+${allocateExportID()}`; valToSlot.set(val, slot); setValForSlot(slot, val); } @@ -324,6 +331,7 @@ export function makeFakeWatchedPromiseManager( maybeExportPromise: fakeStuff.maybeExportPromise, }); } + /** * Configure virtual stuff with relaxed durability rules and fake liveslots * @@ -348,6 +356,7 @@ export function makeFakeVirtualStuff(options = {}) { vom.initializeKindHandleKind(); const cm = makeFakeCollectionManager(vrm, fakeStuff, actualOptions); const wpm = makeFakeWatchedPromiseManager(vrm, vom, cm, fakeStuff); + wpm.preparePromiseWatcherTables(); return { fakeStuff, vrm, vom, cm, wpm }; } From a88eb8a21fb914e49bf436eb86aa6be8b2546269 Mon Sep 17 00:00:00 2001 From: Jim Larson Date: Tue, 5 Dec 2023 13:26:40 -0800 Subject: [PATCH 04/58] feat: pick up return-grants from latest cosmos-sdk --- golang/cosmos/Makefile | 2 +- golang/cosmos/go.mod | 2 +- golang/cosmos/go.sum | 4 ++-- golang/cosmos/x/lien/keeper/account.go | 21 +++++++++++++-------- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/golang/cosmos/Makefile b/golang/cosmos/Makefile index 3b1aee787f3..ce268857fdd 100644 --- a/golang/cosmos/Makefile +++ b/golang/cosmos/Makefile @@ -106,7 +106,7 @@ t: TM_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/tendermint/tendermint)/proto/tendermint GOGO_PROTO_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/gogo/protobuf) -IBC_PROTO_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/cosmos/ibc-go/v3)/proto/ibc/core +IBC_PROTO_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/cosmos/ibc-go/v4)/proto/ibc/core COSMOS_SDK_PROTO_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/cosmos/cosmos-sdk)/proto/cosmos GOGO_PROTO_TYPES = third_party/proto/gogoproto diff --git a/golang/cosmos/go.mod b/golang/cosmos/go.mod index a15c42a7e9e..f3b06910e3f 100644 --- a/golang/cosmos/go.mod +++ b/golang/cosmos/go.mod @@ -158,7 +158,7 @@ replace google.golang.org/grpc => google.golang.org/grpc v1.33.2 replace github.com/tendermint/tendermint => github.com/agoric-labs/cometbft v0.34.27-alpha.agoric.3 // We need a fork of cosmos-sdk until all of the differences are merged. -replace github.com/cosmos/cosmos-sdk => github.com/agoric-labs/cosmos-sdk v0.45.16-alpha.agoric.2 +replace github.com/cosmos/cosmos-sdk => github.com/agoric-labs/cosmos-sdk v0.45.16-alpha.agoric.3 // For testing against a local cosmos-sdk or tendermint // replace github.com/cosmos/cosmos-sdk => ../../../forks/cosmos-sdk diff --git a/golang/cosmos/go.sum b/golang/cosmos/go.sum index bc689e53a52..50ba6a7a047 100644 --- a/golang/cosmos/go.sum +++ b/golang/cosmos/go.sum @@ -93,8 +93,8 @@ github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBA github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/agoric-labs/cometbft v0.34.27-alpha.agoric.3 h1:RrKcZClqKav60DA4XEEskEwSsNB3l4ENkBVR66jORvQ= github.com/agoric-labs/cometbft v0.34.27-alpha.agoric.3/go.mod h1:BcCbhKv7ieM0KEddnYXvQZR+pZykTKReJJYf7YC7qhw= -github.com/agoric-labs/cosmos-sdk v0.45.16-alpha.agoric.2 h1:zwYWlYI1le3ctFlgnOX0tFDnTa5jCxKaLfFfNbTJuOg= -github.com/agoric-labs/cosmos-sdk v0.45.16-alpha.agoric.2/go.mod h1:T0VCPrAAeps81/pnD8b0+oBCMDxrkrD48W1t/XYYUeI= +github.com/agoric-labs/cosmos-sdk v0.45.16-alpha.agoric.3 h1:kEcWMDCGVHOrk9FBvHPCgpVK4uCjHtoKDbRQqj5T4Og= +github.com/agoric-labs/cosmos-sdk v0.45.16-alpha.agoric.3/go.mod h1:T0VCPrAAeps81/pnD8b0+oBCMDxrkrD48W1t/XYYUeI= github.com/agoric-labs/cosmos-sdk/ics23/go v0.8.0-alpha.agoric.1 h1:2jvHI/2d+psWAZy6FQ0vXJCHUtfU3ZbbW+pQFL04arQ= github.com/agoric-labs/cosmos-sdk/ics23/go v0.8.0-alpha.agoric.1/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= diff --git a/golang/cosmos/x/lien/keeper/account.go b/golang/cosmos/x/lien/keeper/account.go index 41c962de84a..bfb7acad1e6 100644 --- a/golang/cosmos/x/lien/keeper/account.go +++ b/golang/cosmos/x/lien/keeper/account.go @@ -16,16 +16,16 @@ import ( // In addition to the methods declared in authtypes.AccountI, additional // expectations are enforced dynamically through casting and reflection: // -// - non-module accounts are expected to obey the GenesisAccount interface, -// i.e. to have a Validate() method; +// - non-module accounts are expected to obey the GenesisAccount interface, +// i.e. to have a Validate() method; // -// - UnpackInterfacesMessage is needed for unpacking accounts embedded -// in an Any message; +// - UnpackInterfacesMessage is needed for unpacking accounts embedded +// in an Any message; // -// - MarshalYAML() is used for String rendering; +// - MarshalYAML() is used for String rendering; // -// - protobuf Messages are expected to implement a number of "XXX"-prefixed -// methods not visible in the Message interface. +// - protobuf Messages are expected to implement a number of "XXX"-prefixed +// methods not visible in the Message interface. // // Declaring the expected methods here allows them to implicitly fall through // to an embedded omniAccount. @@ -116,7 +116,7 @@ func (uva unlockedVestingAccount) GetOriginalVesting() sdk.Coins { return sdk.NewCoins() } -//GetDelegatedFree implements the vestexported.VestingAccount interface. +// GetDelegatedFree implements the vestexported.VestingAccount interface. func (uva unlockedVestingAccount) GetDelegatedFree() sdk.Coins { return uva.lien.Delegated } @@ -172,6 +172,11 @@ func (fca fakeClawbackAccount) PostReward(ctx sdk.Context, reward sdk.Coins, act return nil } +// ReturnGrants implements the vestexported.ClawbackVestingAccountI interface. +func (fca fakeClawbackAccount) ReturnGrants(ctx sdk.Context, action vestexported.ReturnGrantAction) error { + return action.TakeGrants(ctx, fca.omniGrantAccount) // XXX or just fail here +} + // LienAccount wraps an omniClawbackAccount to implement lien encumbrance. // The LockedCoins() method is the maximum of the coins locked for // liens, and the coins locked in the underlying VestingAccount. From 75bd9a7bf85bd9b3b9870d9cf42d63f08f0e4f68 Mon Sep 17 00:00:00 2001 From: Mathieu Hofman Date: Wed, 29 Nov 2023 00:40:34 +0000 Subject: [PATCH 05/58] feat(x/swingset): refuse smart wallet messages if not provisioned --- golang/cosmos/ante/inbound_test.go | 4 +++ golang/cosmos/x/swingset/keeper/keeper.go | 20 ++++++++++++++ .../x/swingset/types/expected_keepers.go | 10 +++++++ golang/cosmos/x/swingset/types/msgs.go | 27 +++++++++++++++++++ 4 files changed, 61 insertions(+) diff --git a/golang/cosmos/ante/inbound_test.go b/golang/cosmos/ante/inbound_test.go index 6795d793130..e79bae6f763 100644 --- a/golang/cosmos/ante/inbound_test.go +++ b/golang/cosmos/ante/inbound_test.go @@ -217,3 +217,7 @@ func (msk mockSwingsetKeeper) GetBeansPerUnit(ctx sdk.Context) map[string]sdk.Ui func (msk mockSwingsetKeeper) ChargeBeans(ctx sdk.Context, addr sdk.AccAddress, beans sdk.Uint) error { return fmt.Errorf("not implemented") } + +func (msk mockSwingsetKeeper) GetSmartWalletState(ctx sdk.Context, addr sdk.AccAddress) swingtypes.SmartWalletState { + panic(fmt.Errorf("not implemented")) +} diff --git a/golang/cosmos/x/swingset/keeper/keeper.go b/golang/cosmos/x/swingset/keeper/keeper.go index 29139e8e5fd..2c10e9696f7 100644 --- a/golang/cosmos/x/swingset/keeper/keeper.go +++ b/golang/cosmos/x/swingset/keeper/keeper.go @@ -37,6 +37,12 @@ const ( StoragePathSwingStore = "swingStore" ) +const ( + // WalletStoragePathSegment matches the value of WALLET_STORAGE_PATH_SEGMENT + // packages/vats/src/core/startWalletFactory.js + WalletStoragePathSegment = "wallet" +) + const ( stateKey = "state" swingStoreKeyPrefix = "swingStore." @@ -151,6 +157,20 @@ func (k Keeper) IsHighPriorityAddress(ctx sdk.Context, addr sdk.AccAddress) (boo return k.vstorageKeeper.HasEntry(ctx, path), nil } +// GetSmartWalletState returns the provision state of the smart wallet for the account address +func (k Keeper) GetSmartWalletState(ctx sdk.Context, addr sdk.AccAddress) types.SmartWalletState { + // walletStoragePath is path of `walletStorageNode` constructed in + // `provideSmartWallet` from packages/smart-wallet/src/walletFactory.js + walletStoragePath := StoragePathCustom + "." + WalletStoragePathSegment + "." + addr.String() + + // TODO: implement a pending provision state + if k.vstorageKeeper.HasEntry(ctx, walletStoragePath) { + return types.SmartWalletStateProvisioned + } + + return types.SmartWalletStateNone +} + func (k Keeper) InboundQueueLength(ctx sdk.Context) (int32, error) { size := sdk.NewInt(0) diff --git a/golang/cosmos/x/swingset/types/expected_keepers.go b/golang/cosmos/x/swingset/types/expected_keepers.go index d470193e2e9..307e4d1bc54 100644 --- a/golang/cosmos/x/swingset/types/expected_keepers.go +++ b/golang/cosmos/x/swingset/types/expected_keepers.go @@ -5,6 +5,15 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) +type SmartWalletState uint8 + +const ( + SmartWalletStateUnspecified SmartWalletState = iota + SmartWalletStateNone + SmartWalletStatePending + SmartWalletStateProvisioned +) + type AccountKeeper interface { GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI @@ -15,4 +24,5 @@ type SwingSetKeeper interface { GetBeansPerUnit(ctx sdk.Context) map[string]sdk.Uint ChargeBeans(ctx sdk.Context, addr sdk.AccAddress, beans sdk.Uint) error IsHighPriorityAddress(ctx sdk.Context, addr sdk.AccAddress) (bool, error) + GetSmartWalletState(ctx sdk.Context, addr sdk.AccAddress) SmartWalletState } diff --git a/golang/cosmos/x/swingset/types/msgs.go b/golang/cosmos/x/swingset/types/msgs.go index d819a13c172..84b98ef9b4e 100644 --- a/golang/cosmos/x/swingset/types/msgs.go +++ b/golang/cosmos/x/swingset/types/msgs.go @@ -48,6 +48,23 @@ func chargeAdmission(ctx sdk.Context, keeper SwingSetKeeper, addr sdk.AccAddress return keeper.ChargeBeans(ctx, addr, beans) } +// checkSmartWalletProvisioned verifies if a smart wallet message (MsgWalletAction +// and MsgWalletSpendAction) can be delivered for the owner's address. +func checkSmartWalletProvisioned(ctx sdk.Context, keeper SwingSetKeeper, addr sdk.AccAddress) error { + walletState := keeper.GetSmartWalletState(ctx, addr) + + switch walletState { + case SmartWalletStateProvisioned: + // The address has a smart wallet + return nil + case SmartWalletStatePending: + // A provision is pending execution + return nil + default: + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Owner address does not have a smart wallet") + } +} + func NewMsgDeliverInbound(msgs *Messages, submitter sdk.AccAddress) *MsgDeliverInbound { return &MsgDeliverInbound{ Messages: msgs.Messages, @@ -137,6 +154,11 @@ func (msg MsgWalletAction) CheckAdmissibility(ctx sdk.Context, data interface{}) return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "data must be a SwingSetKeeper, not a %T", data) } + err := checkSmartWalletProvisioned(ctx, keeper, msg.Owner) + if err != nil { + return err + } + return chargeAdmission(ctx, keeper, msg.Owner, []string{msg.Action}, 0) } @@ -204,6 +226,11 @@ func (msg MsgWalletSpendAction) CheckAdmissibility(ctx sdk.Context, data interfa return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "data must be a SwingSetKeeper, not a %T", data) } + err := checkSmartWalletProvisioned(ctx, keeper, msg.Owner) + if err != nil { + return err + } + return chargeAdmission(ctx, keeper, msg.Owner, []string{msg.SpendAction}, 0) } From c0c7cc4a4389df3ad1605bc3f72c29ab0c77ed73 Mon Sep 17 00:00:00 2001 From: Mathieu Hofman Date: Wed, 6 Dec 2023 01:48:08 +0000 Subject: [PATCH 06/58] chore: Add comment back to cosmos from startWalletFactory --- packages/vats/src/core/startWalletFactory.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/vats/src/core/startWalletFactory.js b/packages/vats/src/core/startWalletFactory.js index c3c6f00ca26..2db46c90028 100644 --- a/packages/vats/src/core/startWalletFactory.js +++ b/packages/vats/src/core/startWalletFactory.js @@ -108,6 +108,9 @@ export const startWalletFactory = async ( }, { options: { perAccountInitialValue = (StableUnit * 25n) / 100n } = {} } = {}, ) => { + // The wallet path is read by the cosmos side to check provisioning + // See `WalletStoragePathSegment` and `GetSmartWalletState` in + // golang/cosmos/x/swingset/keeper/keeper.go const WALLET_STORAGE_PATH_SEGMENT = 'wallet'; const POOL_STORAGE_PATH_SEGMENT = 'provisionPool'; const OLD_WALLET_STORAGE_PATH = 'published.wallet'; From 30924ff97991949d40b6edaff6e947f0af52ffc7 Mon Sep 17 00:00:00 2001 From: Mathieu Hofman Date: Wed, 29 Nov 2023 16:31:33 +0000 Subject: [PATCH 07/58] chore(cosmos): always update swingset params on upgrade --- golang/cosmos/app/app.go | 6 + golang/cosmos/x/swingset/keeper/migrations.go | 9 +- golang/cosmos/x/swingset/legacy/v32/params.go | 37 ----- .../x/swingset/legacy/v32/params_test.go | 133 ------------------ golang/cosmos/x/swingset/types/params.go | 74 ++++++++++ golang/cosmos/x/swingset/types/params_test.go | 116 +++++++++++++++ 6 files changed, 203 insertions(+), 172 deletions(-) delete mode 100644 golang/cosmos/x/swingset/legacy/v32/params.go delete mode 100644 golang/cosmos/x/swingset/legacy/v32/params_test.go create mode 100644 golang/cosmos/x/swingset/types/params_test.go diff --git a/golang/cosmos/app/app.go b/golang/cosmos/app/app.go index f50b9e15c23..f06271e36b4 100644 --- a/golang/cosmos/app/app.go +++ b/golang/cosmos/app/app.go @@ -838,6 +838,12 @@ func unreleasedUpgradeHandler(app *GaiaApp, targetUpgrade string) func(sdk.Conte return mvm, err } + m := swingsetkeeper.NewMigrator(app.SwingSetKeeper) + err = m.MigrateParams(ctx) + if err != nil { + return mvm, err + } + return mvm, nil } } diff --git a/golang/cosmos/x/swingset/keeper/migrations.go b/golang/cosmos/x/swingset/keeper/migrations.go index fdad01fceb6..7f2fdfd00c4 100644 --- a/golang/cosmos/x/swingset/keeper/migrations.go +++ b/golang/cosmos/x/swingset/keeper/migrations.go @@ -1,7 +1,7 @@ package keeper import ( - v32 "github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset/legacy/v32" + "github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -17,8 +17,13 @@ func NewMigrator(keeper Keeper) Migrator { // Migrate1to2 migrates from version 1 to 2. func (m Migrator) Migrate1to2(ctx sdk.Context) error { + return m.MigrateParams(ctx) +} + +// MigrateParams migrates params by setting new params to their default value +func (m Migrator) MigrateParams(ctx sdk.Context) error { params := m.keeper.GetParams(ctx) - newParams, err := v32.UpdateParams(params) + newParams, err := types.UpdateParams(params) if err != nil { return err } diff --git a/golang/cosmos/x/swingset/legacy/v32/params.go b/golang/cosmos/x/swingset/legacy/v32/params.go deleted file mode 100644 index aa76940a13f..00000000000 --- a/golang/cosmos/x/swingset/legacy/v32/params.go +++ /dev/null @@ -1,37 +0,0 @@ -package v32 - -import ( - "fmt" - - "github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset/types" -) - -// UpdateParams performs the parameter updates to migrate to version 2, -// returning the updated params or an error. -func UpdateParams(params types.Params) (types.Params, error) { - newBpu, err := addStorageBeanCost(params.BeansPerUnit) - if err != nil { - return params, err - } - params.BeansPerUnit = newBpu - return params, nil -} - -// addStorageBeanCost adds the default beans per storage byte cost, -// if it's not in the list of bean costs already, returning the possibly-updated list. -// or an error if there's no default storage cost. -func addStorageBeanCost(bpu []types.StringBeans) ([]types.StringBeans, error) { - for _, ob := range bpu { - if ob.Key == types.BeansPerStorageByte { - // success if there's already an entry - return bpu, nil - } - } - defaultParams := types.DefaultParams() - for _, b := range defaultParams.BeansPerUnit { - if b.Key == types.BeansPerStorageByte { - return append(bpu, b), nil - } - } - return bpu, fmt.Errorf("no beans per storage byte in default params %v", defaultParams) -} diff --git a/golang/cosmos/x/swingset/legacy/v32/params_test.go b/golang/cosmos/x/swingset/legacy/v32/params_test.go deleted file mode 100644 index 3c8d20ab5a3..00000000000 --- a/golang/cosmos/x/swingset/legacy/v32/params_test.go +++ /dev/null @@ -1,133 +0,0 @@ -package v32 - -import ( - "reflect" - "testing" - - "github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -type beans = types.StringBeans - -func TestAddStorageBeanCost(t *testing.T) { - var defaultStorageCost beans - for _, b := range types.DefaultParams().BeansPerUnit { - if b.Key == types.BeansPerStorageByte { - defaultStorageCost = b - } - } - if defaultStorageCost.Key == "" { - t.Fatalf("no beans per storage byte in default params") - } - - for _, tt := range []struct { - name string - in []beans - want []beans - }{ - { - name: "empty", - in: []beans{}, - want: []beans{defaultStorageCost}, - }, - { - name: "already_only_same", - in: []beans{defaultStorageCost}, - want: []beans{defaultStorageCost}, - }, - { - name: "already_only_different", - in: []beans{types.NewStringBeans(types.BeansPerStorageByte, sdk.NewUint(123))}, - want: []beans{types.NewStringBeans(types.BeansPerStorageByte, sdk.NewUint(123))}, - }, - { - name: "already_same", - in: []beans{ - types.NewStringBeans("foo", sdk.NewUint(123)), - defaultStorageCost, - types.NewStringBeans("bar", sdk.NewUint(456)), - }, - want: []beans{ - types.NewStringBeans("foo", sdk.NewUint(123)), - defaultStorageCost, - types.NewStringBeans("bar", sdk.NewUint(456)), - }, - }, - { - name: "already_different", - in: []beans{ - types.NewStringBeans("foo", sdk.NewUint(123)), - types.NewStringBeans(types.BeansPerStorageByte, sdk.NewUint(789)), - types.NewStringBeans("bar", sdk.NewUint(456)), - }, - want: []beans{ - types.NewStringBeans("foo", sdk.NewUint(123)), - types.NewStringBeans(types.BeansPerStorageByte, sdk.NewUint(789)), - types.NewStringBeans("bar", sdk.NewUint(456)), - }, - }, - { - name: "missing", - in: []beans{ - types.NewStringBeans("foo", sdk.NewUint(123)), - types.NewStringBeans("bar", sdk.NewUint(456)), - }, - want: []beans{ - types.NewStringBeans("foo", sdk.NewUint(123)), - types.NewStringBeans("bar", sdk.NewUint(456)), - defaultStorageCost, - }, - }, - } { - t.Run(tt.name, func(t *testing.T) { - got, err := addStorageBeanCost(tt.in) - if err != nil { - t.Errorf("got error %v", err) - } else if !reflect.DeepEqual(got, tt.want) { - t.Errorf("want %v, got %v", tt.want, got) - } - }) - } -} - -func TestUpdateParams(t *testing.T) { - var defaultStorageCost beans - for _, b := range types.DefaultParams().BeansPerUnit { - if b.Key == types.BeansPerStorageByte { - defaultStorageCost = b - } - } - if defaultStorageCost.Key == "" { - t.Fatalf("no beans per storage byte in default params") - } - - in := types.Params{ - BeansPerUnit: []beans{ - types.NewStringBeans("foo", sdk.NewUint(123)), - types.NewStringBeans("bar", sdk.NewUint(456)), - }, - BootstrapVatConfig: "baz", - FeeUnitPrice: sdk.NewCoins(sdk.NewInt64Coin("denom", 789)), - PowerFlagFees: types.DefaultPowerFlagFees, - QueueMax: types.DefaultQueueMax, - } - want := types.Params{ - BeansPerUnit: []beans{ - types.NewStringBeans("foo", sdk.NewUint(123)), - types.NewStringBeans("bar", sdk.NewUint(456)), - defaultStorageCost, - }, - BootstrapVatConfig: "baz", - FeeUnitPrice: sdk.NewCoins(sdk.NewInt64Coin("denom", 789)), - PowerFlagFees: types.DefaultPowerFlagFees, - QueueMax: types.DefaultQueueMax, - } - got, err := UpdateParams(in) - if err != nil { - t.Fatalf("UpdateParam error %v", err) - } - if !reflect.DeepEqual(got, want) { - t.Errorf("got %v, want %v", got, want) - } -} diff --git a/golang/cosmos/x/swingset/types/params.go b/golang/cosmos/x/swingset/types/params.go index 25c75003695..3606396e6d4 100644 --- a/golang/cosmos/x/swingset/types/params.go +++ b/golang/cosmos/x/swingset/types/params.go @@ -163,3 +163,77 @@ func validateQueueMax(i interface{}) error { } return nil } + +// UpdateParams appends any missing params, configuring them to their defaults, +// then returning the updated params or an error. Existing params are not +// modified, regardless of their value, and they are not removed if they no +// longer appear in the defaults. +func UpdateParams(params Params) (Params, error) { + newBpu, err := appendMissingDefaultBeansPerUnit(params.BeansPerUnit, DefaultBeansPerUnit()) + if err != nil { + return params, err + } + newPff, err := appendMissingDefaultPowerFlagFees(params.PowerFlagFees, DefaultPowerFlagFees) + if err != nil { + return params, err + } + newQm, err := appendMissingDefaultQueueSize(params.QueueMax, DefaultQueueMax) + if err != nil { + return params, err + } + + params.BeansPerUnit = newBpu + params.PowerFlagFees = newPff + params.QueueMax = newQm + return params, nil +} + +// appendMissingDefaultBeansPerUnit appends the default beans per unit entries +// not in the list of bean costs already, returning the possibly-updated list, +// or an error. +func appendMissingDefaultBeansPerUnit(bpu []StringBeans, defaultBpu []StringBeans) ([]StringBeans, error) { + existingBpu := make(map[string]struct{}, len(bpu)) + for _, ob := range bpu { + existingBpu[ob.Key] = struct{}{} + } + + for _, b := range defaultBpu { + if _, exists := existingBpu[b.Key]; !exists { + bpu = append(bpu, b) + } + } + return bpu, nil +} + +// appendMissingDefaultPowerFlagFees appends the default power flag fee entries +// not in the list of power flags already, returning the possibly-updated list, +// or an error. +func appendMissingDefaultPowerFlagFees(pff []PowerFlagFee, defaultPff []PowerFlagFee) ([]PowerFlagFee, error) { + existingPff := make(map[string]struct{}, len(pff)) + for _, of := range pff { + existingPff[of.PowerFlag] = struct{}{} + } + + for _, f := range defaultPff { + if _, exists := existingPff[f.PowerFlag]; !exists { + pff = append(pff, f) + } + } + return pff, nil +} + +// appendMissingDefaultQueueSize appends the default queue size entries not in +// the list of sizes already, returning the possibly-updated list, or an error. +func appendMissingDefaultQueueSize(qs []QueueSize, defaultQs []QueueSize) ([]QueueSize, error) { + existingQs := make(map[string]struct{}, len(qs)) + for _, os := range qs { + existingQs[os.Key] = struct{}{} + } + + for _, s := range defaultQs { + if _, exists := existingQs[s.Key]; !exists { + qs = append(qs, s) + } + } + return qs, nil +} diff --git a/golang/cosmos/x/swingset/types/params_test.go b/golang/cosmos/x/swingset/types/params_test.go new file mode 100644 index 00000000000..e75986736ad --- /dev/null +++ b/golang/cosmos/x/swingset/types/params_test.go @@ -0,0 +1,116 @@ +package types + +import ( + "reflect" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type beans = StringBeans + +func TestAddStorageBeanCost(t *testing.T) { + var defaultStorageCost beans + for _, b := range DefaultParams().BeansPerUnit { + if b.Key == BeansPerStorageByte { + defaultStorageCost = b + } + } + if defaultStorageCost.Key == "" { + t.Fatalf("no beans per storage byte in default params") + } + + for _, tt := range []struct { + name string + in []beans + want []beans + }{ + { + name: "empty", + in: []beans{}, + want: []beans{defaultStorageCost}, + }, + { + name: "already_only_same", + in: []beans{defaultStorageCost}, + want: []beans{defaultStorageCost}, + }, + { + name: "already_only_different", + in: []beans{NewStringBeans(BeansPerStorageByte, sdk.NewUint(123))}, + want: []beans{NewStringBeans(BeansPerStorageByte, sdk.NewUint(123))}, + }, + { + name: "already_same", + in: []beans{ + NewStringBeans("foo", sdk.NewUint(123)), + defaultStorageCost, + NewStringBeans("bar", sdk.NewUint(456)), + }, + want: []beans{ + NewStringBeans("foo", sdk.NewUint(123)), + defaultStorageCost, + NewStringBeans("bar", sdk.NewUint(456)), + }, + }, + { + name: "already_different", + in: []beans{ + NewStringBeans("foo", sdk.NewUint(123)), + NewStringBeans(BeansPerStorageByte, sdk.NewUint(789)), + NewStringBeans("bar", sdk.NewUint(456)), + }, + want: []beans{ + NewStringBeans("foo", sdk.NewUint(123)), + NewStringBeans(BeansPerStorageByte, sdk.NewUint(789)), + NewStringBeans("bar", sdk.NewUint(456)), + }, + }, + { + name: "missing", + in: []beans{ + NewStringBeans("foo", sdk.NewUint(123)), + NewStringBeans("bar", sdk.NewUint(456)), + }, + want: []beans{ + NewStringBeans("foo", sdk.NewUint(123)), + NewStringBeans("bar", sdk.NewUint(456)), + defaultStorageCost, + }, + }, + } { + t.Run(tt.name, func(t *testing.T) { + got, err := appendMissingDefaultBeansPerUnit(tt.in, []StringBeans{defaultStorageCost}) + if err != nil { + t.Errorf("got error %v", err) + } else if !reflect.DeepEqual(got, tt.want) { + t.Errorf("want %v, got %v", tt.want, got) + } + }) + } +} + +func TestUpdateParams(t *testing.T) { + + in := Params{ + BeansPerUnit: []beans{}, + BootstrapVatConfig: "baz", + FeeUnitPrice: sdk.NewCoins(sdk.NewInt64Coin("denom", 789)), + PowerFlagFees: []PowerFlagFee{}, + QueueMax: []QueueSize{}, + } + want := Params{ + BeansPerUnit: DefaultBeansPerUnit(), + BootstrapVatConfig: "baz", + FeeUnitPrice: sdk.NewCoins(sdk.NewInt64Coin("denom", 789)), + PowerFlagFees: DefaultPowerFlagFees, + QueueMax: DefaultQueueMax, + } + got, err := UpdateParams(in) + if err != nil { + t.Fatalf("UpdateParam error %v", err) + } + if !reflect.DeepEqual(got, want) { + t.Errorf("got %v, want %v", got, want) + } +} From 20a5485b96d072a4cee990b3c24f8fb441ea909f Mon Sep 17 00:00:00 2001 From: Mathieu Hofman Date: Wed, 29 Nov 2023 16:33:49 +0000 Subject: [PATCH 08/58] feat(x/swingset): auto-provision smart wallet --- golang/cosmos/ante/inbound_test.go | 4 ++ golang/cosmos/x/swingset/keeper/keeper.go | 19 +++++++ golang/cosmos/x/swingset/keeper/msg_server.go | 57 +++++++++++++++++-- .../cosmos/x/swingset/types/default-params.go | 38 +++++++------ .../x/swingset/types/expected_keepers.go | 1 + golang/cosmos/x/swingset/types/msgs.go | 26 +++++++-- 6 files changed, 118 insertions(+), 27 deletions(-) diff --git a/golang/cosmos/ante/inbound_test.go b/golang/cosmos/ante/inbound_test.go index e79bae6f763..d57450f88e6 100644 --- a/golang/cosmos/ante/inbound_test.go +++ b/golang/cosmos/ante/inbound_test.go @@ -221,3 +221,7 @@ func (msk mockSwingsetKeeper) ChargeBeans(ctx sdk.Context, addr sdk.AccAddress, func (msk mockSwingsetKeeper) GetSmartWalletState(ctx sdk.Context, addr sdk.AccAddress) swingtypes.SmartWalletState { panic(fmt.Errorf("not implemented")) } + +func (msk mockSwingsetKeeper) ChargeForSmartWallet(ctx sdk.Context, addr sdk.AccAddress) error { + return fmt.Errorf("not implemented") +} diff --git a/golang/cosmos/x/swingset/keeper/keeper.go b/golang/cosmos/x/swingset/keeper/keeper.go index 2c10e9696f7..27086661119 100644 --- a/golang/cosmos/x/swingset/keeper/keeper.go +++ b/golang/cosmos/x/swingset/keeper/keeper.go @@ -335,6 +335,25 @@ func (k Keeper) ChargeBeans(ctx sdk.Context, addr sdk.AccAddress, beans sdk.Uint return nil } +// ChargeForSmartWallet charges the fee for provisioning a smart wallet. +func (k Keeper) ChargeForSmartWallet(ctx sdk.Context, addr sdk.AccAddress) error { + beansPerUnit := k.GetBeansPerUnit(ctx) + beans := beansPerUnit[types.BeansPerSmartWalletProvision] + err := k.ChargeBeans(ctx, addr, beans) + if err != nil { + return err + } + + // TODO: mark that a smart wallet provision is pending. However in that case, + // auto-provisioning should still be performed (but without fees being charged), + // until the controller actually provisions the smart wallet (the operation may + // transiently fail, requiring retries until success). + // However the provisioning code is not currently idempotent, and has side + // effects when the smart wallet is already provisioned. + + return nil +} + // makeFeeMenu returns a map from power flag to its fee. In the case of duplicates, the // first one wins. func makeFeeMenu(powerFlagFees []types.PowerFlagFee) map[string]sdk.Coins { diff --git a/golang/cosmos/x/swingset/keeper/msg_server.go b/golang/cosmos/x/swingset/keeper/msg_server.go index 0d959ce23cc..e418bf7b3fb 100644 --- a/golang/cosmos/x/swingset/keeper/msg_server.go +++ b/golang/cosmos/x/swingset/keeper/msg_server.go @@ -80,6 +80,11 @@ type walletAction struct { func (keeper msgServer) WalletAction(goCtx context.Context, msg *types.MsgWalletAction) (*types.MsgWalletActionResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) + err := keeper.provisionIfNeeded(ctx, msg.Owner) + if err != nil { + return nil, err + } + action := &walletAction{ Type: "WALLET_ACTION", Owner: msg.Owner.String(), @@ -89,7 +94,7 @@ func (keeper msgServer) WalletAction(goCtx context.Context, msg *types.MsgWallet } // fmt.Fprintf(os.Stderr, "Context is %+v\n", ctx) - err := keeper.routeAction(ctx, msg, action) + err = keeper.routeAction(ctx, msg, action) // fmt.Fprintln(os.Stderr, "Returned from SwingSet", out, err) if err != nil { return nil, err @@ -108,6 +113,11 @@ type walletSpendAction struct { func (keeper msgServer) WalletSpendAction(goCtx context.Context, msg *types.MsgWalletSpendAction) (*types.MsgWalletSpendActionResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) + err := keeper.provisionIfNeeded(ctx, msg.Owner) + if err != nil { + return nil, err + } + action := &walletSpendAction{ Type: "WALLET_SPEND_ACTION", Owner: msg.Owner.String(), @@ -116,7 +126,7 @@ func (keeper msgServer) WalletSpendAction(goCtx context.Context, msg *types.MsgW BlockTime: ctx.BlockTime().Unix(), } // fmt.Fprintf(os.Stderr, "Context is %+v\n", ctx) - err := keeper.routeAction(ctx, msg, action) + err = keeper.routeAction(ctx, msg, action) if err != nil { return nil, err } @@ -125,9 +135,46 @@ func (keeper msgServer) WalletSpendAction(goCtx context.Context, msg *types.MsgW type provisionAction struct { *types.MsgProvision - Type string `json:"type"` // PLEASE_PROVISION - BlockHeight int64 `json:"blockHeight"` - BlockTime int64 `json:"blockTime"` + Type string `json:"type"` // PLEASE_PROVISION + BlockHeight int64 `json:"blockHeight"` + BlockTime int64 `json:"blockTime"` + AutoProvision bool `json:"autoProvision"` +} + +// provisionIfNeeded generates a provision action if no smart wallet is already +// provisioned for the account. This assumes that all messages for +// non-provisioned smart wallets allowed by the admission AnteHandler should +// auto-provision the smart wallet. +func (keeper msgServer) provisionIfNeeded(ctx sdk.Context, owner sdk.AccAddress) error { + // We need to generate a provision action until the smart wallet has + // been fully provisioned by the controller. This is because a provision is + // not guaranteed to succeed (e.g. lack of provision pool funds) + walletState := keeper.GetSmartWalletState(ctx, owner) + if walletState == types.SmartWalletStateProvisioned { + return nil + } + + msg := &types.MsgProvision{ + Address: owner, + Submitter: owner, + PowerFlags: []string{types.PowerFlagSmartWallet}, + } + + action := &provisionAction{ + MsgProvision: msg, + Type: "PLEASE_PROVISION", + BlockHeight: ctx.BlockHeight(), + BlockTime: ctx.BlockTime().Unix(), + AutoProvision: true, + } + + err := keeper.routeAction(ctx, msg, action) + // fmt.Fprintln(os.Stderr, "Returned from SwingSet", out, err) + if err != nil { + return err + } + + return nil } func (keeper msgServer) Provision(goCtx context.Context, msg *types.MsgProvision) (*types.MsgProvisionResponse, error) { diff --git a/golang/cosmos/x/swingset/types/default-params.go b/golang/cosmos/x/swingset/types/default-params.go index 8aa585b4927..46c7fe286d5 100644 --- a/golang/cosmos/x/swingset/types/default-params.go +++ b/golang/cosmos/x/swingset/types/default-params.go @@ -11,20 +11,24 @@ import ( // experience if they don't. const ( - BeansPerFeeUnit = "feeUnit" - BeansPerInboundTx = "inboundTx" - BeansPerBlockComputeLimit = "blockComputeLimit" - BeansPerMessage = "message" - BeansPerMessageByte = "messageByte" - BeansPerMinFeeDebit = "minFeeDebit" - BeansPerStorageByte = "storageByte" - BeansPerVatCreation = "vatCreation" - BeansPerXsnapComputron = "xsnapComputron" + BeansPerFeeUnit = "feeUnit" + BeansPerInboundTx = "inboundTx" + BeansPerBlockComputeLimit = "blockComputeLimit" + BeansPerMessage = "message" + BeansPerMessageByte = "messageByte" + BeansPerMinFeeDebit = "minFeeDebit" + BeansPerStorageByte = "storageByte" + BeansPerVatCreation = "vatCreation" + BeansPerXsnapComputron = "xsnapComputron" + BeansPerSmartWalletProvision = "smartWalletProvision" // QueueSize keys. // Keep up-to-date with updateQueueAllowed() in packanges/cosmic-swingset/src/launch-chain.js QueueInbound = "inbound" QueueInboundMempool = "inbound_mempool" + + // PowerFlags. + PowerFlagSmartWallet = "SMART_WALLET" ) var ( @@ -43,17 +47,18 @@ var ( // TODO: create the cost model we want, and update these to be more principled. // These defaults currently make deploying an ag-solo cost less than $1.00. - DefaultBeansPerFeeUnit = sdk.NewUint(1_000_000_000_000) // $1 - DefaultBeansPerInboundTx = DefaultBeansPerFeeUnit.Quo(sdk.NewUint(100)) // $0.01 - DefaultBeansPerMessage = DefaultBeansPerFeeUnit.Quo(sdk.NewUint(1_000)) // $0.001 - DefaultBeansPerMessageByte = DefaultBeansPerFeeUnit.Quo(sdk.NewUint(50_000)) // $0.00002 - DefaultBeansPerMinFeeDebit = DefaultBeansPerFeeUnit.Quo(sdk.NewUint(5)) // $0.2 - DefaultBeansPerStorageByte = DefaultBeansPerFeeUnit.Quo(sdk.NewUint(500)) // $0.002 + DefaultBeansPerFeeUnit = sdk.NewUint(1_000_000_000_000) // $1 + DefaultBeansPerInboundTx = DefaultBeansPerFeeUnit.Quo(sdk.NewUint(100)) // $0.01 + DefaultBeansPerMessage = DefaultBeansPerFeeUnit.Quo(sdk.NewUint(1_000)) // $0.001 + DefaultBeansPerMessageByte = DefaultBeansPerFeeUnit.Quo(sdk.NewUint(50_000)) // $0.00002 + DefaultBeansPerMinFeeDebit = DefaultBeansPerFeeUnit.Quo(sdk.NewUint(5)) // $0.2 + DefaultBeansPerStorageByte = DefaultBeansPerFeeUnit.Quo(sdk.NewUint(500)) // $0.002 + DefaultBeansPerSmartWalletProvision = DefaultBeansPerFeeUnit // $1 DefaultBootstrapVatConfig = "@agoric/vm-config/decentral-core-config.json" DefaultPowerFlagFees = []PowerFlagFee{ - NewPowerFlagFee("SMART_WALLET", sdk.NewCoins(sdk.NewInt64Coin("ubld", 10_000_000))), + NewPowerFlagFee(PowerFlagSmartWallet, sdk.NewCoins(sdk.NewInt64Coin("ubld", 10_000_000))), } DefaultInboundQueueMax = int32(1_000) @@ -75,5 +80,6 @@ func DefaultBeansPerUnit() []StringBeans { NewStringBeans(BeansPerStorageByte, DefaultBeansPerStorageByte), NewStringBeans(BeansPerVatCreation, DefaultBeansPerVatCreation), NewStringBeans(BeansPerXsnapComputron, DefaultBeansPerXsnapComputron), + NewStringBeans(BeansPerSmartWalletProvision, DefaultBeansPerSmartWalletProvision), } } diff --git a/golang/cosmos/x/swingset/types/expected_keepers.go b/golang/cosmos/x/swingset/types/expected_keepers.go index 307e4d1bc54..03f3f3f1335 100644 --- a/golang/cosmos/x/swingset/types/expected_keepers.go +++ b/golang/cosmos/x/swingset/types/expected_keepers.go @@ -25,4 +25,5 @@ type SwingSetKeeper interface { ChargeBeans(ctx sdk.Context, addr sdk.AccAddress, beans sdk.Uint) error IsHighPriorityAddress(ctx sdk.Context, addr sdk.AccAddress) (bool, error) GetSmartWalletState(ctx sdk.Context, addr sdk.AccAddress) SmartWalletState + ChargeForSmartWallet(ctx sdk.Context, addr sdk.AccAddress) error } diff --git a/golang/cosmos/x/swingset/types/msgs.go b/golang/cosmos/x/swingset/types/msgs.go index 84b98ef9b4e..318f9eca30b 100644 --- a/golang/cosmos/x/swingset/types/msgs.go +++ b/golang/cosmos/x/swingset/types/msgs.go @@ -49,19 +49,29 @@ func chargeAdmission(ctx sdk.Context, keeper SwingSetKeeper, addr sdk.AccAddress } // checkSmartWalletProvisioned verifies if a smart wallet message (MsgWalletAction -// and MsgWalletSpendAction) can be delivered for the owner's address. +// and MsgWalletSpendAction) can be delivered for the owner's address. A message +// is allowed if a smart wallet is already provisioned for the address, or if the +// provisioning fee is charged successfully. +// All messages for non-provisioned smart wallets allowed here will result in +// an auto-provision action generated by the msg server. func checkSmartWalletProvisioned(ctx sdk.Context, keeper SwingSetKeeper, addr sdk.AccAddress) error { walletState := keeper.GetSmartWalletState(ctx, addr) switch walletState { case SmartWalletStateProvisioned: - // The address has a smart wallet + // The address already has a smart wallet return nil case SmartWalletStatePending: - // A provision is pending execution + // A provision (either explicit or automatic) may be pending execution in + // the controller, or if we ever allow multiple swingset messages per + // transaction, a previous message may have provisioned the wallet. return nil default: - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Owner address does not have a smart wallet") + // Charge for the smart wallet. + // This is a separate charge from the smart wallet action which triggered the check + // TODO: Currently this call does not mark the smart wallet provisioning as + // pending, resulting in multiple provisioning charges for the owner. + return keeper.ChargeForSmartWallet(ctx, addr) } } @@ -298,8 +308,12 @@ func (msg MsgProvision) ValidateBasic() error { // CheckAdmissibility implements the vm.ControllerAdmissionMsg interface. func (msg MsgProvision) CheckAdmissibility(ctx sdk.Context, data interface{}) error { - // We have our own fee charging mechanism within Swingset itself, - // so there are no admission restriction here. + // TODO: consider disallowing a provision message for a smart wallet if the + // smart wallet is already provisioned or pending provisioning. However we + // currently do not track whether a smart wallet is pending provisioning. + + // For explicitly provisioning, swingset will take care of charging, + // so we skip admission fees. return nil } From d9cee0a0f224e350f2b462b8f2c5fdb8c6dbd5cc Mon Sep 17 00:00:00 2001 From: Mathieu Hofman Date: Sun, 3 Dec 2023 22:02:29 +0000 Subject: [PATCH 09/58] chore(upgrade-test): add test of auto-provision --- .../upgrade-test-scripts/econHelpers.js | 2 +- .../upgrade-test-scripts/env_setup.sh | 15 ++--- .../unreleased-upgrade/actions.js | 18 +++++- .../unreleased-upgrade/actions.test.js | 55 ++++++++++++++----- 4 files changed, 64 insertions(+), 26 deletions(-) diff --git a/packages/deployment/upgrade-test/upgrade-test-scripts/econHelpers.js b/packages/deployment/upgrade-test/upgrade-test-scripts/econHelpers.js index ced1dff0bb8..c4dbf759efd 100644 --- a/packages/deployment/upgrade-test/upgrade-test-scripts/econHelpers.js +++ b/packages/deployment/upgrade-test/upgrade-test-scripts/econHelpers.js @@ -69,5 +69,5 @@ export const mintIST = async (addr, sendValue, giveCollateral, wantMinted) => { 'test', '--yes', ); - await openVault(addr, giveCollateral, wantMinted); + await openVault(addr, wantMinted, giveCollateral); }; diff --git a/packages/deployment/upgrade-test/upgrade-test-scripts/env_setup.sh b/packages/deployment/upgrade-test/upgrade-test-scripts/env_setup.sh index e1b2ee402c5..c250fa020c5 100755 --- a/packages/deployment/upgrade-test/upgrade-test-scripts/env_setup.sh +++ b/packages/deployment/upgrade-test/upgrade-test-scripts/env_setup.sh @@ -192,16 +192,11 @@ newOfferId() { printKeys() { echo "========== GOVERNANCE KEYS ==========" - echo "gov1: $GOV1ADDR" - cat ~/.agoric/gov1.key || true - echo "gov2: $GOV2ADDR" - cat ~/.agoric/gov2.key || true - echo "gov3: $GOV3ADDR" - cat ~/.agoric/gov3.key || true - echo "validator: $VALIDATORADDR" - cat ~/.agoric/validator.key || true - echo "user1: $USER1ADDR" - cat ~/.agoric/user1.key || true + for i in ~/.agoric/*.key; do + name=$(basename $i .key) + echo "$name:"$'\t'$(agd keys add $name --dry-run --recover --keyring-backend=test --output=json < $i | jq -r .address) || true + echo $'\t'$(cat $i) + done echo "========== GOVERNANCE KEYS ==========" } diff --git a/packages/deployment/upgrade-test/upgrade-test-scripts/unreleased-upgrade/actions.js b/packages/deployment/upgrade-test/upgrade-test-scripts/unreleased-upgrade/actions.js index 6ce8bbfc182..94af68fdb12 100644 --- a/packages/deployment/upgrade-test/upgrade-test-scripts/unreleased-upgrade/actions.js +++ b/packages/deployment/upgrade-test/upgrade-test-scripts/unreleased-upgrade/actions.js @@ -2,12 +2,26 @@ import { promises as fs } from 'fs'; import * as path from 'path'; import { dirname } from 'path'; import { fileURLToPath } from 'url'; -import { voteLatestProposalAndWait } from '../commonUpgradeHelpers.js'; -import { CHAINID, GOV1ADDR, VALIDATORADDR } from '../constants.js'; +import { getUser, voteLatestProposalAndWait } from '../commonUpgradeHelpers.js'; +import { CHAINID, GOV1ADDR, HOME, VALIDATORADDR } from '../constants.js'; import { agd, bundleSource } from '../cliHelper.js'; const directoryName = dirname(fileURLToPath(import.meta.url)); +export const addUser = async user => { + const userKeyData = await agd.keys('add', user, '--keyring-backend=test'); + await fs.writeFile(`${HOME}/.agoric/${user}.key`, userKeyData.mnemonic); + + const userAddress = await getUser(user); + return userAddress; +}; + +export const getISTBalance = async (addr, denom = 'uist', unit = 1_000_000) => { + const coins = await agd.query('bank', 'balances', addr); + const coin = coins.balances.find(a => a.denom === denom); + return Number(coin.amount) / unit; +}; + export const installBundles = async bundlesData => { const bundleIds = {}; diff --git a/packages/deployment/upgrade-test/upgrade-test-scripts/unreleased-upgrade/actions.test.js b/packages/deployment/upgrade-test/upgrade-test-scripts/unreleased-upgrade/actions.test.js index 00e49a04dc9..c2b7b2c9c4c 100644 --- a/packages/deployment/upgrade-test/upgrade-test-scripts/unreleased-upgrade/actions.test.js +++ b/packages/deployment/upgrade-test/upgrade-test-scripts/unreleased-upgrade/actions.test.js @@ -1,13 +1,39 @@ import test from 'ava'; -import { agd, agoric, agops } from '../cliHelper.js'; -import { GOV1ADDR, SDK_ROOT } from '../constants.js'; -import { installBundles, runZcfUpgrade, runProber } from './actions.js'; -import { adjustVault, closeVault, mintIST, openVault } from '../econHelpers.js'; +import { agd } from '../cliHelper.js'; +import { ATOM_DENOM, CHAINID, GOV1ADDR, SDK_ROOT } from '../constants.js'; +import { + installBundles, + runZcfUpgrade, + runProber, + addUser, + getISTBalance, +} from './actions.js'; +import { mintIST, openVault } from '../econHelpers.js'; +import { waitForBlock } from '../commonUpgradeHelpers.js'; test.before(async t => { await mintIST(GOV1ADDR, 12340000000, 10000, 2000); + await waitForBlock(2); + const userAddress = await addUser('user-auto'); + await agd.tx( + 'bank', + 'send', + 'gov1', + userAddress, + `1000000uist,2100000000${ATOM_DENOM}`, + '--from', + GOV1ADDR, + '--chain-id', + CHAINID, + '--keyring-backend', + 'test', + '--yes', + ); + t.context = { userAddress }; + await waitForBlock(2); + const bundlesData = [ { name: 'Zcf-upgrade', @@ -27,16 +53,19 @@ test.before(async t => { t.context.bundleIds = await installBundles(bundlesData); }); -test.skip('Open Vaults', async t => { - const currentVaults = await agops.vaults('list', '--from', GOV1ADDR); - t.is(currentVaults.length, 5); +test('Open Vaults with auto-provisioned wallet', async t => { + const { userAddress } = /** @type {{userAddress: string}} */ (t.context); + t.is(await getISTBalance(userAddress), 1); + + const ATOMGiven = 2000; + const ISTWanted = 400; + await openVault(userAddress, ISTWanted, ATOMGiven); + + await waitForBlock(2); - // TODO get as return value from openVault - const vaultId = 'vault6'; - await openVault(GOV1ADDR, 7, 11); - await adjustVault(GOV1ADDR, vaultId, { giveMinted: 1.5 }); - await adjustVault(GOV1ADDR, vaultId, { giveCollateral: 2.0 }); - await closeVault(GOV1ADDR, vaultId, 5.75); + const newISTBalance = await getISTBalance(userAddress); + console.log('New IST Balance in u13 account:', newISTBalance); + t.true(newISTBalance >= ISTWanted, 'Got the wanted IST'); }); test.skip('Run Prober (first time)', async t => { From 7153535c5c10fed309dc60f12f981c81841fdb93 Mon Sep 17 00:00:00 2001 From: Mathieu Hofman <86499+mhofman@users.noreply.github.com> Date: Tue, 5 Dec 2023 21:26:58 -0800 Subject: [PATCH 10/58] feat(cosmos): un-wire x/crisis (#8582) * feat(cosmos): un-wire x/crisis * fixup! feat(cosmos): un-wire x/crisis --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- golang/cosmos/app/app.go | 33 ++++++++++++------------- golang/cosmos/app/export.go | 3 --- golang/cosmos/daemon/cmd/root.go | 2 -- packages/agoric-cli/src/chain-config.js | 1 - 4 files changed, 16 insertions(+), 23 deletions(-) diff --git a/golang/cosmos/app/app.go b/golang/cosmos/app/app.go index f06271e36b4..26162e4f671 100644 --- a/golang/cosmos/app/app.go +++ b/golang/cosmos/app/app.go @@ -22,6 +22,7 @@ import ( "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" "github.com/cosmos/cosmos-sdk/simapp" + storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/module" @@ -44,8 +45,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/capability" capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - "github.com/cosmos/cosmos-sdk/x/crisis" - crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" distr "github.com/cosmos/cosmos-sdk/x/distribution" distrclient "github.com/cosmos/cosmos-sdk/x/distribution/client" @@ -160,7 +159,6 @@ var ( swingsetclient.CoreEvalProposalHandler, ), params.AppModuleBasic{}, - crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, feegrantmodule.AppModuleBasic{}, authzmodule.AppModuleBasic{}, @@ -234,7 +232,6 @@ type GaiaApp struct { // nolint: golint MintKeeper mintkeeper.Keeper DistrKeeper distrkeeper.Keeper GovKeeper govkeeper.Keeper - CrisisKeeper crisiskeeper.Keeper UpgradeKeeper upgradekeeper.Keeper ParamsKeeper paramskeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly @@ -415,12 +412,6 @@ func NewAgoricApp( &stakingKeeper, app.GetSubspace(slashingtypes.ModuleName), ) - app.CrisisKeeper = crisiskeeper.NewKeeper( - app.GetSubspace(crisistypes.ModuleName), - invCheckPeriod, - app.BankKeeper, - vbanktypes.ReservePoolName, - ) app.UpgradeKeeper = upgradekeeper.NewKeeper( skipUpgradeHeights, keys[upgradetypes.StoreKey], @@ -596,7 +587,6 @@ func NewAgoricApp( app.EvidenceKeeper = *evidenceKeeper - skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) swingStoreExportDir := cast.ToString(appOpts.Get(FlagSwingStoreExportDir)) // NOTE: Any module instantiated in the module manager that is later modified @@ -612,7 +602,6 @@ func NewAgoricApp( vesting.NewAppModule(app.AccountKeeper, app.BankKeeper, app.StakingKeeper), bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper), capability.NewAppModule(appCodec, *app.CapabilityKeeper), - crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants), gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper), mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper), slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), @@ -642,7 +631,6 @@ func NewAgoricApp( // upgrades should be run first upgradetypes.ModuleName, capabilitytypes.ModuleName, - crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName, ibctransfertypes.ModuleName, @@ -671,7 +659,6 @@ func NewAgoricApp( vibc.ModuleName, vbank.ModuleName, lien.ModuleName, - crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName, ibctransfertypes.ModuleName, @@ -712,7 +699,6 @@ func NewAgoricApp( slashingtypes.ModuleName, govtypes.ModuleName, minttypes.ModuleName, - crisistypes.ModuleName, ibctransfertypes.ModuleName, ibchost.ModuleName, icatypes.ModuleName, @@ -733,7 +719,6 @@ func NewAgoricApp( app.mm.SetOrderInitGenesis(moduleOrderForGenesisAndUpgrade...) app.mm.SetOrderMigrations(moduleOrderForGenesisAndUpgrade...) - app.mm.RegisterInvariants(&app.CrisisKeeper) app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino) app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) @@ -805,6 +790,21 @@ func NewAgoricApp( unreleasedUpgradeHandler(app, upgradeNameTest), ) + upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() + if err != nil { + panic(err) + } + if (upgradeInfo.Name == upgradeName || upgradeInfo.Name == upgradeNameTest) && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { + storeUpgrades := storetypes.StoreUpgrades{ + Deleted: []string{ + crisistypes.ModuleName, // The SDK discontinued the crisis module in v0.51.0 + }, + } + + // configure store loader that checks if version == upgradeHeight and applies store upgrades + app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) + } + if loadLatest { if err := app.LoadLatestVersion(); err != nil { tmos.Exit(fmt.Sprintf("failed to load latest version: %s", err)) @@ -1178,7 +1178,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(distrtypes.ModuleName) paramsKeeper.Subspace(slashingtypes.ModuleName) paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable()) - paramsKeeper.Subspace(crisistypes.ModuleName) paramsKeeper.Subspace(ibctransfertypes.ModuleName) paramsKeeper.Subspace(ibchost.ModuleName) paramsKeeper.Subspace(icahosttypes.SubModuleName) diff --git a/golang/cosmos/app/export.go b/golang/cosmos/app/export.go index 0c000cdf31e..66e5f982042 100644 --- a/golang/cosmos/app/export.go +++ b/golang/cosmos/app/export.go @@ -65,9 +65,6 @@ func (app *GaiaApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [ allowedAddrsMap[addr] = true } - /* Just to be safe, assert the invariants on current state. */ - app.CrisisKeeper.AssertInvariants(ctx) - /* Handle fee distribution state. */ // withdraw all validator commission diff --git a/golang/cosmos/daemon/cmd/root.go b/golang/cosmos/daemon/cmd/root.go index 80887c3a766..b90429ddd62 100644 --- a/golang/cosmos/daemon/cmd/root.go +++ b/golang/cosmos/daemon/cmd/root.go @@ -25,7 +25,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/types" vestingcli "github.com/cosmos/cosmos-sdk/x/auth/vesting/client/cli" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/crisis" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" "github.com/spf13/cast" "github.com/spf13/cobra" @@ -177,7 +176,6 @@ func addAgoricVMFlags(cmd *cobra.Command) { } func addModuleInitFlags(startCmd *cobra.Command) { - crisis.AddModuleInitFlags(startCmd) addAgoricVMFlags(startCmd) } diff --git a/packages/agoric-cli/src/chain-config.js b/packages/agoric-cli/src/chain-config.js index 05785d7be85..e9bc39f7376 100644 --- a/packages/agoric-cli/src/chain-config.js +++ b/packages/agoric-cli/src/chain-config.js @@ -236,7 +236,6 @@ export function finishCosmosGenesis({ genesisJson, exportedGenesisJson }) { // Set the denomination for different modules. genesis.app_state.mint.params.mint_denom = MINT_DENOM; - genesis.app_state.crisis.constant_fee.denom = MINT_DENOM; genesis.app_state.gov.deposit_params.min_deposit = GOV_DEPOSIT_COINS; genesis.app_state.gov.voting_params.voting_period = GOV_VOTING_PERIOD; From 82cced2187816b38afb7f21b474de1517b4f7422 Mon Sep 17 00:00:00 2001 From: Mathieu Hofman <86499+mhofman@users.noreply.github.com> Date: Thu, 7 Dec 2023 14:05:39 -0800 Subject: [PATCH 11/58] chore: fix release instructions and tools (#8527) --- MAINTAINERS.md | 2 +- scripts/get-released-tags | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS.md b/MAINTAINERS.md index a1db9e26f49..c97b0f26d26 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -117,7 +117,7 @@ prior=$(git tag -l | sed -ne 's!^@agoric/sdk@\([0-9]*\).*!\1!p' | sort -n | tail SDKVER=$(( prior + 1 )) git tag @agoric/sdk@$SDKVER # Push the branch. -git push -u origin release-$now +git push -u origin prepare-release-$now # Tell which packages have actual news. scripts/have-news HEAD^ > have-news.md ``` diff --git a/scripts/get-released-tags b/scripts/get-released-tags index 8615f7d6147..adefbd38e54 100755 --- a/scripts/get-released-tags +++ b/scripts/get-released-tags @@ -5,7 +5,7 @@ otherTags= if test -z "$cmd"; then cmd=echo fi -for tag in $(git tag -l | grep -E '@[.0-9]+$'); do +for tag in $(git tag -l --contains HEAD | grep -E '@[0-9.]+(-[^.]*\.[0-9.]+)?$'); do case $tag in @agoric/sdk@*) sdkTags="$sdkTags $tag" ;; @agoric/cosmos@*) From 0a811f8e8d9e1e72a30d6e054580bd79d4a9f7ce Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 6 Dec 2023 15:19:00 -0800 Subject: [PATCH 12/58] chore(types): export timer types --- packages/time/index.js | 2 ++ packages/time/src/timeMath.js | 46 ++++++++++++++--------------------- packages/time/src/types.js | 2 ++ 3 files changed, 22 insertions(+), 28 deletions(-) create mode 100644 packages/time/src/types.js diff --git a/packages/time/index.js b/packages/time/index.js index 6a91734c5e7..bf6f74c6ceb 100644 --- a/packages/time/index.js +++ b/packages/time/index.js @@ -1,2 +1,4 @@ export * from './src/timeMath.js'; export * from './src/typeGuards.js'; +// eslint-disable-next-line import/export -- just types +export * from './src/types.js'; diff --git a/packages/time/src/timeMath.js b/packages/time/src/timeMath.js index ef676985184..d11edd057d8 100644 --- a/packages/time/src/timeMath.js +++ b/packages/time/src/timeMath.js @@ -3,23 +3,13 @@ import { mustMatch } from '@endo/patterns'; import { RelativeTimeRecordShape, TimestampRecordShape } from './typeGuards.js'; const { Fail, quote: q } = assert; -/** - * @typedef {import('@endo/marshal').RankComparison} RankComparison - * - * @typedef {import('./types').TimerBrand} TimerBrand - * @typedef {import('./types').Timestamp} Timestamp - * @typedef {import('./types').RelativeTime} RelativeTime - * @typedef {import('./types').RelativeTimeValue} RelativeTimeValue - * @typedef {import('./types').TimestampValue} TimestampValue - * @typedef {import('./types').TimeMathType} TimeMathType - */ /** * `agreedTimerBrand` is internal to this module. * - * @param {TimerBrand | undefined} leftBrand - * @param {TimerBrand | undefined} rightBrand - * @returns {TimerBrand | undefined} + * @param {import('./types').TimerBrand | undefined} leftBrand + * @param {import('./types').TimerBrand | undefined} rightBrand + * @returns {import('./types').TimerBrand | undefined} */ const agreedTimerBrand = (leftBrand, rightBrand) => { if (leftBrand === undefined) { @@ -44,9 +34,9 @@ const agreedTimerBrand = (leftBrand, rightBrand) => { * this logic. It does the error checking between the operands, and returns * the brand, if any, that should label the resulting time value. * - * @param {Timestamp | RelativeTime} left - * @param {Timestamp | RelativeTime} right - * @returns {TimerBrand | undefined} + * @param {import('./types').Timestamp | import('./types').RelativeTime} left + * @param {import('./types').Timestamp | import('./types').RelativeTime} right + * @returns {import('./types').TimerBrand | undefined} */ const sharedTimerBrand = (left, right) => { const leftBrand = typeof left === 'bigint' ? undefined : left.timerBrand; @@ -59,10 +49,10 @@ const sharedTimerBrand = (left, right) => { * operators in the case where the returned time should be a `Timestamp` * rather than a `RelativeTime`. * - * @param {Timestamp | RelativeTime} left - * @param {Timestamp | RelativeTime} right - * @param {TimestampValue} absValue - * @returns {Timestamp} + * @param {import('./types').Timestamp | import('./types').RelativeTime} left + * @param {import('./types').Timestamp | import('./types').RelativeTime} right + * @param {import('./types').TimestampValue} absValue + * @returns {import('./types').Timestamp} */ const absLike = (left, right, absValue) => { Nat(absValue); @@ -82,10 +72,10 @@ const absLike = (left, right, absValue) => { * operators in the case where the returned time should be a `RelativeTime` * rather than a `Timestamp`. * - * @param {Timestamp | RelativeTime} left - * @param {Timestamp | RelativeTime} right - * @param {RelativeTimeValue} relValue - * @returns {RelativeTime} + * @param {import('./types').Timestamp | import('./types').RelativeTime} left + * @param {import('./types').Timestamp | import('./types').RelativeTime} right + * @param {import('./types').RelativeTimeValue} relValue + * @returns {import('./types').RelativeTime} */ const relLike = (left, right, relValue) => { Nat(relValue); @@ -197,11 +187,11 @@ const modRelRel = (rel, step) => * `compareValues` is internal to this module, and used to implement * the time comparison operators. * - * @param {Timestamp | RelativeTime} left - * @param {Timestamp | RelativeTime} right + * @param {import('./types').Timestamp | import('./types').RelativeTime} left + * @param {import('./types').Timestamp | import('./types').RelativeTime} right * @param {bigint} v1 * @param {bigint} v2 - * @returns {RankComparison} + * @returns {import('@endo/marshal').RankComparison} */ const compareValues = (left, right, v1, v2) => { sharedTimerBrand(left, right); @@ -247,7 +237,7 @@ const compareValues = (left, right, v1, v2) => { * operand, and return a labeled time object with the brand of the labeled * operand. * - * @type {TimeMathType} + * @type {import('./types').TimeMathType} */ export const TimeMath = harden({ absValue, diff --git a/packages/time/src/types.js b/packages/time/src/types.js new file mode 100644 index 00000000000..cda223f55aa --- /dev/null +++ b/packages/time/src/types.js @@ -0,0 +1,2 @@ +// Empty JS file to correspond with types.d.ts +export {}; From 99f0ae4f81ef6375147c85c7c5169fa87b89b060 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 6 Dec 2023 15:20:49 -0800 Subject: [PATCH 13/58] chore(types): use @agoric/time type exports --- packages/SwingSet/src/vats/timer/vat-timer.js | 12 +++++----- packages/SwingSet/tools/manual-timer.js | 4 ++-- packages/agoric-cli/src/commands/auction.js | 2 +- packages/agoric-cli/src/commands/inter.js | 6 ++--- .../test/bootstrapTests/test-liquidation-1.ts | 2 +- .../test-liquidation-concurrent-1.ts | 2 +- .../test-walletSurvivesZoeRestart.ts | 2 +- packages/boot/tools/drivers.ts | 2 +- .../src/contractGovernance/governApi.js | 2 +- .../src/contractGovernance/governFilter.js | 2 +- .../src/contractGovernance/governParam.js | 2 +- .../src/contractGovernance/paramManager.js | 8 +++---- packages/governance/src/contractGovernor.js | 6 ++--- .../governance/src/contractGovernorKit.js | 2 +- packages/governance/src/electorateTools.js | 2 +- packages/governance/src/types-ambient.js | 22 +++++++++---------- .../committeeBinary/bootstrap.js | 4 ++-- .../tools/puppetContractGovernor.js | 2 +- .../inter-protocol/src/auction/auctioneer.js | 2 +- packages/inter-protocol/src/auction/params.js | 4 ++-- .../src/auction/scheduleMath.js | 2 +- .../inter-protocol/src/auction/scheduler.js | 8 +++---- packages/inter-protocol/src/feeDistributor.js | 4 ++-- packages/inter-protocol/src/interest.js | 4 ++-- .../src/price/fluxAggregatorContract.js | 2 +- .../src/price/fluxAggregatorKit.js | 10 ++++----- .../inter-protocol/src/price/roundsManager.js | 4 ++-- .../src/proposals/addAssetToVault.js | 2 +- .../src/vaultFactory/liquidation.js | 10 ++++----- .../inter-protocol/src/vaultFactory/params.js | 2 +- .../inter-protocol/src/vaultFactory/types.js | 8 +++---- .../src/vaultFactory/vaultDirector.js | 2 +- .../src/vaultFactory/vaultFactory.js | 2 +- .../src/vaultFactory/vaultManager.js | 2 +- .../test/auction/test-scheduler.js | 2 +- packages/inter-protocol/test/psm/setupPsm.js | 2 +- packages/inter-protocol/test/supports.js | 2 +- .../test/vaultFactory/test-vaultFactory.js | 2 +- .../vaultFactory/test-vaultLiquidation.js | 2 +- packages/vats/src/core/basic-behaviors.js | 2 +- packages/vats/src/core/types-ambient.d.ts | 2 +- packages/wallet/api/src/wallet.js | 2 +- .../zoe/src/contractSupport/priceAuthority.js | 4 +--- .../priceAuthorityTransform.js | 2 +- .../zoe/src/contractSupport/priceQuote.js | 2 +- packages/zoe/src/contracts/auction/index.js | 2 +- packages/zoe/src/contracts/loan/types.js | 12 +++++----- packages/zoe/src/contracts/loan/updateDebt.js | 2 +- packages/zoe/src/contracts/priceAggregator.js | 16 ++++++-------- packages/zoe/src/zoeService/types.js | 2 +- packages/zoe/tools/fakePriceAuthority.js | 12 +++++----- packages/zoe/tools/internal-types.js | 2 +- packages/zoe/tools/manualPriceAuthority.js | 2 +- packages/zoe/tools/manualTimer.js | 4 ++-- packages/zoe/tools/scriptedOracle.js | 2 +- packages/zoe/tools/scriptedPriceAuthority.js | 2 +- packages/zoe/tools/types-ambient.js | 10 ++++----- 57 files changed, 120 insertions(+), 124 deletions(-) diff --git a/packages/SwingSet/src/vats/timer/vat-timer.js b/packages/SwingSet/src/vats/timer/vat-timer.js index 06935fceef2..eee357a3896 100644 --- a/packages/SwingSet/src/vats/timer/vat-timer.js +++ b/packages/SwingSet/src/vats/timer/vat-timer.js @@ -20,12 +20,12 @@ import { TimeMath } from '@agoric/time'; // client). Everything else should remain in the DB. /** - * @typedef {import('@agoric/time/src/types').Timestamp} Timestamp - * @typedef {import('@agoric/time/src/types').TimestampRecord} TimestampRecord - * @typedef {import('@agoric/time/src/types').TimestampValue} TimestampValue - * @typedef {import('@agoric/time/src/types').RelativeTime} RelativeTime - * @typedef {import('@agoric/time/src/types').RelativeTimeValue} RelativeTimeValue - * @typedef {import('@agoric/time/src/types').TimerService} TimerService + * @typedef {import('@agoric/time').Timestamp} Timestamp + * @typedef {import('@agoric/time').TimestampRecord} TimestampRecord + * @typedef {import('@agoric/time').TimestampValue} TimestampValue + * @typedef {import('@agoric/time').RelativeTime} RelativeTime + * @typedef {import('@agoric/time').RelativeTimeValue} RelativeTimeValue + * @typedef {import('@agoric/time').TimerService} TimerService * * @typedef {object} Handler * Handler is a user-provided Far object with .wake(time) used for callbacks diff --git a/packages/SwingSet/tools/manual-timer.js b/packages/SwingSet/tools/manual-timer.js index d373f35e876..9d7ab7924fb 100644 --- a/packages/SwingSet/tools/manual-timer.js +++ b/packages/SwingSet/tools/manual-timer.js @@ -6,8 +6,8 @@ import { TimeMath } from '@agoric/time'; import { buildRootObject } from '../src/vats/timer/vat-timer.js'; /** - * @typedef {import('@agoric/time/src/types').Timestamp} Timestamp - * @typedef {import('@agoric/time/src/types').TimerService} TimerService + * @typedef {import('@agoric/time').Timestamp} Timestamp + * @typedef {import('@agoric/time').TimerService} TimerService * @typedef {import('../src/devices/timer/device-timer.js').Waker} Waker * * @typedef {object} ManualTimerCallbacks diff --git a/packages/agoric-cli/src/commands/auction.js b/packages/agoric-cli/src/commands/auction.js index fb10b58dc2c..d92f4933662 100644 --- a/packages/agoric-cli/src/commands/auction.js +++ b/packages/agoric-cli/src/commands/auction.js @@ -114,7 +114,7 @@ export const makeAuctionCommand = ( * but TimeMath.toRel prodocues a RelativeTime (which may be a bare bigint). * * @param {bigint} relValue - * @returns {import('@agoric/time/src/types').RelativeTimeRecord} + * @returns {import('@agoric/time').RelativeTimeRecord} */ const toRel = relValue => ({ timerBrand, relValue }); diff --git a/packages/agoric-cli/src/commands/inter.js b/packages/agoric-cli/src/commands/inter.js index 4ec10903c7d..56cc40d0ae6 100644 --- a/packages/agoric-cli/src/commands/inter.js +++ b/packages/agoric-cli/src/commands/inter.js @@ -65,12 +65,12 @@ const makeFormatters = assets => { r4(100 - (Number(r.numerator.value) / Number(r.denominator.value)) * 100); // XXX real TimeMath.absValue requires real Remotable timerBrand - /** @param {import('@agoric/time/src/types.js').Timestamp} ts */ + /** @param {import('@agoric/time').Timestamp} ts */ const absValue = ts => (typeof ts === 'bigint' ? ts : ts.absValue); - /** @param {import('@agoric/time/src/types.js').Timestamp} tr */ + /** @param {import('@agoric/time').Timestamp} tr */ const absTime = tr => new Date(Number(absValue(tr)) * 1000).toISOString(); - /** @param {import('@agoric/time/src/types.js').RelativeTimeRecord} tr */ + /** @param {import('@agoric/time').RelativeTimeRecord} tr */ const relTime = tr => new Date(Number(tr.relValue) * 1000).toISOString().slice(11, 19); diff --git a/packages/boot/test/bootstrapTests/test-liquidation-1.ts b/packages/boot/test/bootstrapTests/test-liquidation-1.ts index 0c88382cf70..7d3794528d4 100644 --- a/packages/boot/test/bootstrapTests/test-liquidation-1.ts +++ b/packages/boot/test/bootstrapTests/test-liquidation-1.ts @@ -256,7 +256,7 @@ const checkFlow1 = async ( { const { nextDescendingStepTime, nextStartTime } = readLatest( 'published.auction.schedule', - ) as Record; + ) as Record; t.is(nextDescendingStepTime.absValue, nextStartTime.absValue); } diff --git a/packages/boot/test/bootstrapTests/test-liquidation-concurrent-1.ts b/packages/boot/test/bootstrapTests/test-liquidation-concurrent-1.ts index c9aee5d2268..886cf9d212f 100644 --- a/packages/boot/test/bootstrapTests/test-liquidation-concurrent-1.ts +++ b/packages/boot/test/bootstrapTests/test-liquidation-concurrent-1.ts @@ -396,7 +396,7 @@ test('concurrent flow 1', async t => { /** * @type {Record< * string, - * import('@agoric/time/src/types.js').TimestampRecord + * import('@agoric/time').TimestampRecord * >} */ const { nextDescendingStepTime, nextStartTime } = readLatest( diff --git a/packages/boot/test/bootstrapTests/test-walletSurvivesZoeRestart.ts b/packages/boot/test/bootstrapTests/test-walletSurvivesZoeRestart.ts index c1fef632c27..60a5b36e7b2 100644 --- a/packages/boot/test/bootstrapTests/test-walletSurvivesZoeRestart.ts +++ b/packages/boot/test/bootstrapTests/test-walletSurvivesZoeRestart.ts @@ -277,7 +277,7 @@ const checkFlow1 = async ( { const { nextDescendingStepTime, nextStartTime } = readLatest( 'published.auction.schedule', - ) as Record; + ) as Record; t.is(nextDescendingStepTime.absValue, nextStartTime.absValue); } diff --git a/packages/boot/tools/drivers.ts b/packages/boot/tools/drivers.ts index 0f667d36e82..fb04aa0972b 100644 --- a/packages/boot/tools/drivers.ts +++ b/packages/boot/tools/drivers.ts @@ -20,7 +20,7 @@ import type { } from '@agoric/smart-wallet/src/smartWallet.js'; import type { WalletFactoryStartResult } from '@agoric/vats/src/core/startWalletFactory.js'; import type { OfferSpec } from '@agoric/smart-wallet/src/offers.js'; -import type { TimerService } from '@agoric/time/src/types.js'; +import type { TimerService } from '@agoric/time'; import type { OfferMaker } from '@agoric/smart-wallet/src/types.js'; import type { RunUtils } from '@agoric/swingset-vat/tools/run-utils.ts'; import type { SwingsetTestKit } from './supports.ts'; diff --git a/packages/governance/src/contractGovernance/governApi.js b/packages/governance/src/contractGovernance/governApi.js index afcbfcf73ee..3dd00a37405 100644 --- a/packages/governance/src/contractGovernance/governApi.js +++ b/packages/governance/src/contractGovernance/governApi.js @@ -30,7 +30,7 @@ const makeApiInvocationPositions = (apiMethodName, methodArgs) => { * * @param {ERef<{ [methodName: string]: (...args: any) => unknown }>} governedApis * @param {Array} governedNames names of the governed API methods - * @param {ERef} timer + * @param {ERef} timer * @param {() => Promise} getUpdatedPoserFacet * @returns {ApiGovernor} */ diff --git a/packages/governance/src/contractGovernance/governFilter.js b/packages/governance/src/contractGovernance/governFilter.js index 79384138cf4..9898434e8ce 100644 --- a/packages/governance/src/contractGovernance/governFilter.js +++ b/packages/governance/src/contractGovernance/governFilter.js @@ -26,7 +26,7 @@ const makeOfferFilterPositions = strings => { /** * Setup to allow governance to block some invitations. * - * @param {ERef} timer + * @param {ERef} timer * @param {() => Promise} getUpdatedPoserFacet * @param {GovernedCreatorFacet<{}>} governedCF * @returns {FilterGovernor} diff --git a/packages/governance/src/contractGovernance/governParam.js b/packages/governance/src/contractGovernance/governParam.js index c27c6d8032a..3b8623a5cda 100644 --- a/packages/governance/src/contractGovernance/governParam.js +++ b/packages/governance/src/contractGovernance/governParam.js @@ -54,7 +54,7 @@ const assertBallotConcernsParam = (paramSpec, questionSpec) => { /** * @param {ERef} paramManagerRetriever * @param {Instance} contractInstance - * @param {import('@agoric/time/src/types').TimerService} timer + * @param {import('@agoric/time').TimerService} timer * @param {() => Promise} getUpdatedPoserFacet * @returns {ParamGovernor} */ diff --git a/packages/governance/src/contractGovernance/paramManager.js b/packages/governance/src/contractGovernance/paramManager.js index feb03aca466..e300f67bfc1 100644 --- a/packages/governance/src/contractGovernance/paramManager.js +++ b/packages/governance/src/contractGovernance/paramManager.js @@ -47,8 +47,8 @@ const assertElectorateMatches = (paramManager, governedParams) => { * @property {(name: string, value: Ratio) => ParamManagerBuilder} addRatio * @property {(name: string, value: import('@endo/marshal').CopyRecord) => ParamManagerBuilder} addRecord * @property {(name: string, value: string) => ParamManagerBuilder} addString - * @property {(name: string, value: import('@agoric/time/src/types').Timestamp) => ParamManagerBuilder} addTimestamp - * @property {(name: string, value: import('@agoric/time/src/types').RelativeTime) => ParamManagerBuilder} addRelativeTime + * @property {(name: string, value: import('@agoric/time').Timestamp) => ParamManagerBuilder} addTimestamp + * @property {(name: string, value: import('@agoric/time').RelativeTime) => ParamManagerBuilder} addRelativeTime * @property {(name: string, value: any) => ParamManagerBuilder} addUnknown * @property {() => AnyParamManager} build */ @@ -197,13 +197,13 @@ const makeParamManagerBuilder = (publisherKit, zoe) => { return builder; }; - /** @type {(name: string, value: import('@agoric/time/src/types').Timestamp, builder: ParamManagerBuilder) => ParamManagerBuilder} */ + /** @type {(name: string, value: import('@agoric/time').Timestamp, builder: ParamManagerBuilder) => ParamManagerBuilder} */ const addTimestamp = (name, value, builder) => { buildCopyParam(name, value, assertTimestamp, ParamTypes.TIMESTAMP); return builder; }; - /** @type {(name: string, value: import('@agoric/time/src/types').RelativeTime, builder: ParamManagerBuilder) => ParamManagerBuilder} */ + /** @type {(name: string, value: import('@agoric/time').RelativeTime, builder: ParamManagerBuilder) => ParamManagerBuilder} */ const addRelativeTime = (name, value, builder) => { buildCopyParam(name, value, assertRelativeTime, ParamTypes.RELATIVE_TIME); return builder; diff --git a/packages/governance/src/contractGovernor.js b/packages/governance/src/contractGovernor.js index bd18551d16c..6282d561013 100644 --- a/packages/governance/src/contractGovernor.js +++ b/packages/governance/src/contractGovernor.js @@ -68,7 +68,7 @@ harden(validateQuestionFromCounter); /** * @typedef {StandardTerms} ContractGovernorTerms - * @property {import('@agoric/time/src/types').TimerService} timer + * @property {import('@agoric/time').TimerService} timer * @property {Installation} governedContractInstallation */ @@ -122,7 +122,7 @@ harden(validateQuestionFromCounter); * GovernorPublic, * GovernorCreatorFacet, * { - * timer: import('@agoric/time/src/types').TimerService, + * timer: import('@agoric/time').TimerService, * governedContractInstallation: Installation, * governed: { * issuerKeywordRecord: IssuerKeywordRecord, @@ -136,7 +136,7 @@ harden(validateQuestionFromCounter); * * @template {GovernableStartFn} SF Start function of governed contract * @param {ZCF<{ - * timer: import('@agoric/time/src/types').TimerService, + * timer: import('@agoric/time').TimerService, * governedContractInstallation: Installation, * governed: { * issuerKeywordRecord: IssuerKeywordRecord, diff --git a/packages/governance/src/contractGovernorKit.js b/packages/governance/src/contractGovernorKit.js index 1a9451d465d..1f5f5d900d3 100644 --- a/packages/governance/src/contractGovernorKit.js +++ b/packages/governance/src/contractGovernorKit.js @@ -15,7 +15,7 @@ const trace = makeTracer('CGK', false); * * @param {import('@agoric/vat-data').Baggage} baggage * @param {{ - * timer: import('@agoric/time/src/types').TimerService, + * timer: import('@agoric/time').TimerService, * zoe: ERef, * }} powers */ diff --git a/packages/governance/src/electorateTools.js b/packages/governance/src/electorateTools.js index 9e9d73d61fd..ecb8cd2424d 100644 --- a/packages/governance/src/electorateTools.js +++ b/packages/governance/src/electorateTools.js @@ -6,7 +6,7 @@ import { deeplyFulfilled, Far } from '@endo/marshal'; * @typedef {object} QuestionRecord * @property {ERef} voteCap * @property {VoteCounterPublicFacet} publicFacet - * @property {import('@agoric/time/src/types').Timestamp} deadline + * @property {import('@agoric/time').Timestamp} deadline */ /** diff --git a/packages/governance/src/types-ambient.js b/packages/governance/src/types-ambient.js index 10491bd7b3a..f00741ead26 100644 --- a/packages/governance/src/types-ambient.js +++ b/packages/governance/src/types-ambient.js @@ -31,8 +31,8 @@ /** * @typedef { Amount | Brand | Installation | Instance | bigint | - * Ratio | string | import('@agoric/time/src/types').TimestampRecord | - * import('@agoric/time/src/types').RelativeTimeRecord | unknown } ParamValue + * Ratio | string | import('@agoric/time').TimestampRecord | + * import('@agoric/time').RelativeTimeRecord | unknown } ParamValue */ // XXX better to use the manifest constant ParamTypes @@ -331,8 +331,8 @@ /** * @typedef {object} ClosingRule - * @property {ERef} timer - * @property {import('@agoric/time/src/types').Timestamp} deadline + * @property {ERef} timer + * @property {import('@agoric/time').Timestamp} deadline */ /** @@ -346,7 +346,7 @@ * @property {VoteCounterPublicFacet} publicFacet * @property {VoteCounterCreatorFacet} creatorFacet * @property {import('@agoric/zoe/src/zoeService/utils.js').Instance} instance - * @property {import('@agoric/time/src/types').Timestamp} deadline + * @property {import('@agoric/time').Timestamp} deadline * @property {Handle<'Question'>} questionHandle */ @@ -430,8 +430,8 @@ * @property {(name: string) => bigint} getNat * @property {(name: string) => Ratio} getRatio * @property {(name: string) => string} getString - * @property {(name: string) => import('@agoric/time/src/types').TimestampRecord} getTimestamp - * @property {(name: string) => import('@agoric/time/src/types').RelativeTimeRecord} getRelativeTime + * @property {(name: string) => import('@agoric/time').TimestampRecord} getTimestamp + * @property {(name: string) => import('@agoric/time').RelativeTimeRecord} getRelativeTime * @property {(name: string) => any} getUnknown * @property {(name: string, proposedValue: ParamValue) => ParamValue} getVisibleValue - for * most types, the visible value is the same as proposedValue. For Invitations @@ -613,7 +613,7 @@ * * @callback VoteOnParamChanges * @param {Installation} voteCounterInstallation - * @param {import('@agoric/time/src/types').Timestamp} deadline + * @param {import('@agoric/time').Timestamp} deadline * @param {ParamChangesSpec

} paramSpec * @returns {Promise} */ @@ -623,14 +623,14 @@ * @param {string} apiMethodName * @param {unknown[]} methodArgs * @param {Installation} voteCounterInstallation - * @param {import('@agoric/time/src/types').Timestamp} deadline + * @param {import('@agoric/time').Timestamp} deadline * @returns {Promise} */ /** * @callback VoteOnOfferFilter * @param {Installation} voteCounterInstallation - * @param {import('@agoric/time/src/types').Timestamp} deadline + * @param {import('@agoric/time').Timestamp} deadline * @param {string[]} strings * @returns {Promise} */ @@ -669,7 +669,7 @@ /** * @typedef {object} GovernedContractTerms - * @property {import('@agoric/time/src/types').TimerService} timer + * @property {import('@agoric/time').TimerService} timer * @property {IssuerKeywordRecord} issuerKeywordRecord * @property {object} privateArgs */ diff --git a/packages/governance/test/swingsetTests/committeeBinary/bootstrap.js b/packages/governance/test/swingsetTests/committeeBinary/bootstrap.js index 06f12bba858..dd7d527cf40 100644 --- a/packages/governance/test/swingsetTests/committeeBinary/bootstrap.js +++ b/packages/governance/test/swingsetTests/committeeBinary/bootstrap.js @@ -21,8 +21,8 @@ const makeVoterVat = async (log, vats, zoe) => { /** * @param {Pick} qDetails - * @param {import('@agoric/time/src/types').Timestamp} closingTime - * @param {{ electorateFacet: import('../../../src/committee.js').CommitteeElectorateCreatorFacet, installations: Record, timer: import('@agoric/time/src/types').TimerService }} tools + * @param {import('@agoric/time').Timestamp} closingTime + * @param {{ electorateFacet: import('../../../src/committee.js').CommitteeElectorateCreatorFacet, installations: Record, timer: import('@agoric/time').TimerService }} tools * @param {*} quorumRule */ const createQuestion = async (qDetails, closingTime, tools, quorumRule) => { diff --git a/packages/governance/tools/puppetContractGovernor.js b/packages/governance/tools/puppetContractGovernor.js index 65fdda0126f..8e92a86cb89 100644 --- a/packages/governance/tools/puppetContractGovernor.js +++ b/packages/governance/tools/puppetContractGovernor.js @@ -17,7 +17,7 @@ import { makeApiInvocationPositions } from '../src/contractGovernance/governApi. /** * @template {GovernableStartFn} SF Start function of governed contract * @param {ZCF<{ - * timer: import('@agoric/time/src/types').TimerService, + * timer: import('@agoric/time').TimerService, * governedContractInstallation: Installation, * governed: { * issuerKeywordRecord?: IssuerKeywordRecord, diff --git a/packages/inter-protocol/src/auction/auctioneer.js b/packages/inter-protocol/src/auction/auctioneer.js index 7a705398dc3..c894964159f 100644 --- a/packages/inter-protocol/src/auction/auctioneer.js +++ b/packages/inter-protocol/src/auction/auctioneer.js @@ -383,7 +383,7 @@ export const distributeProportionalSharesWithLimits = ( /** * @param {ZCF< * GovernanceTerms & { - * timerService: import('@agoric/time/src/types').TimerService; + * timerService: import('@agoric/time').TimerService; * reservePublicFacet: AssetReservePublicFacet; * priceAuthority: PriceAuthority; * } diff --git a/packages/inter-protocol/src/auction/params.js b/packages/inter-protocol/src/auction/params.js index 3e6ab5e581c..a49ecc38ef8 100644 --- a/packages/inter-protocol/src/auction/params.js +++ b/packages/inter-protocol/src/auction/params.js @@ -70,7 +70,7 @@ export const auctioneerParamTypes = harden({ * @property {bigint} DiscountStep * @property {RelativeTime} AuctionStartDelay * @property {RelativeTime} PriceLockPeriod - * @property {import('@agoric/time/src/types').TimerBrand} TimerBrand + * @property {import('@agoric/time').TimerBrand} TimerBrand */ /** @param {AuctionParams} initial */ @@ -147,7 +147,7 @@ harden(makeAuctioneerParamManager); /** * @param {{ storageNode: ERef; marshaller: ERef }} caps - * @param {ERef} timer + * @param {ERef} timer * @param {ERef} priceAuthority * @param {ERef} reservePublicFacet * @param {AuctionParams} params diff --git a/packages/inter-protocol/src/auction/scheduleMath.js b/packages/inter-protocol/src/auction/scheduleMath.js index f6e53602c47..85a00fb0ee0 100644 --- a/packages/inter-protocol/src/auction/scheduleMath.js +++ b/packages/inter-protocol/src/auction/scheduleMath.js @@ -83,7 +83,7 @@ export const computeRoundTiming = (params, baseTime) => { // computed start is `startDelay + baseTime + freq - (baseTime mod freq)`. // That is, if there are hourly starts, we add an hour to the time, and // subtract baseTime mod freq. Then we add the delay. - /** @type {import('@agoric/time/src/types').TimestampRecord} */ + /** @type {import('@agoric/time').TimestampRecord} */ const startTime = TimeMath.addAbsRel( TimeMath.addAbsRel( baseTime, diff --git a/packages/inter-protocol/src/auction/scheduler.js b/packages/inter-protocol/src/auction/scheduler.js index bf05a3c2f94..e78d8645a97 100644 --- a/packages/inter-protocol/src/auction/scheduler.js +++ b/packages/inter-protocol/src/auction/scheduler.js @@ -71,9 +71,9 @@ const nominalStartTime = nextSchedule => /** * @param {AuctionDriver} auctionDriver - * @param {import('@agoric/time/src/types').TimerService} timer + * @param {import('@agoric/time').TimerService} timer * @param {Awaited} params - * @param {import('@agoric/time/src/types').TimerBrand} timerBrand + * @param {import('@agoric/time').TimerBrand} timerBrand * @param {import('@agoric/zoe/src/contractSupport/recorder.js').Recorder} scheduleRecorder * @param {StoredSubscription} paramUpdateSubscription */ @@ -362,8 +362,8 @@ export const makeScheduler = async ( /** * @typedef {object} Schedule - * @property {import('@agoric/time/src/types').TimestampRecord} startTime - * @property {import('@agoric/time/src/types').TimestampRecord} endTime + * @property {import('@agoric/time').TimestampRecord} startTime + * @property {import('@agoric/time').TimestampRecord} endTime * @property {NatValue} steps * @property {NatValue} endRate * @property {RelativeTime} startDelay diff --git a/packages/inter-protocol/src/feeDistributor.js b/packages/inter-protocol/src/feeDistributor.js index 7afb625adf3..ddffa8bb322 100644 --- a/packages/inter-protocol/src/feeDistributor.js +++ b/packages/inter-protocol/src/feeDistributor.js @@ -20,9 +20,9 @@ export const meta = { harden(meta); /** - * @typedef {import('@agoric/time/src/types').RelativeTime} RelativeTime + * @typedef {import('@agoric/time').RelativeTime} RelativeTime * - * @typedef {import('@agoric/time/src/types').TimerService} TimerService + * @typedef {import('@agoric/time').TimerService} TimerService */ /** diff --git a/packages/inter-protocol/src/interest.js b/packages/inter-protocol/src/interest.js index 1edd1e851ad..677073d8229 100644 --- a/packages/inter-protocol/src/interest.js +++ b/packages/inter-protocol/src/interest.js @@ -11,9 +11,9 @@ import { Fail } from '@agoric/assert'; import { TimeMath } from '@agoric/time'; /** - * @typedef {import('@agoric/time/src/types').Timestamp} Timestamp + * @typedef {import('@agoric/time').Timestamp} Timestamp * - * @typedef {import('@agoric/time/src/types').RelativeTime} RelativeTime + * @typedef {import('@agoric/time').RelativeTime} RelativeTime */ export const SECONDS_PER_YEAR = 60n * 60n * 24n * 365n; diff --git a/packages/inter-protocol/src/price/fluxAggregatorContract.js b/packages/inter-protocol/src/price/fluxAggregatorContract.js index f7672c268ed..d8050c26a18 100644 --- a/packages/inter-protocol/src/price/fluxAggregatorContract.js +++ b/packages/inter-protocol/src/price/fluxAggregatorContract.js @@ -15,7 +15,7 @@ const trace = makeTracer('FluxAgg', false); /** * @typedef {import('@agoric/vat-data').Baggage} Baggage * - * @typedef {import('@agoric/time/src/types').TimerService} TimerService + * @typedef {import('@agoric/time').TimerService} TimerService */ /** @type {ContractMeta} */ diff --git a/packages/inter-protocol/src/price/fluxAggregatorKit.js b/packages/inter-protocol/src/price/fluxAggregatorKit.js index 038816a59f9..39601167799 100644 --- a/packages/inter-protocol/src/price/fluxAggregatorKit.js +++ b/packages/inter-protocol/src/price/fluxAggregatorKit.js @@ -25,14 +25,14 @@ export const INVITATION_MAKERS_DESC = 'oracle invitation'; /** * @typedef {import('@agoric/vat-data').Baggage} Baggage * - * @typedef {import('@agoric/time/src/types').Timestamp} Timestamp + * @typedef {import('@agoric/time').Timestamp} Timestamp * - * @typedef {import('@agoric/time/src/types').RelativeTime} RelativeTime // - * TODO: use RelativeTime, not RelativeTimeValue + * @typedef {import('@agoric/time').RelativeTime} RelativeTime // TODO: use + * RelativeTime, not RelativeTimeValue * - * @typedef {import('@agoric/time/src/types').RelativeTimeValue} RelativeTimeValue + * @typedef {import('@agoric/time').RelativeTimeValue} RelativeTimeValue * - * @typedef {import('@agoric/time/src/types').TimerService} TimerService + * @typedef {import('@agoric/time').TimerService} TimerService */ /** @type {(quote: PriceQuote) => PriceDescription} */ diff --git a/packages/inter-protocol/src/price/roundsManager.js b/packages/inter-protocol/src/price/roundsManager.js index 0347ab4d48b..30fed5827d8 100644 --- a/packages/inter-protocol/src/price/roundsManager.js +++ b/packages/inter-protocol/src/price/roundsManager.js @@ -16,9 +16,9 @@ const { add, subtract, multiply, floorDivide, ceilDivide, isGTE } = natSafeMath; /** @typedef {import('./priceOracleKit.js').OracleStatus} OracleStatus */ /** - * @typedef {import('@agoric/time/src/types').Timestamp} Timestamp + * @typedef {import('@agoric/time').Timestamp} Timestamp * - * @typedef {import('@agoric/time/src/types').TimerService} TimerService + * @typedef {import('@agoric/time').TimerService} TimerService */ /** @type {string} */ diff --git a/packages/inter-protocol/src/proposals/addAssetToVault.js b/packages/inter-protocol/src/proposals/addAssetToVault.js index d2b41dac909..c448b76632b 100644 --- a/packages/inter-protocol/src/proposals/addAssetToVault.js +++ b/packages/inter-protocol/src/proposals/addAssetToVault.js @@ -252,7 +252,7 @@ const COMPLETION = 20n * 60n; * is far enough away, else 5) run after endTime * * @param {import('../auction/scheduler.js').FullSchedule} schedules - * @param {ERef} timer + * @param {ERef} timer * @param {() => void} thunk */ const whenQuiescent = async (schedules, timer, thunk) => { diff --git a/packages/inter-protocol/src/vaultFactory/liquidation.js b/packages/inter-protocol/src/vaultFactory/liquidation.js index cf0241696dc..f4863cf5713 100644 --- a/packages/inter-protocol/src/vaultFactory/liquidation.js +++ b/packages/inter-protocol/src/vaultFactory/liquidation.js @@ -13,10 +13,10 @@ import { makeCancelTokenMaker } from '../auction/util.js'; const trace = makeTracer('LIQ'); -/** @typedef {import('@agoric/time/src/types').TimerService} TimerService */ -/** @typedef {import('@agoric/time/src/types').TimerWaker} TimerWaker */ -/** @typedef {import('@agoric/time/src/types').CancelToken} CancelToken */ -/** @typedef {import('@agoric/time/src/types').RelativeTimeRecord} RelativeTimeRecord */ +/** @typedef {import('@agoric/time').TimerService} TimerService */ +/** @typedef {import('@agoric/time').TimerWaker} TimerWaker */ +/** @typedef {import('@agoric/time').CancelToken} CancelToken */ +/** @typedef {import('@agoric/time').RelativeTimeRecord} RelativeTimeRecord */ const makeCancelToken = makeCancelTokenMaker('liq'); @@ -65,7 +65,7 @@ const cancelWakeups = timer => { * @param {TimerWaker} opts.liquidationWaker * @param {TimerWaker} opts.reschedulerWaker * @param {import('../auction/scheduler.js').Schedule} opts.nextAuctionSchedule - * @param {import('@agoric/time/src/types').TimestampRecord} opts.now + * @param {import('@agoric/time').TimestampRecord} opts.now * @param {ParamStateRecord} opts.params * @returns {void} */ diff --git a/packages/inter-protocol/src/vaultFactory/params.js b/packages/inter-protocol/src/vaultFactory/params.js index f4c24d56e26..39387f98c2d 100644 --- a/packages/inter-protocol/src/vaultFactory/params.js +++ b/packages/inter-protocol/src/vaultFactory/params.js @@ -131,7 +131,7 @@ export const vaultParamPattern = M.splitRecord( * minInitialDebt: Amount<'nat'>; * bootstrapPaymentValue: bigint; * priceAuthority: ERef; - * timer: ERef; + * timer: ERef; * reservePublicFacet: AssetReservePublicFacet; * interestTiming: InterestTiming; * shortfallInvitationAmount: Amount<'set'>; diff --git a/packages/inter-protocol/src/vaultFactory/types.js b/packages/inter-protocol/src/vaultFactory/types.js index c2a6a07c53c..2dd51b986c8 100644 --- a/packages/inter-protocol/src/vaultFactory/types.js +++ b/packages/inter-protocol/src/vaultFactory/types.js @@ -19,9 +19,9 @@ * * @typedef {import('./vaultFactory.js').VaultFactoryContract['publicFacet']} VaultFactoryPublicFacet * - * @typedef {import('@agoric/time/src/types').Timestamp} Timestamp + * @typedef {import('@agoric/time').Timestamp} Timestamp * - * @typedef {import('@agoric/time/src/types').RelativeTime} RelativeTime + * @typedef {import('@agoric/time').RelativeTime} RelativeTime */ /** @@ -58,8 +58,8 @@ * @property {AddVaultType} addVaultType * @property {() => Allocation} getRewardAllocation * @property {() => Promise>} makeCollectFeesInvitation - * @property {() => import('@agoric/time/src/types').TimerWaker} makeLiquidationWaker - * @property {() => import('@agoric/time/src/types').TimerWaker} makePriceLockWaker + * @property {() => import('@agoric/time').TimerWaker} makeLiquidationWaker + * @property {() => import('@agoric/time').TimerWaker} makePriceLockWaker */ /** diff --git a/packages/inter-protocol/src/vaultFactory/vaultDirector.js b/packages/inter-protocol/src/vaultFactory/vaultDirector.js index 91773fab949..2dfcbf5a9d8 100644 --- a/packages/inter-protocol/src/vaultFactory/vaultDirector.js +++ b/packages/inter-protocol/src/vaultFactory/vaultDirector.js @@ -81,7 +81,7 @@ const shortfallInvitationKey = 'shortfallInvitation'; * @param {import('./vaultFactory.js').VaultFactoryZCF} zcf * @param {VaultDirectorParamManager} directorParamManager * @param {ZCFMint<'nat'>} debtMint - * @param {ERef} timer + * @param {ERef} timer * @param {ERef} auctioneer * @param {ERef} storageNode * @param {ERef} marshaller diff --git a/packages/inter-protocol/src/vaultFactory/vaultFactory.js b/packages/inter-protocol/src/vaultFactory/vaultFactory.js index a2af199ff3e..9852c781e19 100644 --- a/packages/inter-protocol/src/vaultFactory/vaultFactory.js +++ b/packages/inter-protocol/src/vaultFactory/vaultFactory.js @@ -39,7 +39,7 @@ const trace = makeTracer('VF', true); * auctioneerPublicFacet: import('../auction/auctioneer.js').AuctioneerPublicFacet; * priceAuthority: ERef; * reservePublicFacet: AssetReservePublicFacet; - * timerService: import('@agoric/time/src/types').TimerService; + * timerService: import('@agoric/time').TimerService; * } * >} VaultFactoryZCF */ diff --git a/packages/inter-protocol/src/vaultFactory/vaultManager.js b/packages/inter-protocol/src/vaultFactory/vaultManager.js index dd9daf9efee..5021e41968c 100644 --- a/packages/inter-protocol/src/vaultFactory/vaultManager.js +++ b/packages/inter-protocol/src/vaultFactory/vaultManager.js @@ -70,7 +70,7 @@ const { details: X, Fail, quote: q } = assert; const trace = makeTracer('VM'); /** @typedef {import('./storeUtils.js').NormalizedDebt} NormalizedDebt */ -/** @typedef {import('@agoric/time/src/types').RelativeTime} RelativeTime */ +/** @typedef {import('@agoric/time').RelativeTime} RelativeTime */ // Metrics naming scheme: nouns are present values; past-participles are accumulative. /** diff --git a/packages/inter-protocol/test/auction/test-scheduler.js b/packages/inter-protocol/test/auction/test-scheduler.js index e33d5bddf7f..8591e15317e 100644 --- a/packages/inter-protocol/test/auction/test-scheduler.js +++ b/packages/inter-protocol/test/auction/test-scheduler.js @@ -22,7 +22,7 @@ import { setUpInstallations, } from './tools.js'; -/** @typedef {import('@agoric/time/src/types').TimerService} TimerService */ +/** @typedef {import('@agoric/time').TimerService} TimerService */ test('schedule start to finish', async t => { const { zcf, zoe } = await setupZCFTest(); diff --git a/packages/inter-protocol/test/psm/setupPsm.js b/packages/inter-protocol/test/psm/setupPsm.js index 2da66c5e8d7..089ec7da275 100644 --- a/packages/inter-protocol/test/psm/setupPsm.js +++ b/packages/inter-protocol/test/psm/setupPsm.js @@ -25,7 +25,7 @@ const charterRoot = './src/econCommitteeCharter.js'; // package relative /** @typedef {ReturnType} FarZoeKit */ /** - * @param {import('@agoric/time/src/types').TimerService} timer + * @param {import('@agoric/time').TimerService} timer * @param {FarZoeKit} [farZoeKit] */ export const setupPsmBootstrap = async ( diff --git a/packages/inter-protocol/test/supports.js b/packages/inter-protocol/test/supports.js index 33db77e4a49..dc6e707ece7 100644 --- a/packages/inter-protocol/test/supports.js +++ b/packages/inter-protocol/test/supports.js @@ -55,7 +55,7 @@ harden(setUpZoeForTest); /** * @param {any} t - * @param {import('@agoric/time/src/types').TimerService} [optTimer] + * @param {import('@agoric/time').TimerService} [optTimer] */ export const setupBootstrap = async (t, optTimer) => { const trace = makeTracer('PromiseSpace', false); diff --git a/packages/inter-protocol/test/vaultFactory/test-vaultFactory.js b/packages/inter-protocol/test/vaultFactory/test-vaultFactory.js index f5b77c41813..62da14d5e70 100644 --- a/packages/inter-protocol/test/vaultFactory/test-vaultFactory.js +++ b/packages/inter-protocol/test/vaultFactory/test-vaultFactory.js @@ -128,7 +128,7 @@ test.before(async t => { * @param {import('ava').ExecutionContext} t * @param {NatValue[] | Ratio} priceOrList * @param {Amount | undefined} unitAmountIn - * @param {import('@agoric/time/src/types').TimerService} timer + * @param {import('@agoric/time').TimerService} timer * @param {RelativeTime} quoteInterval * @param {bigint} stableInitialLiquidity * @param {bigint} [startFrequency] diff --git a/packages/inter-protocol/test/vaultFactory/test-vaultLiquidation.js b/packages/inter-protocol/test/vaultFactory/test-vaultLiquidation.js index 80dfcb83268..325fb356178 100644 --- a/packages/inter-protocol/test/vaultFactory/test-vaultLiquidation.js +++ b/packages/inter-protocol/test/vaultFactory/test-vaultLiquidation.js @@ -126,7 +126,7 @@ test.before(async t => { * @param {import('ava').ExecutionContext} t * @param {NatValue[] | Ratio} priceOrList * @param {Amount | undefined} unitAmountIn - * @param {import('@agoric/time/src/types').TimerService} timer + * @param {import('@agoric/time').TimerService} timer * @param {RelativeTime} quoteInterval * @param {bigint} stableInitialLiquidity * @param {Partial} [auctionParams] diff --git a/packages/vats/src/core/basic-behaviors.js b/packages/vats/src/core/basic-behaviors.js index 11053f847bd..ec0abbc0c7c 100644 --- a/packages/vats/src/core/basic-behaviors.js +++ b/packages/vats/src/core/basic-behaviors.js @@ -175,7 +175,7 @@ harden(produceStartUpgradable); * }} zoeArgs * @param {{ * governedParams: Record; - * timer: ERef; + * timer: ERef; * contractGovernor: ERef; * economicCommitteeCreatorFacet: import('@agoric/inter-protocol/src/proposals/econ-behaviors.js').EconomyBootstrapPowers['consume']['economicCommitteeCreatorFacet']; * }} govArgs diff --git a/packages/vats/src/core/types-ambient.d.ts b/packages/vats/src/core/types-ambient.d.ts index 7c940e2450e..bc58c45deb6 100644 --- a/packages/vats/src/core/types-ambient.d.ts +++ b/packages/vats/src/core/types-ambient.d.ts @@ -316,7 +316,7 @@ type ChainBootstrapSpaceT = { board: import('@agoric/vats').Board; bridgeManager: import('../types.js').BridgeManager | undefined; chainStorage: StorageNode | null; - chainTimerService: import('@agoric/time/src/types').TimerService; + chainTimerService: import('@agoric/time').TimerService; client: ClientManager; clientCreator: any; coreEvalBridgeHandler: import('../types.js').BridgeHandler; diff --git a/packages/wallet/api/src/wallet.js b/packages/wallet/api/src/wallet.js index 827ae8410f2..dcad8f0b3bc 100644 --- a/packages/wallet/api/src/wallet.js +++ b/packages/wallet/api/src/wallet.js @@ -26,7 +26,7 @@ import './internal-types.js'; * board: ERef, * cacheStorageNode: ERef, * localTimerPollInterval?: bigint, - * localTimerService?: import('@agoric/time/src/types').TimerService, + * localTimerService?: import('@agoric/time').TimerService, * myAddressNameAdmin: ERef, * namesByAddress: ERef, * timerDevice?: unknown, diff --git a/packages/zoe/src/contractSupport/priceAuthority.js b/packages/zoe/src/contractSupport/priceAuthority.js index c1e8fd58050..3bc8680c90f 100644 --- a/packages/zoe/src/contractSupport/priceAuthority.js +++ b/packages/zoe/src/contractSupport/priceAuthority.js @@ -1,6 +1,4 @@ /* eslint @typescript-eslint/no-floating-promises: "warn" */ -/// - import { E } from '@endo/eventual-send'; import { Far } from '@endo/marshal'; import { assert, q, Fail } from '@agoric/assert'; @@ -64,7 +62,7 @@ export const PriceAuthorityI = M.interface('PriceAuthority', { * @param {object} opts * @param {Issuer<'set'>} opts.quoteIssuer * @param {ERef>} opts.notifier - * @param {ERef} opts.timer + * @param {ERef} opts.timer * @param {PriceQuoteCreate} opts.createQuote * @param {Brand<'nat'>} opts.actualBrandIn * @param {Brand<'nat'>} opts.actualBrandOut diff --git a/packages/zoe/src/contractSupport/priceAuthorityTransform.js b/packages/zoe/src/contractSupport/priceAuthorityTransform.js index ba5b98b50dd..de7a8feff13 100644 --- a/packages/zoe/src/contractSupport/priceAuthorityTransform.js +++ b/packages/zoe/src/contractSupport/priceAuthorityTransform.js @@ -10,7 +10,7 @@ import { makeNotifier } from '@agoric/notifier'; * @param {Brand<'set'>} quoteBrand * @param {Amount<'nat'>} amountIn * @param {Amount<'nat'>} amountOut - * @param {ERef} timer + * @param {ERef} timer * @param {import('@agoric/time').Timestamp} timestamp * @param {ERef>} quoteMint * @returns {Promise} diff --git a/packages/zoe/src/contractSupport/priceQuote.js b/packages/zoe/src/contractSupport/priceQuote.js index 71422ed682d..341712b43f5 100644 --- a/packages/zoe/src/contractSupport/priceQuote.js +++ b/packages/zoe/src/contractSupport/priceQuote.js @@ -25,7 +25,7 @@ export const getPriceDescription = quote => { export const getAmountIn = quote => getPriceDescription(quote).amountIn; /** @param {PriceQuote} quote */ export const getAmountOut = quote => getPriceDescription(quote).amountOut; -/** @type {(quote: PriceQuote) => import('@agoric/time/src/types').Timestamp} */ +/** @type {(quote: PriceQuote) => import('@agoric/time').Timestamp} */ export const getTimestamp = quote => getPriceDescription(quote).timestamp; /** @param {Brand<'nat'>} brand */ diff --git a/packages/zoe/src/contracts/auction/index.js b/packages/zoe/src/contracts/auction/index.js index 0f7d89ef4b4..cfeed7ca0b9 100644 --- a/packages/zoe/src/contracts/auction/index.js +++ b/packages/zoe/src/contracts/auction/index.js @@ -37,7 +37,7 @@ const SECOND_PRICE = 'second-price'; * null } want: { Asset: null } }. * * @param {ZCF<{ - * timeAuthority: import('@agoric/time/src/types').TimerService, + * timeAuthority: import('@agoric/time').TimerService, * winnerPriceOption?: FIRST_PRICE | SECOND_PRICE, * bidDuration: bigint, * }>} zcf diff --git a/packages/zoe/src/contracts/loan/types.js b/packages/zoe/src/contracts/loan/types.js index 9c0f17e3ca7..3afe3611302 100644 --- a/packages/zoe/src/contracts/loan/types.js +++ b/packages/zoe/src/contracts/loan/types.js @@ -1,5 +1,5 @@ /** - * @typedef {Notifier} PeriodNotifier + * @typedef {Notifier} PeriodNotifier * * The Notifier that provides notifications that periods have passed. * Since notifiers can't be relied on to produce an output every time @@ -35,7 +35,7 @@ * The rate in basis points that will be multiplied with the debt on * every period to compound interest. * - * @property {import('@agoric/time/src/types').RelativeTime} interestPeriod + * @property {import('@agoric/time').RelativeTime} interestPeriod * * @property {Brand} loanBrand * @property {Brand} collateralBrand @@ -162,14 +162,14 @@ * The AsyncIterable to notify when a period has occurred * * @property {Ratio} interestRate - * @property {import('@agoric/time/src/types').RelativeTime} interestPeriod + * @property {import('@agoric/time').RelativeTime} interestPeriod * * the period at which the outstanding debt increases by the interestRate * * @property {ZCF} zcf * * @property {LoanConfigWithBorrowerMinusDebt} configMinusGetDebt - * @property {import('@agoric/time/src/types').Timestamp} basetime The starting point from which to calculate + * @property {import('@agoric/time').Timestamp} basetime The starting point from which to calculate * interest. */ @@ -182,7 +182,7 @@ * @property {PriceAuthority} priceAuthority * @property {PeriodNotifier} periodNotifier * @property {bigint} interestRate - * @property {import('@agoric/time/src/types').RelativeTime} interestPeriod + * @property {import('@agoric/time').RelativeTime} interestPeriod * @property {ZCFSeat} lenderSeat */ @@ -205,7 +205,7 @@ * triggered the liquidation. This may be lower than expected if the * price is moving quickly. * - * @property {() => import('@agoric/time/src/types').Timestamp} getLastCalculationTimestamp + * @property {() => import('@agoric/time').Timestamp} getLastCalculationTimestamp * * Get the timestamp at which the debt was most recently recalculated. * diff --git a/packages/zoe/src/contracts/loan/updateDebt.js b/packages/zoe/src/contracts/loan/updateDebt.js index fb35383413b..94c4678e405 100644 --- a/packages/zoe/src/contracts/loan/updateDebt.js +++ b/packages/zoe/src/contracts/loan/updateDebt.js @@ -45,7 +45,7 @@ export const makeDebtCalculator = debtCalculatorConfig => { const config = { ...configMinusGetDebt, getDebt }; const periodObserver = Far('periodObserver', { - /** @type {(timestamp: import('@agoric/time/src/types.js').TimestampRecord) => void} */ + /** @type {(timestamp: import('@agoric/time').TimestampRecord) => void} */ updateState: timestamp => { let updatedLoan = false; // we could calculate the number of required updates and multiply by a power diff --git a/packages/zoe/src/contracts/priceAggregator.js b/packages/zoe/src/contracts/priceAggregator.js index 51c39b1f19e..11e9d0701fe 100644 --- a/packages/zoe/src/contracts/priceAggregator.js +++ b/packages/zoe/src/contracts/priceAggregator.js @@ -1,6 +1,4 @@ /* eslint @typescript-eslint/no-floating-promises: "warn" */ -/// - import { Fail, q } from '@agoric/assert'; import { AmountMath, AssetKind, makeIssuerKit } from '@agoric/ertp'; import { assertAllDefined } from '@agoric/internal'; @@ -53,7 +51,7 @@ const priceDescriptionFromQuote = quote => quote.quoteAmount.value[0]; * is a stub until we complete what is now in `fluxAggregatorKit.js`. * * @param {ZCF<{ - * timer: import('@agoric/time/src/types').TimerService, + * timer: import('@agoric/time').TimerService, * POLL_INTERVAL: bigint, * brandIn: Brand<'nat'>, * brandOut: Brand<'nat'>, @@ -127,7 +125,7 @@ const start = async (zcf, privateArgs) => { /** * @typedef {object} OracleRecord - * @property {(timestamp: import('@agoric/time/src/types').Timestamp) => Promise} [querier] + * @property {(timestamp: import('@agoric/time').Timestamp) => Promise} [querier] * @property {Ratio} lastSample * @property {OracleKey} oracleKey */ @@ -144,7 +142,7 @@ const start = async (zcf, privateArgs) => { // Wake every POLL_INTERVAL and run the queriers. const repeaterP = E(timer).makeRepeater(0n, POLL_INTERVAL); - /** @type {import('@agoric/time/src/types').TimerWaker} */ + /** @type {import('@agoric/time').TimerWaker} */ const waker = Far('waker', { async wake(timestamp) { // Run all the queriers. @@ -167,7 +165,7 @@ const start = async (zcf, privateArgs) => { /** * @param {object} param0 * @param {Ratio} [param0.overridePrice] - * @param {import('@agoric/time/src/types').TimestampRecord} [param0.timestamp] + * @param {import('@agoric/time').TimestampRecord} [param0.timestamp] */ const makeCreateQuote = ({ overridePrice, timestamp } = {}) => /** @@ -259,7 +257,7 @@ const start = async (zcf, privateArgs) => { ); /** - * @param {import('@agoric/time/src/types').Timestamp} timestamp + * @param {import('@agoric/time').Timestamp} timestamp */ const updateQuote = async timestamp => { timestamp = TimeMath.coerceTimestampRecord(timestamp, timerBrand); @@ -593,11 +591,11 @@ const start = async (zcf, privateArgs) => { const oracle = await E(zoe).getPublicFacet(oracleInstance); assert(records.has(record), 'Oracle record is already deleted'); - /** @type {import('@agoric/time/src/types').Timestamp} */ + /** @type {import('@agoric/time').Timestamp} */ let lastWakeTimestamp = 0n; /** - * @param {import('@agoric/time/src/types').Timestamp} timestamp + * @param {import('@agoric/time').Timestamp} timestamp */ record.querier = async timestamp => { // Submit the query. diff --git a/packages/zoe/src/zoeService/types.js b/packages/zoe/src/zoeService/types.js index 34897fd32e3..79c3e3015d5 100644 --- a/packages/zoe/src/zoeService/types.js +++ b/packages/zoe/src/zoeService/types.js @@ -245,7 +245,7 @@ */ /** - * @typedef {import('@agoric/time/src/types').Timestamp} Deadline + * @typedef {import('@agoric/time').Timestamp} Deadline */ /** diff --git a/packages/zoe/tools/fakePriceAuthority.js b/packages/zoe/tools/fakePriceAuthority.js index f738298bf9a..e08492e8341 100644 --- a/packages/zoe/tools/fakePriceAuthority.js +++ b/packages/zoe/tools/fakePriceAuthority.js @@ -26,8 +26,8 @@ const timestampLTE = (a, b) => TimeMath.compareAbs(a, b) <= 0; * @property {Brand<'nat'>} actualBrandOut * @property {Array} [priceList] * @property {Array<[number, number]>} [tradeList] - * @property {ERef} timer - * @property {import('@agoric/time/src/types').RelativeTime} [quoteInterval] + * @property {ERef} timer + * @property {import('@agoric/time').RelativeTime} [quoteInterval] * @property {ERef>} [quoteMint] * @property {Amount<'nat'>} [unitAmountIn] */ @@ -84,7 +84,7 @@ export async function makeFakePriceAuthority(options) { const quoteBrand = await E(quoteIssuer).getBrand(); /** - * @type {NotifierRecord} + * @type {NotifierRecord} * We need to have a notifier driven by the * TimerService because if the timer pushes updates to individual * QuoteNotifiers, we have a dependency inversion and the timer can never know @@ -104,7 +104,7 @@ export async function makeFakePriceAuthority(options) { * * @param {Amount<'nat'>} amountIn * @param {Brand} brandOut - * @param {import('@agoric/time/src/types').Timestamp} quoteTime + * @param {import('@agoric/time').Timestamp} quoteTime * @returns {PriceQuote} */ function priceInQuote(amountIn, brandOut, quoteTime) { @@ -136,7 +136,7 @@ export async function makeFakePriceAuthority(options) { /** * @param {Brand<'nat'>} brandIn * @param {Amount<'nat'>} amountOut - * @param {import('@agoric/time/src/types').Timestamp} quoteTime + * @param {import('@agoric/time').Timestamp} quoteTime * @returns {PriceQuote} */ function priceOutQuote(brandIn, amountOut, quoteTime) { @@ -158,7 +158,7 @@ export async function makeFakePriceAuthority(options) { let latestTick; // clients who are waiting for a specific timestamp - /** @type { [when: import('@agoric/time/src/types').Timestamp, resolve: (quote: PriceQuote) => void][] } */ + /** @type { [when: import('@agoric/time').Timestamp, resolve: (quote: PriceQuote) => void][] } */ let timeClients = []; // Check if a comparison request has been satisfied. diff --git a/packages/zoe/tools/internal-types.js b/packages/zoe/tools/internal-types.js index 750c189be4b..ff654d601d6 100644 --- a/packages/zoe/tools/internal-types.js +++ b/packages/zoe/tools/internal-types.js @@ -10,5 +10,5 @@ */ /** - * @typedef {import('@agoric/time/src/types').TimerService & ManualTimerAdmin} ManualTimer + * @typedef {import('@agoric/time').TimerService & ManualTimerAdmin} ManualTimer */ diff --git a/packages/zoe/tools/manualPriceAuthority.js b/packages/zoe/tools/manualPriceAuthority.js index b0dbcd6d08f..74a8d12ae36 100644 --- a/packages/zoe/tools/manualPriceAuthority.js +++ b/packages/zoe/tools/manualPriceAuthority.js @@ -16,7 +16,7 @@ import { * @param {Brand<'nat'>} options.actualBrandIn * @param {Brand<'nat'>} options.actualBrandOut * @param {Ratio} options.initialPrice - * @param {import('@agoric/time/src/types').TimerService} options.timer + * @param {import('@agoric/time').TimerService} options.timer * @param {IssuerKit<'set'>} [options.quoteIssuerKit] * @returns {PriceAuthority & { setPrice: (Ratio) => void }} */ diff --git a/packages/zoe/tools/manualTimer.js b/packages/zoe/tools/manualTimer.js index ccf8e993d55..622e2c6cd97 100644 --- a/packages/zoe/tools/manualTimer.js +++ b/packages/zoe/tools/manualTimer.js @@ -13,7 +13,7 @@ const { Fail } = assert; /** * @typedef {{ - * timeStep?: import('@agoric/time/src/types').RelativeTime | bigint, + * timeStep?: import('@agoric/time').RelativeTime | bigint, * eventLoopIteration?: () => Promise, * }} ZoeManualTimerOptions */ @@ -53,7 +53,7 @@ const nolog = (..._args) => {}; * boundaries * * @param {(...args: any[]) => void} [log] - * @param {import('@agoric/time/src/types').Timestamp | bigint} [startValue=0n] + * @param {import('@agoric/time').Timestamp | bigint} [startValue=0n] * @param {ZoeManualTimerOptions} [options] * @returns {ManualTimer} */ diff --git a/packages/zoe/tools/scriptedOracle.js b/packages/zoe/tools/scriptedOracle.js index e9e860b1ebe..41e91096507 100644 --- a/packages/zoe/tools/scriptedOracle.js +++ b/packages/zoe/tools/scriptedOracle.js @@ -14,7 +14,7 @@ import { Far } from '@endo/marshal'; * * @param {Record} script * @param {Installation} oracleInstallation - * @param {import('@agoric/time/src/types').TimerService} timer + * @param {import('@agoric/time').TimerService} timer * @param {ZoeService} zoe * @param {Issuer} feeIssuer */ diff --git a/packages/zoe/tools/scriptedPriceAuthority.js b/packages/zoe/tools/scriptedPriceAuthority.js index 98204075cde..939ba641b8e 100644 --- a/packages/zoe/tools/scriptedPriceAuthority.js +++ b/packages/zoe/tools/scriptedPriceAuthority.js @@ -65,7 +65,7 @@ export function makeScriptedPriceAuthority(options) { ); } - /** @type {ERef>} */ + /** @type {ERef>} */ const notifier = E(timer).makeNotifier(0n, quoteInterval); const priceAuthorityOptions = harden({ timer, diff --git a/packages/zoe/tools/types-ambient.js b/packages/zoe/tools/types-ambient.js index 3ff744ac5d5..4c5cd6abcce 100644 --- a/packages/zoe/tools/types-ambient.js +++ b/packages/zoe/tools/types-ambient.js @@ -21,9 +21,9 @@ * The amount supplied to a trade * @property {Amount<'nat'>} amountOut * The quoted result of trading `amountIn` - * @property {import('@agoric/time/src/types').TimerService} timer + * @property {import('@agoric/time').TimerService} timer * The service that gave the `timestamp` - * @property {import('@agoric/time/src/types').TimestampRecord} timestamp + * @property {import('@agoric/time').TimestampRecord} timestamp * A timestamp according to `timer` for the quote * @property {any} [conditions] * Additional conditions for the quote @@ -68,7 +68,7 @@ * * @property {(brandIn: Brand, * brandOut: Brand - * ) => ERef} getTimerService + * ) => ERef} getTimerService * Get the timer used in PriceQuotes for a given brandIn/brandOut pair * * @property {(amountIn: Amount<'nat'>, @@ -78,7 +78,7 @@ * `amountIn`. The rate at which these are issued may be very different between * `priceAuthorities`. * - * @property {(deadline: import('@agoric/time/src/types').Timestamp, + * @property {(deadline: import('@agoric/time').Timestamp, * amountIn: Amount<'nat'>, * brandOut: Brand<'nat'> * ) => Promise} quoteAtTime @@ -146,7 +146,7 @@ * @callback PriceQuery * @param {PriceCalculator} calcAmountIn * @param {PriceCalculator} calcAmountOut - * @returns {{ amountIn: Amount<'nat'>, amountOut: Amount<'nat'>, timestamp?: import('@agoric/time/src/types').TimestampRecord } | undefined} + * @returns {{ amountIn: Amount<'nat'>, amountOut: Amount<'nat'>, timestamp?: import('@agoric/time').TimestampRecord } | undefined} */ /** From 5406a34e4740e6a4efb6a3ba51077fe99f3e601e Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 6 Dec 2023 15:24:30 -0800 Subject: [PATCH 14/58] chore(types): update AfterDeadlineExitRule --- packages/zoe/src/contracts/otcDesk.js | 2 +- packages/zoe/src/zoeService/types.js | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/packages/zoe/src/contracts/otcDesk.js b/packages/zoe/src/contracts/otcDesk.js index 2842b224bab..6259dfa1791 100644 --- a/packages/zoe/src/contracts/otcDesk.js +++ b/packages/zoe/src/contracts/otcDesk.js @@ -58,7 +58,7 @@ const start = zcf => { * * @param {AmountKeywordRecord} price * @param {AmountKeywordRecord} assets - * @param {Timer} timeAuthority + * @param {import('@agoric/time').TimerService} timeAuthority * @param {any} deadline * @returns {Promise} */ diff --git a/packages/zoe/src/zoeService/types.js b/packages/zoe/src/zoeService/types.js index 79c3e3015d5..7ca1c8d5d63 100644 --- a/packages/zoe/src/zoeService/types.js +++ b/packages/zoe/src/zoeService/types.js @@ -244,15 +244,6 @@ * @property {() => void} wake */ -/** - * @typedef {import('@agoric/time').Timestamp} Deadline - */ - -/** - * @typedef {object} Timer - * @property {(deadline: Deadline, wakerP: ERef) => void} setWakeup - */ - /** * @typedef {object} OnDemandExitRule * @property {null} onDemand @@ -265,7 +256,7 @@ /** * @typedef {object} AfterDeadlineExitRule - * @property {{timer:Timer, deadline:Deadline}} afterDeadline + * @property {{timer: import('@agoric/time').TimerService, deadline: import('@agoric/time').Timestamp}} afterDeadline */ /** From b68082147757f4dedde18f337aaeb5e3883f5916 Mon Sep 17 00:00:00 2001 From: Chip Morningstar Date: Sun, 1 Oct 2023 00:48:22 -0700 Subject: [PATCH 15/58] refactor: move benchmarkerator into is own package & rearrange boot package Closes #8490 --- .../SwingSet/src/controller/controller.js | 8 ++ .../src/controller/startNodeSubprocess.js | 18 ++++- .../SwingSet/src/controller/startXSnap.js | 12 +++ .../vat-loader/manager-subprocess-node.js | 8 +- .../vat-loader/manager-subprocess-xsnap.js | 2 + .../supervisor-subprocess-node.js | 4 + packages/benchmark/doc/benchmarkerator.md | 22 ++++-- packages/benchmark/src/benchmarkerator.js | 75 +++++++++++++++---- packages/boot/tools/supports.ts | 6 +- packages/cosmic-swingset/src/launch-chain.js | 11 ++- 10 files changed, 138 insertions(+), 28 deletions(-) diff --git a/packages/SwingSet/src/controller/controller.js b/packages/SwingSet/src/controller/controller.js index 58661fcab81..3a973b7fd47 100644 --- a/packages/SwingSet/src/controller/controller.js +++ b/packages/SwingSet/src/controller/controller.js @@ -103,6 +103,8 @@ function unhandledRejectionHandler(e, pr) { * kernelBundle?: Bundle * xsnapBundleData?: ReturnType, * bundleHandler?: import('./bundle-handler.js').BundleHandler, + * profileVats?: string[], + * debugVats?: string[], * }} runtimeOptions */ export async function makeSwingsetController( @@ -126,6 +128,8 @@ export async function makeSwingsetController( warehousePolicy = {}, overrideVatManagerOptions = {}, xsnapBundleData = makeXsnapBundleData(), + profileVats = [], + debugVats = [], } = runtimeOptions; const { bundleHandler = makeWorkerBundleHandler( @@ -146,9 +150,13 @@ export async function makeSwingsetController( tmpName, debug: !!env.XSNAP_DEBUG, workerTraceRootPath: env.XSNAP_TEST_RECORD, + profileVats, + debugVats, }); const startSubprocessWorkerNode = makeStartSubprocessWorkerNode( startSubprocessWorker, + profileVats, + debugVats, ); function writeSlogObject(obj) { diff --git a/packages/SwingSet/src/controller/startNodeSubprocess.js b/packages/SwingSet/src/controller/startNodeSubprocess.js index 5f07a38108b..ddb77378551 100644 --- a/packages/SwingSet/src/controller/startNodeSubprocess.js +++ b/packages/SwingSet/src/controller/startNodeSubprocess.js @@ -1,13 +1,27 @@ import process from 'process'; -export function makeStartSubprocessWorkerNode(startSubprocessWorker) { +export function makeStartSubprocessWorkerNode( + startSubprocessWorker, + profileVats, + debugVats, +) { // launch a worker in a subprocess (which runs Node.js) - function startSubprocessWorkerNode(nameDisplayArg, nodeOptions) { + function startSubprocessWorkerNode(nameDisplayArg, vatID, nodeOptions) { const supervisorCodePath = new URL( '../supervisors/subprocess-node/supervisor-subprocess-node.js', import.meta.url, ).pathname; const args = nodeOptions ? [...nodeOptions] : []; + if (profileVats.includes(vatID)) { + args.push('--cpu-prof'); + args.push('--cpu-prof-interval'); + args.push('100'); + args.push('--cpu-prof-name'); + args.push(`CPU.${nameDisplayArg}.cpuprofile`); + } + if (debugVats.includes(vatID)) { + args.push('--inspect-brk'); + } args.push(supervisorCodePath); args.push(nameDisplayArg); return startSubprocessWorker(process.execPath, args); diff --git a/packages/SwingSet/src/controller/startXSnap.js b/packages/SwingSet/src/controller/startXSnap.js index 6e1c3e9f7ac..ff5e70a40ad 100644 --- a/packages/SwingSet/src/controller/startXSnap.js +++ b/packages/SwingSet/src/controller/startXSnap.js @@ -41,6 +41,8 @@ const NETSTRING_MAX_CHUNK_SIZE = 12_000_000; * debug?: boolean, * workerTraceRootPath?: string, * overrideBundles?: import('../types-external.js').Bundle[], + * profileVats?: string[], + * debugVats?: string[], * }} options */ export function makeStartXSnap(options) { @@ -54,6 +56,8 @@ export function makeStartXSnap(options) { snapStore, workerTraceRootPath, overrideBundles, + profileVats = [], + debugVats = [], debug = false, } = options; @@ -123,6 +127,7 @@ export function makeStartXSnap(options) { * @param {string} name * @param {object} details * @param {import('../types-external.js').BundleID[]} details.bundleIDs + * @param {string} details.vatID * @param {(request: Uint8Array) => Promise} details.handleCommand * @param {boolean} [details.metered] * @param {StartXSnapInitDetails} [details.init] @@ -131,11 +136,18 @@ export function makeStartXSnap(options) { name, { bundleIDs, + vatID, handleCommand, metered, init: initDetails = { from: 'bundles' }, }, ) { + if (profileVats.includes(vatID)) { + Fail`startXSnap: not yet supporting profiling for vat ${vatID}`; + } + if (debugVats.includes(vatID)) { + Fail`startXSnap: not yet supporting debugging for vat ${vatID}`; + } const meterOpts = metered ? {} : { meteringLimit: 0 }; const snapshotLoadOpts = getSnapshotLoadOptions(initDetails); await null; diff --git a/packages/SwingSet/src/kernel/vat-loader/manager-subprocess-node.js b/packages/SwingSet/src/kernel/vat-loader/manager-subprocess-node.js index 2afe8eaaf7c..5ac7ec60f05 100644 --- a/packages/SwingSet/src/kernel/vat-loader/manager-subprocess-node.js +++ b/packages/SwingSet/src/kernel/vat-loader/manager-subprocess-node.js @@ -30,14 +30,15 @@ export function makeNodeSubprocessFactory(tools) { Fail`nodeOptions must be an array`; // Node worker subprocess adds `nameDisplayArg` as a dummy argument so that - // 'ps'shows which worker is for which vat + // 'ps' shows which worker is for which vat const nameDisplayArg = `${vatID}:${name !== undefined ? name : ''}`; const mk = makeManagerKit(); // start the worker and establish a connection - const { fromChild, toChild, terminate, done } = startSubprocessWorker( + const { fromChild, toChild, done } = startSubprocessWorker( nameDisplayArg, + vatID, nodeOptions, ); @@ -107,7 +108,8 @@ export function makeNodeSubprocessFactory(tools) { sendToWorker(['setBundle', vatID, bundle, liveSlotsOptions]); function shutdown() { - terminate(); + // terminate(); // XXX currently disabled since it breaks profiling; we should revisit if we develop a problem with worker vat processes refusing to exit when requested to do so + sendToWorker(['exit']); return E.when(done, _ => undefined); } const manager = mk.getManager(shutdown); diff --git a/packages/SwingSet/src/kernel/vat-loader/manager-subprocess-xsnap.js b/packages/SwingSet/src/kernel/vat-loader/manager-subprocess-xsnap.js index edd31c7c6d5..36600acd07d 100644 --- a/packages/SwingSet/src/kernel/vat-loader/manager-subprocess-xsnap.js +++ b/packages/SwingSet/src/kernel/vat-loader/manager-subprocess-xsnap.js @@ -143,6 +143,7 @@ export function makeXsSubprocessFactory({ // start the worker and establish a connection let worker = await startXSnap(nameDisplayArg, { bundleIDs, + vatID, handleCommand: handleCommandKit.handleCommand, metered, init: snapshotInfo && { from: 'snapStore', vatID }, @@ -258,6 +259,7 @@ export function makeXsSubprocessFactory({ [worker, snapshotResults] = await Promise.all([ startXSnap(nameDisplayArg, { bundleIDs, + vatID, handleCommand: handleCommandKit.handleCommand, metered, init: { diff --git a/packages/SwingSet/src/supervisors/subprocess-node/supervisor-subprocess-node.js b/packages/SwingSet/src/supervisors/subprocess-node/supervisor-subprocess-node.js index c75495f9a32..20e7ff4db23 100644 --- a/packages/SwingSet/src/supervisors/subprocess-node/supervisor-subprocess-node.js +++ b/packages/SwingSet/src/supervisors/subprocess-node/supervisor-subprocess-node.js @@ -6,6 +6,7 @@ import '@endo/init'; import anylogger from 'anylogger'; import fs from 'fs'; import { Buffer } from 'buffer'; +import process from 'node:process'; import { assert, details as X, Fail } from '@agoric/assert'; import { importBundle } from '@endo/import-bundle'; @@ -188,6 +189,9 @@ async function handleCommand(command) { return handleSetBundle(margs); case 'deliver': return handleDeliver(margs); + case 'exit': + process.exit(0); + break; default: throw Error(`unrecognized downlink message ${type}`); } diff --git a/packages/benchmark/doc/benchmarkerator.md b/packages/benchmark/doc/benchmarkerator.md index 2558ddc0c08..129b5bb149b 100644 --- a/packages/benchmark/doc/benchmarkerator.md +++ b/packages/benchmark/doc/benchmarkerator.md @@ -101,7 +101,7 @@ provides various information about the execution. It has the properties: `options: Record` - Named options from the command line (see Command Line below). + Named configuration options from the command line (see Command Line below). `argv: string[]` @@ -139,12 +139,16 @@ The supported command line options are: |--------|------| | `-r N`
`--rounds N` | Execute _N_ rounds of each benchmark | | `-b PATT`
`--benchmark PATT` | Only execute benchmarks matching _PATT_ (may be specified more than once; this is similar to Ava's `-m` option)| -| `-o NAME VAL`
`--option NAME VAL` | Set option _NAME_ to _VAL_ in the `context.options` record (may be specified more than once) | +| `-c NAME VAL`
`--config NAME VAL` | Set configuration option _NAME_ to _VAL_ in the `context.options` record (may be specified more than once) | | `-v`
`--verbose` | Enable verbose output | | `--vat-type TYPE` | Use the specified vat manager type rather than the default `xs-worker` | | `-l`
`--local` | Shorthand for `--vat-type local` (vats run in the same process as the kernel; less realistic than `xs-worker` but much faster and easier to debug) | -| `-d PATH`
`--dump PATH` | Output JSON-formated benchmark data into _PATH_ | -| `-s PATH`
`--slot PATH` | Output a log file into _PATH_ | +| `-n`
`--node` | Shorthand for `--vat-type node-subprocess` | +| `-x`
`--xs` | Shorthand for `--vat-type xs-worker` | +| `-o PATH`
`--output PATH` | Output JSON-formated benchmark data into _PATH_ | +| `-s PATH`
`--slog PATH` | Output a slog file into _PATH_ | +| `-p VATID`
`--profile VATID` | Collect CPU profile data for vat VATID | +| `-d VATID`
`--debug VATID` | Enable debug mode for vat VATID | | `-h`
`--help` | Output this helpful usage information and then exit | An optional `--` flag ends the options list. Any remaining command line @@ -157,7 +161,7 @@ Timing results and other collected metrics are output to _stdout_. Two batches of information are provided: one for the setup phase and one for the benchmark rounds themselves (in aggregate). -If you specify the `--dump FILEPATH` command line option, a JSON-formatted +If you specify the `--output FILEPATH` command line option, a JSON-formatted (i.e., machine readable) version of this same data will be output to the indicated file. @@ -165,5 +169,13 @@ Output results include execution times (according to Node's nanosecond clock), crank counts, and the various kernel resource usage data reported by `controller.getStats()`. +Per-vat JS engine-level profiling is enabled for a given vat via the `--profile +VATID` command line option. Note that this option is only available when the +vat manager type is `node-process` or `xs-worker`. For `node-process` vats, the +profiling data will be placed in the file `CPU.${vatID}:${vatName}.cpuprofile`. +The `.cpuprofile` file format can be read and displayed by Chrome debugger, VS +Code plugins available for this purpose, and various other tools. For +`xs-worker` vats, profiling data format is TBD. + In addition, if you specify the `--slog FILEPATH` command line option, a SwingSet slog file for the run will be output to the file indicated. diff --git a/packages/benchmark/src/benchmarkerator.js b/packages/benchmark/src/benchmarkerator.js index 2044911a870..ac0d6e47a67 100644 --- a/packages/benchmark/src/benchmarkerator.js +++ b/packages/benchmark/src/benchmarkerator.js @@ -132,31 +132,45 @@ ${process.argv[0]} ${process.argv[1]} [FLAGS] [-- [ARGS...]] FLAGS may be: -r N - --rounds N - execute N rounds of each benchmark by default + --rounds N - execute N rounds of each benchmark -b PATT - --benchmark PATT - only execute benchmarks matching PATT (may be specified more than once) + --benchmark PATT - only execute benchmarks matching PATT (may be specified more than once) -v - --verbose - output verbose debugging messages it runs + --verbose - output verbose debugging messages as it runs - -o NAME VAL - --option NAME VAL - set named option NAME to VAL + -c NAME VAL + --config NAME VAL - set named configuration option NAME to VAL - --vat-type TYPE - use the specified vat manager type rather than the default 'xs-worker' + --vat-type TYPE - use the specified vat manager type rather than the default 'xs-worker' -l - --local - shorthand for '--vat-type local' - (less realistic perf numbers but faster and easier to debug) + --local - shorthand for '--vat-type local' + (less realistic perf numbers but faster and easier to debug) + + -n + --node - shorthand for '--vat-type node-subprocess' + (similar to --local, but enables per-vat profiling and debugging in v8) + + -x + --xs - shorthand for '--vat-type xs-worker' + (the default; provided for completeness) + + -p VATID + --profile VATID - turn on CPU profile for vat VATID (may be repeated for multiple vats) + + -d VATID + --debug VATID - turn on debugging for vat VATID -s PATH - --slog PATH - output a slog file into PATH + --slog PATH - output a slog file into PATH - -d PATH - --dump PATH - output JSON-formatted benchmark data into PATH + -o PATH + --output PATH - output JSON-formatted benchmark data into PATH -h - --help - output this helpful usage information and then exit + --help - output this helpful usage information and then exit additional ARGS are passed to the benchmark in the context.argv array `); @@ -171,6 +185,8 @@ const fail = (message, printUsage) => { }; let stillScanningArgs = true; +const profileVats = []; +const debugVats = []; while (argv[0] && stillScanningArgs) { const flag = argv.shift(); switch (flag) { @@ -186,8 +202,8 @@ while (argv[0] && stillScanningArgs) { case '--verbose': verbose = true; break; - case '-d': - case '--dump': + case '-o': + case '--output': dumpFile = argv.shift(); break; case '--vat-type': { @@ -208,17 +224,33 @@ while (argv[0] && stillScanningArgs) { case '--local': defaultManagerType = 'local'; break; + case '-n': + case '--node': + defaultManagerType = 'node-subprocess'; + break; + case '-x': + case '--xs': + defaultManagerType = 'xs-worker'; + break; case '-?': case '-h': case '--help': help = true; break; + case '-p': + case '--profile': + profileVats.push(argv.shift()); + break; + case '-d': + case '--debug': + debugVats.push(argv.shift()); + break; case '-s': case '--slog': slogFile = argv.shift(); break; - case '-o': - case '--option': { + case '-c': + case '--config': { const optionName = argv.shift(); const optionValue = argv.shift(); options[optionName] = optionValue; @@ -233,6 +265,15 @@ while (argv[0] && stillScanningArgs) { } } +if (defaultManagerType === 'local') { + if (profileVats.length > 0) { + fail`per-vat profiling not supported under vat type 'local'`; + } + if (debugVats.length > 0) { + fail`per-vat debugging not supported under vat type 'local'`; + } +} + harden(options); if (help) { @@ -441,6 +482,8 @@ export const makeBenchmarkerator = async () => { const swingsetTestKit = await makeSwingsetTestKit(console.log, undefined, { defaultManagerType, verbose, + profileVats, + debugVats, slogFile, }); const { diff --git a/packages/boot/tools/supports.ts b/packages/boot/tools/supports.ts index e807ffc1aeb..3278adbe38b 100644 --- a/packages/boot/tools/supports.ts +++ b/packages/boot/tools/supports.ts @@ -244,6 +244,8 @@ export const matchIter = (t: AvaT, iter, valueRef) => { * @param [options.storage] * @param [options.verbose] * @param [options.slogFile] + * @param [options.profileVats] + * @param [options.debugVats] * @param [options.defaultManagerType] */ export const makeSwingsetTestKit = async ( @@ -254,6 +256,8 @@ export const makeSwingsetTestKit = async ( storage = makeFakeStorageKit('bootstrapTests'), verbose = false, slogFile = undefined as string | undefined, + profileVats = [] as string[], + debugVats = [] as string[], defaultManagerType = 'local' as ManagerType, } = {}, ) => { @@ -363,7 +367,7 @@ export const makeSwingsetTestKit = async ( configPath, [], {}, - { debugName: 'TESTBOOT', verbose, slogSender }, + { debugName: 'TESTBOOT', verbose, slogSender, profileVats, debugVats }, ); console.timeLog('makeBaseSwingsetTestKit', 'buildSwingset'); diff --git a/packages/cosmic-swingset/src/launch-chain.js b/packages/cosmic-swingset/src/launch-chain.js index 028dfd3f7d4..92beb8b8ea5 100644 --- a/packages/cosmic-swingset/src/launch-chain.js +++ b/packages/cosmic-swingset/src/launch-chain.js @@ -88,7 +88,14 @@ export async function buildSwingset( vatconfig, bootstrapArgs, env, - { debugName = undefined, slogCallbacks, slogSender, verbose }, + { + debugName = undefined, + slogCallbacks, + slogSender, + verbose, + profileVats, + debugVats, + }, ) { const debugPrefix = debugName === undefined ? '' : `${debugName}:`; const mbs = buildMailboxStateMap(mailboxStorage); @@ -186,6 +193,8 @@ export async function buildSwingset( slogCallbacks, slogSender, verbose, + profileVats, + debugVats, }, ); From d864b666104beccf5f5ccad222f7a5d23a5ad7d5 Mon Sep 17 00:00:00 2001 From: Chip Morningstar Date: Sun, 3 Dec 2023 20:00:33 -0800 Subject: [PATCH 16/58] feat: implement benchmarks for price feeds with and without liquidation. This includes adjustments to the boot tooling to accommodate its use for benchmarking, as well as improvements and enhancements to the bechmarkerator API that were required to make these benchmarks possible. Closes #8496 --- .../benchmark/benchmark-liquidation.js | 233 ++++++++++++++++++ .../benchmark/benchmark-pricefeed.js | 40 +++ packages/benchmark/doc/benchmarkerator.md | 19 ++ packages/benchmark/src/benchmarkerator.js | 232 ++++++++++++----- .../test/bootstrapTests/test-addAssets.ts | 2 +- .../test/bootstrapTests/test-liquidation-1.ts | 2 +- .../bootstrapTests/test-liquidation-2b.ts | 2 +- .../test-liquidation-concurrent-1.ts | 2 +- .../test-liquidation-concurrent-2b.ts | 2 +- .../test-walletSurvivesZoeRestart.ts | 2 +- packages/boot/tools/drivers.ts | 1 + .../bootstrapTests => tools}/liquidation.ts | 167 +++++++------ .../decentral-itest-vaults-config.json | 37 ++- 13 files changed, 596 insertions(+), 145 deletions(-) create mode 100644 packages/benchmark/benchmark/benchmark-liquidation.js create mode 100644 packages/benchmark/benchmark/benchmark-pricefeed.js rename packages/boot/{test/bootstrapTests => tools}/liquidation.ts (85%) diff --git a/packages/benchmark/benchmark/benchmark-liquidation.js b/packages/benchmark/benchmark/benchmark-liquidation.js new file mode 100644 index 00000000000..bfeb0da0a17 --- /dev/null +++ b/packages/benchmark/benchmark/benchmark-liquidation.js @@ -0,0 +1,233 @@ +// eslint-disable-next-line import/order +import { bench } from '../src/benchmarkerator.js'; + +import { Offers } from '@agoric/inter-protocol/src/clientSupport.js'; +import { scale6 } from '@agoric/boot/tools/liquidation.ts'; + +const setupData = { + vaults: [ + { + atom: 15, + ist: 100, + debt: 100.5, + }, + ], + bids: [ + { + give: '80IST', + discount: 0.1, + }, + ], + price: { + starting: 12.34, + trigger: 9.99, + }, + auction: { + start: { + collateral: 15, + debt: 100.5, + }, + end: { + collateral: 9.659301, + debt: 0, + }, + }, +}; + +const outcome = { + bids: [ + { + payouts: { + Bid: 0, + Collateral: 8.897786, + }, + }, + ], + reserve: { + allocations: { + ATOM: 6.102214, + }, + shortfall: 20.5, + }, + vaultsSpec: [ + { + locked: 3.373, + }, + ], + vaultsActual: [ + { + locked: 3.525747, + }, + ], +}; + +const liquidationOptions = { + collateralBrandKey: 'ATOM', + managerIndex: 0, +}; + +const setup = async context => { + const { managerIndex } = liquidationOptions; + const { walletFactoryDriver } = context.tools; + + const metricsPath = `published.vaultFactory.managers.manager${managerIndex}.metrics`; + const buyer = await walletFactoryDriver.provideSmartWallet('agoric1buyer'); + const minter = await walletFactoryDriver.provideSmartWallet('agoric1minter'); + + return { metricsPath, buyer, minter }; +}; + +const setupRound = async (context, round) => { + const { collateralBrandKey, managerIndex } = liquidationOptions; + const { setupVaults, placeBids } = context.tools; + + await setupVaults( + collateralBrandKey, + managerIndex, + setupData, + round * setupData.vaults.length, + ); + await placeBids(collateralBrandKey, 'agoric1buyer', setupData); +}; + +const executeRound = async (context, round) => { + const { collateralBrandKey, managerIndex } = liquidationOptions; + const { advanceTimeBy, advanceTimeTo, priceFeedDrivers, readLatest } = + context.tools; + + const { metricsPath } = context.config; + + // --------------- + // Change price to trigger liquidation + // --------------- + + await priceFeedDrivers[collateralBrandKey].setPrice(9.99); + + // check nothing liquidating yet + const liveSchedule = readLatest('published.auction.schedule'); + assert(liveSchedule.activeStartTime === null); + const metrics1 = readLatest(metricsPath); + assert( + metrics1.numActiveVaults === setupData.vaults.length && + metrics1.numLiquidatingVaults === 0, + ); + + // advance time to start an auction + console.log(collateralBrandKey, 'step 1 of 10'); + await advanceTimeTo(liveSchedule.nextDescendingStepTime); + const metrics2 = readLatest(metricsPath); + assert( + metrics2.numActiveVaults === 0 && + metrics2.numLiquidatingVaults === setupData.vaults.length && + metrics2.liquidatingCollateral.value === + scale6(setupData.auction.start.collateral) && + metrics2.liquidatingDebt.value === scale6(setupData.auction.start.debt) && + metrics2.lockedQuote === null, + ); + + console.log(collateralBrandKey, 'step 2 of 10'); + await advanceTimeBy(3, 'minutes'); + let auctionBook = readLatest(`published.auction.book${managerIndex}`); + assert( + auctionBook.collateralAvailable.value === + scale6(setupData.auction.start.collateral) && + auctionBook.startCollateral.value === + scale6(setupData.auction.start.collateral) && + auctionBook.startProceedsGoal.value === + scale6(setupData.auction.start.debt), + ); + + console.log(collateralBrandKey, 'step 3 of 10'); + await advanceTimeBy(3, 'minutes'); + + console.log(collateralBrandKey, 'step 4 of 10'); + await advanceTimeBy(3, 'minutes'); + + let buyerWallet = readLatest('published.wallet.agoric1buyer'); + assert( + buyerWallet.status.id === `${collateralBrandKey}-bid1` && + buyerWallet.status.payouts.Collateral.value === + scale6(outcome.bids[0].payouts.Collateral) && + buyerWallet.status.payouts.Bid.value === + scale6(outcome.bids[0].payouts.Bid), + ); + + console.log(collateralBrandKey, 'step 5 of 10'); + await advanceTimeBy(3, 'minutes'); + + console.log(collateralBrandKey, 'step 6 of 10'); + await advanceTimeBy(3, 'minutes'); + auctionBook = readLatest(`published.auction.book${managerIndex}`); + assert(auctionBook.collateralAvailable.value === 6102214n); + + console.log(collateralBrandKey, 'step 7 of 10'); + await advanceTimeBy(3, 'minutes'); + + console.log(collateralBrandKey, 'step 8 of 10'); + await advanceTimeBy(3, 'minutes'); + + console.log(collateralBrandKey, 'step 9 of 10'); + await advanceTimeBy(3, 'minutes'); + + const metrics3 = readLatest(metricsPath); + const roundB = BigInt(round); + assert( + metrics3.numActiveVaults === 0 && + metrics3.numLiquidationsCompleted === setupData.vaults.length * round && + metrics3.numLiquidatingVaults === 0 && + metrics3.retainedCollateral.value === 0n && + metrics3.totalCollateral.value === 0n && + metrics3.totalCollateralSold.value === 8897786n * roundB && + metrics3.totalDebt.value === 0n && + metrics3.totalOverageReceived.value === 0n && + metrics3.totalProceedsReceived.value === 80000000n * roundB && + metrics3.totalShortfallReceived.value === 20500000n * roundB, + ); + + console.log(collateralBrandKey, 'step 10 of 10'); + + buyerWallet = readLatest('published.wallet.agoric1buyer'); + assert( + buyerWallet.status.id === `${collateralBrandKey}-bid1` && + buyerWallet.status.payouts.Collateral.value === + scale6(outcome.bids[0].payouts.Collateral) && + buyerWallet.status.payouts.Bid.value === + scale6(outcome.bids[0].payouts.Bid), + ); + + // check reserve balances + const metrics4 = readLatest('published.reserve.metrics'); + assert( + metrics4.allocations[collateralBrandKey].value === + scale6(outcome.reserve.allocations[collateralBrandKey]) * roundB && + metrics4.shortfallBalance.value === + scale6(outcome.reserve.shortfall) * roundB, + ); +}; + +const finishRound = async (context, round) => { + const { collateralBrandKey } = liquidationOptions; + const { minter } = context.config; + + await 47; // sacrifice to the gods of asynchrony + for (let i = 0; i < setupData.vaults.length; i += 1) { + await minter.executeOfferMaker( + Offers.vaults.CloseVault, + { + offerId: `${collateralBrandKey}-bid${i}`, + collateralBrandKey, + giveMinted: 0, + }, + `open-${collateralBrandKey}-vault${round * setupData.vaults.length + i}`, + ); + } +}; + +bench.addBenchmark('price feed with liquidation', { + setup, + setupRound, + executeRound, + finishRound, +}); + +await bench.run(); diff --git a/packages/benchmark/benchmark/benchmark-pricefeed.js b/packages/benchmark/benchmark/benchmark-pricefeed.js new file mode 100644 index 00000000000..bd1ca1154f8 --- /dev/null +++ b/packages/benchmark/benchmark/benchmark-pricefeed.js @@ -0,0 +1,40 @@ +import { bench } from '../src/benchmarkerator.js'; + +const setupData = { + vaults: [], + price: { starting: 12.34 }, +}; + +const liquidationOptions = { + collateralBrandKey: 'ATOM', + managerIndex: 0, +}; + +const setup = async context => { + const { collateralBrandKey, managerIndex } = liquidationOptions; + const { setupVaults } = context.tools; + + await setupVaults( + collateralBrandKey, + managerIndex, + setupData, + setupData.vaults.length, + ); + + return {}; +}; + +const executeRound = async (context, round) => { + const { collateralBrandKey } = liquidationOptions; + const { priceFeedDrivers } = context.tools; + + console.log(`price feed round #${round}`); + await priceFeedDrivers[collateralBrandKey].setPrice(9.99); +}; + +bench.addBenchmark('price feed without liquidation', { + setup, + executeRound, +}); + +await bench.run(); diff --git a/packages/benchmark/doc/benchmarkerator.md b/packages/benchmark/doc/benchmarkerator.md index 129b5bb149b..11cf5f9bade 100644 --- a/packages/benchmark/doc/benchmarkerator.md +++ b/packages/benchmark/doc/benchmarkerator.md @@ -84,6 +84,25 @@ optional except for `executeRound`: benchmark. The `round` argument is the number of the benchmark round that this call to `executeRound` is being asked to execute (counting from 1). +`setupRound: (context: BenchmarkContext, round: number) => Promise` + + A optional async method which is called to perform initializations required + for a single round of the benchmark. It is called immediately before calling + `executeRound` but its execution time and any resources it consumes will not + be accounted against the stats for the round in question. The `round` + argument is the number of the benchmark round that the corresponding call to + `executeRound` is being asked to execute (counting from 1). + +`finishRound: (context: BenchmarkContext, round: number) => Promise` + + A optional async method which is called to perform teardowns required by a + single round of the benchmark. It is called immediately after calling + `executeRound` but its execution time and any resources it consumes will not + be accounted against the stats for the round in question (or the round that + follows). The `round` argument is the number of the benchmark round that the + corresponding call to `executeRound` that just completed execution (counting + from 1). + `finish?: (context: BenchmarkContext) => Promise` An optional async method to perform any post-run teardown that you need to do. diff --git a/packages/benchmark/src/benchmarkerator.js b/packages/benchmark/src/benchmarkerator.js index ac0d6e47a67..d648ccbe5ff 100644 --- a/packages/benchmark/src/benchmarkerator.js +++ b/packages/benchmark/src/benchmarkerator.js @@ -14,7 +14,11 @@ import { Fail } from '@agoric/assert'; import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js'; import { makeAgoricNamesRemotesFromFakeStorage } from '@agoric/vats/tools/board-utils.js'; import { makeSwingsetTestKit } from '@agoric/boot/tools/supports.ts'; -import { makeWalletFactoryDriver } from '@agoric/boot/tools/drivers.ts'; +import { + makeWalletFactoryDriver, + makeGovernanceDriver, +} from '@agoric/boot/tools/drivers.ts'; +import { makeLiquidationTestKit } from '@agoric/boot/tools/liquidation.ts'; // When I was a child my family took a lot of roadtrips around California to go // camping and backpacking and so on. It was not uncommon in those days (nor is @@ -45,6 +49,7 @@ import { makeWalletFactoryDriver } from '@agoric/boot/tools/drivers.ts'; * options: Record, * argv: string[], * actors: Record, + * tools: Record, * title?: string, * rounds?: number, * config?: Record, @@ -67,6 +72,9 @@ import { makeWalletFactoryDriver } from '@agoric/boot/tools/drivers.ts'; * // The label string for the benchmark currently being executed * title: string, * + * // Functions provided to do things + * tools: Record, + * * // The number of rounds of this benchmark that will be executed * rounds: number, * @@ -79,7 +87,9 @@ import { makeWalletFactoryDriver } from '@agoric/boot/tools/drivers.ts'; * * @typedef {{ * setup?: (context: BenchmarkContext) => Promise | undefined>, + * setupRound?: (context: BenchmarkContext, round: number) => Promise, * executeRound: (context: BenchmarkContext, round: number) => Promise, + * finishRound?: (context: BenchmarkContext, round: number) => Promise, * finish?: (context: BenchmarkContext) => Promise, * rounds?: number, * }} Benchmark @@ -90,6 +100,22 @@ import { makeWalletFactoryDriver } from '@agoric/boot/tools/drivers.ts'; * // benchmark context parameter of subsequent calls into the benchmark object. * setup?: (context: BenchmarkContext) => Promise | undefined>, * + * // Optional setup method for an individual round. This is executed as part + * // of a benchmark round, just prior to calling the `executeRound` method, + * // but does not count towards the timing or resource usage statistics for + * // the round itself. Use this when there is per-round initialization that + * // is necessary to execute the round but which should not be considered + * // part of the operation being measured. + * setupRound?: (context: BenchmarkContext, round: number) => Promise, + * + * // Optional finish method for an individual round. This is executed as + * // part of a benchmark round, just after calling the `executeRound` method, + * // but does not count towards the timing or resource usage statistics for + * // the round itself. Use this when there is per-round teardown that is + * // necessary after executing the round but which should not be considered + * // part of the operation being measured. + * finishRound?: (context: BenchmarkContext, round: number) => Promise, + * * // Run one round of the benchmark * executeRound: (context: BenchmarkContext, round: number) => Promise, * @@ -117,7 +143,7 @@ const argv = process.argv.slice(2); let commandLineRounds; let verbose = false; let help = false; -let dumpFile; +let outputFile; let slogFile; /** @type ManagerType */ let defaultManagerType = 'xs-worker'; @@ -204,7 +230,7 @@ while (argv[0] && stillScanningArgs) { break; case '-o': case '--output': - dumpFile = argv.shift(); + outputFile = argv.shift(); break; case '--vat-type': { const type = argv.shift(); @@ -399,18 +425,6 @@ const organizeSetupStats = (rawStats, elapsedTime, cranks) => { }; const printBenchmarkStats = stats => { - const w1 = 32; - const h1 = `${'Stat'.padEnd(w1)}`; - const d1 = `${''.padEnd(w1, '-')}`; - - const w2 = 6; - const h2 = `${'Delta'.padStart(w2)}`; - const d2 = ` ${''.padStart(w2 - 1, '-')}`; - - const w3 = 10; - const h3 = `${'PerRound'.padStart(w3)}`; - const d3 = ` ${''.padStart(w3 - 1, '-')}`; - const cpr = pn(stats.cranksPerRound).trim(); log( `${stats.cranks} cranks over ${stats.rounds} rounds (${cpr} cranks/round)`, @@ -425,25 +439,64 @@ const printBenchmarkStats = stats => { // prettier-ignore `${stats.rounds} rounds in ${stats.elapsedTime}ns (${stats.timePerRound.toFixed(3)}/round})`, ); - log(`${h1} ${h2} ${h3}`); - log(`${d1} ${d2} ${d3}`); - const data = stats.data; - for (const [key, entry] of Object.entries(data)) { - const col1 = `${key.padEnd(w1)}`; - const col2 = `${String(entry.delta).padStart(w2)}`; - const col3 = `${pn(entry.deltaPerRound).padStart(w3)}`; + const wc1 = 32; + const hc1 = `${'Counter'.padEnd(wc1)}`; + const dc1 = `${''.padEnd(wc1, '-')}`; + + const wc2 = 6; + const hc2 = `${'Delta'.padStart(wc2)}`; + const dc2 = ` ${''.padStart(wc2 - 1, '-')}`; + + const wc3 = 10; + const hc3 = `${'PerRound'.padStart(wc3)}`; + const dc3 = ` ${''.padStart(wc3 - 1, '-')}`; + + log(``); + log(`${hc1} ${hc2} ${hc3}`); + log(`${dc1} ${dc2} ${dc3}`); + for (const [key, entry] of Object.entries(stats.counters)) { + const col1 = `${key.padEnd(wc1)}`; + const col2 = `${String(entry.delta).padStart(wc2)}`; + const col3 = `${pn(entry.deltaPerRound).padStart(wc3)}`; log(`${col1} ${col2} ${col3}`); } + + const wg1 = 32; + const hg1 = `${'Gauge'.padEnd(wg1)}`; + const dg1 = `${''.padEnd(wg1, '-')}`; + + const wg2 = 6; + const hg2 = `${'Start'.padStart(wg2)}`; + const dg2 = ` ${''.padStart(wg2 - 1, '-')}`; + + const wg3 = 6; + const hg3 = `${'End'.padStart(wg3)}`; + const dg3 = ` ${''.padStart(wg3 - 1, '-')}`; + + const wg4 = 6; + const hg4 = `${'Delta'.padStart(wg4)}`; + const dg4 = ` ${''.padStart(wg4 - 1, '-')}`; + + log(``); + log(`${hg1} ${hg2} ${hg3} ${hg4}`); + log(`${dg1} ${dg2} ${dg3} ${dg4}`); + for (const [key, entry] of Object.entries(stats.gauges)) { + const col1 = `${key.padEnd(wg1)}`; + const col2 = `${String(entry.start).padStart(wg2)}`; + const col3 = `${String(entry.end).padStart(wg3)}`; + const col4 = `${String(entry.end - entry.start).padStart(wg4)}`; + log(`${col1} ${col2} ${col3} ${col4}`); + } }; -const organizeRoundsStats = ( - rawBefore, - rawAfter, - elapsedTime, - cranks, - rounds, -) => { +const organizeRoundsStats = (rounds, perRoundStats) => { + let elapsedTime = 0; + let cranks = 0; + for (const { start, end } of perRoundStats) { + elapsedTime += Number(end.time - start.time); + cranks += end.cranks - start.cranks; + } const stats = { elapsedTime, cranks, @@ -451,17 +504,31 @@ const organizeRoundsStats = ( timePerCrank: cranks ? elapsedTime / cranks : 0, timePerRound: elapsedTime / rounds, cranksPerRound: cranks / rounds, - data: {}, + perRoundStats, + counters: {}, + gauges: {}, }; - // Note: the following assumes rawBefore and rawAfter have the same keys. - for (const [key, value] of Object.entries(rawBefore)) { + // Note: the following assumes stats records all have the same keys. + const first = perRoundStats[0].start.rawStats; + const last = perRoundStats[perRoundStats.length - 1].end.rawStats; + for (const key of Object.keys(first)) { if (isMainKey(key)) { - const delta = rawAfter[key] - value; - stats.data[key] = { - delta, - deltaPerRound: delta / rounds, - }; + if (Object.hasOwn(first, `${key}Max`)) { + stats.gauges[key] = { + start: first[key], + end: last[key], + }; + } else { + let delta = 0; + for (const { start, end } of perRoundStats) { + delta += Number(end.rawStats[key] - start.rawStats[key]); + } + stats.counters[key] = { + delta, + deltaPerRound: delta / rounds, + }; + } } } return stats; @@ -509,16 +576,26 @@ export const makeBenchmarkerator = async () => { agoricNamesRemotes, ); - const actors = { - gov1: await walletFactoryDriver.provideSmartWallet( + const governanceDriver = await makeGovernanceDriver( + swingsetTestKit, + agoricNamesRemotes, + walletFactoryDriver, + [ 'agoric1ldmtatp24qlllgxmrsjzcpe20fvlkp448zcuce', - ), - gov2: await walletFactoryDriver.provideSmartWallet( 'agoric140dmkrz2e42ergjj7gyvejhzmjzurvqeq82ang', - ), - gov3: await walletFactoryDriver.provideSmartWallet( 'agoric1w8wktaur4zf8qmmtn3n7x3r0jhsjkjntcm3u6h', - ), + ], + ); + + const liquidationTestKit = await makeLiquidationTestKit({ + swingsetTestKit, + agoricNamesRemotes, + walletFactoryDriver, + governanceDriver, + like: () => {}, + }); + + const actors = { atom1: await walletFactoryDriver.provideSmartWallet( 'agoric1ldmtatp24qlllgxmrsjzcpe20fvlkp448zcuce', ), @@ -529,6 +606,11 @@ export const makeBenchmarkerator = async () => { bob: await walletFactoryDriver.provideSmartWallet('agoric1bob'), carol: await walletFactoryDriver.provideSmartWallet('agoric1carol'), }; + let idx = 1; + for (const gov of governanceDriver.ecMembers) { + actors[`gov${idx}`] = gov; + idx += 1; + } const setupEndTime = readClock(); const setupCranks = getCrankNumber(); @@ -544,8 +626,13 @@ export const makeBenchmarkerator = async () => { printSetupStats(setupStats); log('-'.repeat(70)); const benchmarkReport = { setup: setupStats }; + const tools = { + ...swingsetTestKit, + ...liquidationTestKit, + walletFactoryDriver, + }; - const context = harden({ options, argv, actors }); + const context = { options, argv, actors, tools }; /** * Add a benchmark to the set being run by an execution of the benchmark @@ -561,8 +648,16 @@ export const makeBenchmarkerator = async () => { typeof benchmark.setup === 'function' || Fail`benchmark setup must be a function`; } + if (benchmark.setupRound) { + typeof benchmark.setupRound === 'function' || + Fail`benchmark setupRound must be a function`; + } benchmark.executeRound || Fail`no executeRound function for benchmark ${title}`; + if (benchmark.finishRound) { + typeof benchmark.finishRound === 'function' || + Fail`benchmark finishRound must be a function`; + } typeof benchmark.executeRound === 'function' || Fail`benchmark executeRound must be a function`; if (benchmark.finish) { @@ -594,25 +689,31 @@ export const makeBenchmarkerator = async () => { benchmarkContext.config = await (benchmark.setup ? benchmark.setup(benchmarkContext) : {}); - const roundsStartRawStats = controller.getStats(); - const roundsStartTime = readClock(); - const cranksAtRoundsStart = getCrankNumber(); + log(`Benchmark "${title}" setup complete`); + log(`------------------------------------------------------------------`); + const perRoundStats = []; for (let round = 1; round <= rounds; round += 1) { + if (benchmark.setupRound) { + await benchmark.setupRound(benchmarkContext, round); + } + const start = { + rawStats: controller.getStats(), + time: readClock(), + cranks: getCrankNumber(), + }; log(`Benchmark "${title}" round ${round}:`); await benchmark.executeRound(benchmarkContext, round); + const end = { + rawStats: controller.getStats(), + time: readClock(), + cranks: getCrankNumber(), + }; + perRoundStats.push({ start, end }); + if (benchmark.finishRound) { + await benchmark.finishRound(benchmarkContext, round); + } } - const roundsEndRawStats = controller.getStats(); - const roundsEndTime = readClock(); - const cranksAtRoundsEnd = getCrankNumber(); - const cranksDuringRounds = cranksAtRoundsEnd - cranksAtRoundsStart; - const roundsElapsedTime = Number(roundsEndTime - roundsStartTime); - const benchmarkStats = organizeRoundsStats( - roundsStartRawStats, - roundsEndRawStats, - roundsElapsedTime, - cranksDuringRounds, - rounds, - ); + const benchmarkStats = organizeRoundsStats(rounds, perRoundStats); log('-'.repeat(70)); log(`Benchmark "${title}" stats:`); printBenchmarkStats(benchmarkStats); @@ -624,8 +725,15 @@ export const makeBenchmarkerator = async () => { } await eventLoopIteration(); await shutdown(); - if (dumpFile) { - fs.writeFileSync(dumpFile, JSON.stringify(benchmarkReport, null, 2)); + if (outputFile) { + fs.writeFileSync( + outputFile, + JSON.stringify( + benchmarkReport, + (_key, value) => (typeof value === 'bigint' ? Number(value) : value), + 2, + ), + ); } }; diff --git a/packages/boot/test/bootstrapTests/test-addAssets.ts b/packages/boot/test/bootstrapTests/test-addAssets.ts index eecdaffe601..3494f0a6a56 100644 --- a/packages/boot/test/bootstrapTests/test-addAssets.ts +++ b/packages/boot/test/bootstrapTests/test-addAssets.ts @@ -6,7 +6,7 @@ import { TimeMath } from '@agoric/time'; import { LiquidationTestContext, makeLiquidationTestContext, -} from './liquidation.ts'; +} from '../../tools/liquidation.ts'; import { makeProposalExtractor } from '../../tools/supports.ts'; const test = anyTest as TestFn< diff --git a/packages/boot/test/bootstrapTests/test-liquidation-1.ts b/packages/boot/test/bootstrapTests/test-liquidation-1.ts index 7d3794528d4..b9922456dc0 100644 --- a/packages/boot/test/bootstrapTests/test-liquidation-1.ts +++ b/packages/boot/test/bootstrapTests/test-liquidation-1.ts @@ -12,7 +12,7 @@ import { makeLiquidationTestContext, scale6, LiquidationSetup, -} from './liquidation.ts'; +} from '../../tools/liquidation.ts'; const test = anyTest as TestFn; diff --git a/packages/boot/test/bootstrapTests/test-liquidation-2b.ts b/packages/boot/test/bootstrapTests/test-liquidation-2b.ts index 2225e165e1a..e9c0bc2a361 100644 --- a/packages/boot/test/bootstrapTests/test-liquidation-2b.ts +++ b/packages/boot/test/bootstrapTests/test-liquidation-2b.ts @@ -17,7 +17,7 @@ import { LiquidationTestContext, makeLiquidationTestContext, scale6, -} from './liquidation.ts'; +} from '../../tools/liquidation.ts'; const test = anyTest as TestFn; diff --git a/packages/boot/test/bootstrapTests/test-liquidation-concurrent-1.ts b/packages/boot/test/bootstrapTests/test-liquidation-concurrent-1.ts index 886cf9d212f..e6ee036f4fb 100644 --- a/packages/boot/test/bootstrapTests/test-liquidation-concurrent-1.ts +++ b/packages/boot/test/bootstrapTests/test-liquidation-concurrent-1.ts @@ -12,7 +12,7 @@ import { likePayouts, makeLiquidationTestContext, scale6, -} from './liquidation.ts'; +} from '../../tools/liquidation.ts'; const test = anyTest as TestFn; diff --git a/packages/boot/test/bootstrapTests/test-liquidation-concurrent-2b.ts b/packages/boot/test/bootstrapTests/test-liquidation-concurrent-2b.ts index 62f7c597644..19677638b5b 100644 --- a/packages/boot/test/bootstrapTests/test-liquidation-concurrent-2b.ts +++ b/packages/boot/test/bootstrapTests/test-liquidation-concurrent-2b.ts @@ -15,7 +15,7 @@ import { ensureVaultCollateral, makeLiquidationTestContext, scale6, -} from './liquidation.ts'; +} from '../../tools/liquidation.ts'; const test = anyTest as TestFn; diff --git a/packages/boot/test/bootstrapTests/test-walletSurvivesZoeRestart.ts b/packages/boot/test/bootstrapTests/test-walletSurvivesZoeRestart.ts index 60a5b36e7b2..910234eedd9 100644 --- a/packages/boot/test/bootstrapTests/test-walletSurvivesZoeRestart.ts +++ b/packages/boot/test/bootstrapTests/test-walletSurvivesZoeRestart.ts @@ -12,7 +12,7 @@ import { makeLiquidationTestContext, scale6, LiquidationSetup, -} from './liquidation.ts'; +} from '../../tools/liquidation.ts'; const test = anyTest as TestFn; diff --git a/packages/boot/tools/drivers.ts b/packages/boot/tools/drivers.ts index fb04aa0972b..fe51d2b3769 100644 --- a/packages/boot/tools/drivers.ts +++ b/packages/boot/tools/drivers.ts @@ -315,6 +315,7 @@ export const makeGovernanceDriver = async ( await enactLatestProposal(); await testKit.advanceTimeBy(1, 'minutes'); }, + ecMembers, }; }; diff --git a/packages/boot/test/bootstrapTests/liquidation.ts b/packages/boot/tools/liquidation.ts similarity index 85% rename from packages/boot/test/bootstrapTests/liquidation.ts rename to packages/boot/tools/liquidation.ts index e7ec6ce39cc..117753dd5db 100644 --- a/packages/boot/test/bootstrapTests/liquidation.ts +++ b/packages/boot/tools/liquidation.ts @@ -9,12 +9,12 @@ import { } from '@agoric/vats/tools/board-utils.js'; import { Offers } from '@agoric/inter-protocol/src/clientSupport.js'; import type { ExecutionContext } from 'ava'; -import { makeSwingsetTestKit } from '../../tools/supports.ts'; +import { makeSwingsetTestKit } from './supports.ts'; import { makeGovernanceDriver, makePriceFeedDriver, makeWalletFactoryDriver, -} from '../../tools/drivers.ts'; +} from './drivers.ts'; export type LiquidationSetup = { vaults: { @@ -63,52 +63,13 @@ export const likePayouts = ({ Bid, Collateral }) => ({ }, }); -export const makeLiquidationTestContext = async t => { - console.time('DefaultTestContext'); - const swingsetTestKit = await makeSwingsetTestKit(t.log, 'bundles/vaults', { - configSpecifier: '@agoric/vm-config/decentral-main-vaults-config.json', - }); - - const { runUtils, storage } = swingsetTestKit; - console.timeLog('DefaultTestContext', 'swingsetTestKit'); - const { EV } = runUtils; - - // Wait for ATOM to make it into agoricNames - await EV.vat('bootstrap').consumeItem('vaultFactoryKit'); - console.timeLog('DefaultTestContext', 'vaultFactoryKit'); - - // has to be late enough for agoricNames data to have been published - const agoricNamesRemotes: AgoricNamesRemotes = - makeAgoricNamesRemotesFromFakeStorage(swingsetTestKit.storage); - const refreshAgoricNamesRemotes = () => { - Object.assign( - agoricNamesRemotes, - makeAgoricNamesRemotesFromFakeStorage(swingsetTestKit.storage), - ); - }; - agoricNamesRemotes.brand.ATOM || Fail`ATOM missing from agoricNames`; - console.timeLog('DefaultTestContext', 'agoricNamesRemotes'); - - const walletFactoryDriver = await makeWalletFactoryDriver( - runUtils, - storage, - agoricNamesRemotes, - ); - console.timeLog('DefaultTestContext', 'walletFactoryDriver'); - - const governanceDriver = await makeGovernanceDriver( - swingsetTestKit, - agoricNamesRemotes, - walletFactoryDriver, - // TODO read from the config file - [ - 'agoric1gx9uu7y6c90rqruhesae2t7c2vlw4uyyxlqxrx', - 'agoric1d4228cvelf8tj65f4h7n2td90sscavln2283h5', - 'agoric14543m33dr28x7qhwc558hzlj9szwhzwzpcmw6a', - ], - ); - console.timeLog('DefaultTestContext', 'governanceDriver'); - +export const makeLiquidationTestKit = async ({ + swingsetTestKit, + agoricNamesRemotes, + walletFactoryDriver, + governanceDriver, + like, +}) => { const priceFeedDrivers = {} as Record< string, Awaited> @@ -130,21 +91,22 @@ export const makeLiquidationTestContext = async t => { const managerPath = `published.vaultFactory.managers.manager${managerIndex}`; const { advanceTimeBy, readLatest } = swingsetTestKit; - !priceFeedDrivers[collateralBrandKey] || - Fail`setup for ${collateralBrandKey} already ran`; - priceFeedDrivers[collateralBrandKey] = await makePriceFeedDriver( - collateralBrandKey, - agoricNamesRemotes, - walletFactoryDriver, - // TODO read from the config file - [ - 'agoric1krunjcqfrf7la48zrvdfeeqtls5r00ep68mzkr', - 'agoric19uscwxdac6cf6z7d5e26e0jm0lgwstc47cpll8', - 'agoric144rrhh4m09mh7aaffhm6xy223ym76gve2x7y78', - 'agoric19d6gnr9fyp6hev4tlrg87zjrzsd5gzr5qlfq2p', - 'agoric1n4fcxsnkxe4gj6e24naec99hzmc4pjfdccy5nj', - ], - ); + await 0; + if (!priceFeedDrivers[collateralBrandKey]) { + priceFeedDrivers[collateralBrandKey] = await makePriceFeedDriver( + collateralBrandKey, + agoricNamesRemotes, + walletFactoryDriver, + // TODO read from the config file + [ + 'agoric1krunjcqfrf7la48zrvdfeeqtls5r00ep68mzkr', + 'agoric19uscwxdac6cf6z7d5e26e0jm0lgwstc47cpll8', + 'agoric144rrhh4m09mh7aaffhm6xy223ym76gve2x7y78', + 'agoric19d6gnr9fyp6hev4tlrg87zjrzsd5gzr5qlfq2p', + 'agoric1n4fcxsnkxe4gj6e24naec99hzmc4pjfdccy5nj', + ], + ); + } // price feed logic treats zero time as "unset" so advance to nonzero await advanceTimeBy(1, 'seconds'); @@ -181,7 +143,7 @@ export const makeLiquidationTestContext = async t => { ); // confirm Relevant Governance Parameter Assumptions - t.like(readLatest(`${managerPath}.governance`), { + like(readLatest(`${managerPath}.governance`), { current: { DebtLimit: { value: { value: DebtLimitValue } }, InterestRate: { @@ -206,7 +168,7 @@ export const makeLiquidationTestContext = async t => { }, }, }); - t.like(readLatest('published.auction.governance'), { + like(readLatest('published.auction.governance'), { current: { AuctionStartDelay: { type: 'relativeTime', value: { relValue: 2n } }, ClockStep: { @@ -239,7 +201,7 @@ export const makeLiquidationTestContext = async t => { const notification = readLatest( `published.vaultFactory.managers.manager${managerIndex}.vaults.vault${vaultIndex}`, ); - t.like(notification, partial); + like(notification, partial); }, }; @@ -247,6 +209,7 @@ export const makeLiquidationTestContext = async t => { collateralBrandKey: string, managerIndex: number, setup: LiquidationSetup, + base: number = 0, ) => { await setupStartingState({ collateralBrandKey, @@ -258,14 +221,14 @@ export const makeLiquidationTestContext = async t => { await walletFactoryDriver.provideSmartWallet('agoric1minter'); for (let i = 0; i < setup.vaults.length; i += 1) { - const offerId = `open-${collateralBrandKey}-vault${i}`; + const offerId = `open-${collateralBrandKey}-vault${base + i}`; await minter.executeOfferMaker(Offers.vaults.OpenVault, { offerId, collateralBrandKey, wantMinted: setup.vaults[i].ist, giveCollateral: setup.vaults[i].atom, }); - t.like(minter.getLatestUpdateRecord(), { + like(minter.getLatestUpdateRecord(), { updated: 'offerStatus', status: { id: offerId, numWantsSatisfied: 1 }, }); @@ -313,7 +276,7 @@ export const makeLiquidationTestContext = async t => { ...setup.bids[i], maxBuy, }); - t.like( + like( swingsetTestKit.readLatest(`published.wallet.${buyerWalletAddress}`), { status: { @@ -327,18 +290,74 @@ export const makeLiquidationTestContext = async t => { }; return { - ...swingsetTestKit, - agoricNamesRemotes, check, - governanceDriver, priceFeedDrivers, - refreshAgoricNamesRemotes, - walletFactoryDriver, setupVaults, placeBids, }; }; +export const makeLiquidationTestContext = async t => { + const swingsetTestKit = await makeSwingsetTestKit(t.log, 'bundles/vaults'); + console.time('DefaultTestContext'); + + const { runUtils, storage } = swingsetTestKit; + console.timeLog('DefaultTestContext', 'swingsetTestKit'); + const { EV } = runUtils; + + // Wait for ATOM to make it into agoricNames + await EV.vat('bootstrap').consumeItem('vaultFactoryKit'); + console.timeLog('DefaultTestContext', 'vaultFactoryKit'); + + // has to be late enough for agoricNames data to have been published + const agoricNamesRemotes: AgoricNamesRemotes = + makeAgoricNamesRemotesFromFakeStorage(storage); + const refreshAgoricNamesRemotes = () => { + Object.assign( + agoricNamesRemotes, + makeAgoricNamesRemotesFromFakeStorage(storage), + ); + }; + agoricNamesRemotes.brand.ATOM || Fail`ATOM missing from agoricNames`; + console.timeLog('DefaultTestContext', 'agoricNamesRemotes'); + + const walletFactoryDriver = await makeWalletFactoryDriver( + runUtils, + storage, + agoricNamesRemotes, + ); + console.timeLog('DefaultTestContext', 'walletFactoryDriver'); + + const governanceDriver = await makeGovernanceDriver( + swingsetTestKit, + agoricNamesRemotes, + walletFactoryDriver, + // TODO read from the config file + [ + 'agoric1ldmtatp24qlllgxmrsjzcpe20fvlkp448zcuce', + 'agoric140dmkrz2e42ergjj7gyvejhzmjzurvqeq82ang', + 'agoric1w8wktaur4zf8qmmtn3n7x3r0jhsjkjntcm3u6h', + ], + ); + console.timeLog('DefaultTestContext', 'governanceDriver'); + + const liquidationTestKit = await makeLiquidationTestKit({ + swingsetTestKit, + agoricNamesRemotes, + walletFactoryDriver, + governanceDriver, + like: t.like, + }); + return { + ...swingsetTestKit, + ...liquidationTestKit, + agoricNamesRemotes, + refreshAgoricNamesRemotes, + walletFactoryDriver, + governanceDriver, + }; +}; + export type LiquidationTestContext = Awaited< ReturnType >; diff --git a/packages/vm-config/decentral-itest-vaults-config.json b/packages/vm-config/decentral-itest-vaults-config.json index a6664b50cd8..c2b63b11159 100644 --- a/packages/vm-config/decentral-itest-vaults-config.json +++ b/packages/vm-config/decentral-itest-vaults-config.json @@ -104,6 +104,34 @@ } ] }, + { + "module": "@agoric/builders/scripts/inter-protocol/add-collateral-core.js", + "entrypoint": "psmProposalBuilder", + "args": [ + { + "anchorOptions": { + "denom": "ibc/3914BDEF46F429A26917E4D8D434620EC4817DC6B6E68FB327E190902F1E9242", + "decimalPlaces": 18, + "keyword": "DAI_axl", + "proposedName": "DAI" + } + } + ] + }, + { + "module": "@agoric/builders/scripts/inter-protocol/add-collateral-core.js", + "entrypoint": "psmProposalBuilder", + "args": [ + { + "anchorOptions": { + "denom": "ibc/3D5291C23D776C3AA7A7ABB34C7B023193ECD2BC42EA19D3165B2CF9652117E7", + "decimalPlaces": 18, + "keyword": "DAI_grv", + "proposedName": "DAI" + } + } + ] + }, { "module": "@agoric/builders/scripts/inter-protocol/price-feed-core.js", "entrypoint": "defaultProposalBuilder", @@ -112,7 +140,7 @@ "contractTerms": { "POLL_INTERVAL": 30, "maxSubmissionCount": 1000, - "minSubmissionCount": 1, + "minSubmissionCount": 3, "restartDelay": 1, "timeout": 10, "minSubmissionValue": 1, @@ -120,8 +148,11 @@ }, "AGORIC_INSTANCE_NAME": "ATOM-USD price feed", "oracleAddresses": [ - "agoric1ldmtatp24qlllgxmrsjzcpe20fvlkp448zcuce", - "agoric140dmkrz2e42ergjj7gyvejhzmjzurvqeq82ang" + "agoric1krunjcqfrf7la48zrvdfeeqtls5r00ep68mzkr", + "agoric19uscwxdac6cf6z7d5e26e0jm0lgwstc47cpll8", + "agoric144rrhh4m09mh7aaffhm6xy223ym76gve2x7y78", + "agoric19d6gnr9fyp6hev4tlrg87zjrzsd5gzr5qlfq2p", + "agoric1n4fcxsnkxe4gj6e24naec99hzmc4pjfdccy5nj" ], "IN_BRAND_LOOKUP": [ "agoricNames", From 8f806bfdccddc067dfd848ea649230913b75c6be Mon Sep 17 00:00:00 2001 From: Chip Morningstar Date: Tue, 5 Dec 2023 12:55:05 -0800 Subject: [PATCH 17/58] chore: updates based on review comments --- packages/benchmark/src/benchmarkerator.js | 5 ++++- packages/boot/tools/liquidation.ts | 22 ++++++++++++++-------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/packages/benchmark/src/benchmarkerator.js b/packages/benchmark/src/benchmarkerator.js index d648ccbe5ff..88f5f23e091 100644 --- a/packages/benchmark/src/benchmarkerator.js +++ b/packages/benchmark/src/benchmarkerator.js @@ -440,6 +440,8 @@ const printBenchmarkStats = stats => { `${stats.rounds} rounds in ${stats.elapsedTime}ns (${stats.timePerRound.toFixed(3)}/round})`, ); + // There are lots of temp variables used here simply so things lay out cleanly + // in the source text. Don't try to read too much meaning into the names themselves. const wc1 = 32; const hc1 = `${'Counter'.padEnd(wc1)}`; const dc1 = `${''.padEnd(wc1, '-')}`; @@ -592,7 +594,8 @@ export const makeBenchmarkerator = async () => { agoricNamesRemotes, walletFactoryDriver, governanceDriver, - like: () => {}, + // @ts-expect-error missing 'skip' property of real Ava like + t: { like: () => {} }, // XXX noop }); const actors = { diff --git a/packages/boot/tools/liquidation.ts b/packages/boot/tools/liquidation.ts index 117753dd5db..43320634475 100644 --- a/packages/boot/tools/liquidation.ts +++ b/packages/boot/tools/liquidation.ts @@ -68,7 +68,13 @@ export const makeLiquidationTestKit = async ({ agoricNamesRemotes, walletFactoryDriver, governanceDriver, - like, + t, +}: { + swingsetTestKit: SwingsetTestKit; + agoricNamesRemotes: AgoricNamesRemotes; + walletFactoryDriver: WalletFactoryDriver; + governanceDriver: GovernanceDriver; + t: Pick; }) => { const priceFeedDrivers = {} as Record< string, @@ -91,7 +97,7 @@ export const makeLiquidationTestKit = async ({ const managerPath = `published.vaultFactory.managers.manager${managerIndex}`; const { advanceTimeBy, readLatest } = swingsetTestKit; - await 0; + await null; if (!priceFeedDrivers[collateralBrandKey]) { priceFeedDrivers[collateralBrandKey] = await makePriceFeedDriver( collateralBrandKey, @@ -143,7 +149,7 @@ export const makeLiquidationTestKit = async ({ ); // confirm Relevant Governance Parameter Assumptions - like(readLatest(`${managerPath}.governance`), { + t.like(readLatest(`${managerPath}.governance`), { current: { DebtLimit: { value: { value: DebtLimitValue } }, InterestRate: { @@ -168,7 +174,7 @@ export const makeLiquidationTestKit = async ({ }, }, }); - like(readLatest('published.auction.governance'), { + t.like(readLatest('published.auction.governance'), { current: { AuctionStartDelay: { type: 'relativeTime', value: { relValue: 2n } }, ClockStep: { @@ -201,7 +207,7 @@ export const makeLiquidationTestKit = async ({ const notification = readLatest( `published.vaultFactory.managers.manager${managerIndex}.vaults.vault${vaultIndex}`, ); - like(notification, partial); + t.like(notification, partial); }, }; @@ -228,7 +234,7 @@ export const makeLiquidationTestKit = async ({ wantMinted: setup.vaults[i].ist, giveCollateral: setup.vaults[i].atom, }); - like(minter.getLatestUpdateRecord(), { + t.like(minter.getLatestUpdateRecord(), { updated: 'offerStatus', status: { id: offerId, numWantsSatisfied: 1 }, }); @@ -276,7 +282,7 @@ export const makeLiquidationTestKit = async ({ ...setup.bids[i], maxBuy, }); - like( + t.like( swingsetTestKit.readLatest(`published.wallet.${buyerWalletAddress}`), { status: { @@ -346,7 +352,7 @@ export const makeLiquidationTestContext = async t => { agoricNamesRemotes, walletFactoryDriver, governanceDriver, - like: t.like, + t, }); return { ...swingsetTestKit, From 881bf9d0ecb3ec2d786bc645a091ad313cd6375e Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Tue, 5 Dec 2023 14:32:24 -0800 Subject: [PATCH 18/58] chore(types): boot tool driver types --- packages/boot/tools/drivers.ts | 6 ++++++ packages/boot/tools/liquidation.ts | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/boot/tools/drivers.ts b/packages/boot/tools/drivers.ts index fe51d2b3769..d15e19a293b 100644 --- a/packages/boot/tools/drivers.ts +++ b/packages/boot/tools/drivers.ts @@ -197,6 +197,8 @@ export const makePriceFeedDriver = async ( }, }; }; +harden(makePriceFeedDriver); +export type PriceFeedDriver = Awaited>; export const makeGovernanceDriver = async ( testKit: SwingsetTestKit, @@ -318,6 +320,8 @@ export const makeGovernanceDriver = async ( ecMembers, }; }; +harden(makeGovernanceDriver); +export type GovernanceDriver = Awaited>; export const makeZoeDriver = async (testKit: SwingsetTestKit) => { const { EV } = testKit.runUtils; @@ -402,3 +406,5 @@ export const makeZoeDriver = async (testKit: SwingsetTestKit) => { }, }; }; +harden(makeZoeDriver); +export type ZoeDriver = Awaited>; diff --git a/packages/boot/tools/liquidation.ts b/packages/boot/tools/liquidation.ts index 43320634475..9f5c9932c91 100644 --- a/packages/boot/tools/liquidation.ts +++ b/packages/boot/tools/liquidation.ts @@ -9,8 +9,11 @@ import { } from '@agoric/vats/tools/board-utils.js'; import { Offers } from '@agoric/inter-protocol/src/clientSupport.js'; import type { ExecutionContext } from 'ava'; -import { makeSwingsetTestKit } from './supports.ts'; +import { type SwingsetTestKit, makeSwingsetTestKit } from './supports.ts'; import { + type GovernanceDriver, + type PriceFeedDriver, + type WalletFactoryDriver, makeGovernanceDriver, makePriceFeedDriver, makeWalletFactoryDriver, @@ -76,10 +79,7 @@ export const makeLiquidationTestKit = async ({ governanceDriver: GovernanceDriver; t: Pick; }) => { - const priceFeedDrivers = {} as Record< - string, - Awaited> - >; + const priceFeedDrivers = {} as Record; console.timeLog('DefaultTestContext', 'priceFeedDriver'); From a926685cfe08efdef78aa1681e07e8b7436e6a40 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Mon, 11 Dec 2023 09:28:52 -0800 Subject: [PATCH 19/58] ci: defer Loadgen compatibility --- .github/workflows/integration.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 9710fa138eb..557c483770e 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -130,7 +130,8 @@ jobs: path: ./agoric-sdk - uses: ./agoric-sdk/.github/actions/restore-node with: - node-version: 18.x + # XXX loadgen not compatible with 18.19 https://github.com/Agoric/agoric-sdk/pull/8365#issuecomment-1848003597 + node-version: 18.18 path: ./agoric-sdk # Forces xsnap to initialize all memory to random data, which increases # the chances the content of snapshots may deviate between validators From f0654e0ea84e94316bbdca2fe55cc5bb6f57752d Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Tue, 12 Dec 2023 08:29:28 -0800 Subject: [PATCH 20/58] feat: guard ContractGovernorKit --- .../governance/src/contractGovernorKit.js | 47 +++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/packages/governance/src/contractGovernorKit.js b/packages/governance/src/contractGovernorKit.js index 1f5f5d900d3..14cc3d79911 100644 --- a/packages/governance/src/contractGovernorKit.js +++ b/packages/governance/src/contractGovernorKit.js @@ -1,16 +1,57 @@ import { Fail } from '@agoric/assert'; -import { makeTracer } from '@agoric/internal'; -import { prepareExoClassKit } from '@agoric/vat-data'; +import { UnguardedHelperI, makeTracer } from '@agoric/internal'; +import { M, prepareExoClassKit } from '@agoric/vat-data'; import { E } from '@endo/eventual-send'; +import { + InvitationShape, + InstanceHandleShape, + InstallationShape, +} from '@agoric/zoe/src/typeGuards.js'; +import { TimestampShape } from '@agoric/time'; import { setupApiGovernance } from './contractGovernance/governApi.js'; import { setupFilterGovernance } from './contractGovernance/governFilter.js'; import { CONTRACT_ELECTORATE, setupParamGovernance, } from './contractGovernance/governParam.js'; +import { ClosingRuleShape, ParamChangesSpecShape } from './typeGuards.js'; const trace = makeTracer('CGK', false); +const ContractGovernorKitI = { + helper: UnguardedHelperI, + creator: M.interface('Contract Governor Kit creator', { + replaceElectorate: M.call(InvitationShape).returns(M.promise()), + voteOnParamChanges: M.call( + InstallationShape, + TimestampShape, + ParamChangesSpecShape, + ).returns(M.promise()), + voteOnApiInvocation: M.call( + M.string(), + M.arrayOf(M.any()), + InstallationShape, + TimestampShape, + ).returns(M.promise()), + voteOnOfferFilter: M.call( + InstallationShape, + TimestampShape, + M.arrayOf(M.string()), + ).returns(M.promise()), + getCreatorFacet: M.call().returns(M.remotable('ElectorateCreator')), + getAdminFacet: M.call().returns(M.remotable('ElectorateAdmin')), + getInstance: M.call().returns(InstanceHandleShape), + getPublicFacet: M.call().returns(M.remotable('ElectoratePublic')), + }), + public: M.interface('Contract Governor Kit public', { + getElectorate: M.call().returns(M.promise(/* Instance */)), + getGovernedContract: M.call().returns(InstanceHandleShape), + validateVoteCounter: M.call(InstanceHandleShape).returns(M.promise()), + validateElectorate: M.call(InstanceHandleShape).returns(M.promise()), + validateTimer: M.call(ClosingRuleShape).returns(), + }), +}; + /** * * @param {import('@agoric/vat-data').Baggage} baggage @@ -36,7 +77,7 @@ export const prepareContractGovernorKit = (baggage, powers) => { const makeContractGovernorKit = prepareExoClassKit( baggage, 'ContractGovernorKit', - undefined, + ContractGovernorKitI, /** * @param {import('@agoric/zoe/src/zoeService/utils.js').StartedInstanceKit} startedInstanceKit * @param {LimitedCF} limitedCreatorFacet From 6ba0af935589dd2f8dab5ff51317b45362e5c4d4 Mon Sep 17 00:00:00 2001 From: Chip Morningstar Date: Wed, 6 Dec 2023 18:28:44 -0800 Subject: [PATCH 21/58] feat: add a `reapAllVats` call to the controller Closes #8626 --- .../SwingSet/src/controller/controller.js | 4 + packages/SwingSet/src/kernel/kernel.js | 10 +++ packages/SwingSet/src/types-external.js | 5 +- .../test/reap-all/bootstrap-reap-all.js | 23 +++++ .../SwingSet/test/reap-all/test-reap-all.js | 83 +++++++++++++++++++ packages/SwingSet/test/reap-all/vat-dumbo.js | 9 ++ 6 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 packages/SwingSet/test/reap-all/bootstrap-reap-all.js create mode 100644 packages/SwingSet/test/reap-all/test-reap-all.js create mode 100644 packages/SwingSet/test/reap-all/vat-dumbo.js diff --git a/packages/SwingSet/src/controller/controller.js b/packages/SwingSet/src/controller/controller.js index 3a973b7fd47..249036e9c87 100644 --- a/packages/SwingSet/src/controller/controller.js +++ b/packages/SwingSet/src/controller/controller.js @@ -327,6 +327,10 @@ export async function makeSwingsetController( return kernel.shutdown(); }, + reapAllVats() { + kernel.reapAllVats(); + }, + changeKernelOptions(options) { kernel.changeKernelOptions(options); }, diff --git a/packages/SwingSet/src/kernel/kernel.js b/packages/SwingSet/src/kernel/kernel.js index 10df109655b..fc27f45022a 100644 --- a/packages/SwingSet/src/kernel/kernel.js +++ b/packages/SwingSet/src/kernel/kernel.js @@ -1750,6 +1750,15 @@ export default function buildKernel( } } + function reapAllVats() { + for (const [_, vatID] of kernelKeeper.getStaticVats()) { + kernelKeeper.scheduleReap(vatID); + } + for (const vatID of kernelKeeper.getDynamicVats()) { + kernelKeeper.scheduleReap(vatID); + } + } + async function step() { if (kernelPanic) { throw kernelPanic; @@ -1935,6 +1944,7 @@ export default function buildKernel( step, run, shutdown, + reapAllVats, changeKernelOptions, // the rest are for testing and debugging diff --git a/packages/SwingSet/src/types-external.js b/packages/SwingSet/src/types-external.js index 8b6317a7374..72179e46ce9 100644 --- a/packages/SwingSet/src/types-external.js +++ b/packages/SwingSet/src/types-external.js @@ -155,7 +155,10 @@ export {}; * @typedef {{ * bundle: Bundle * }} BundleRef - * @typedef {(SourceSpec | BundleSpec | BundleRef ) & { + * @typedef {{ + * bundleName: string + * }} BundleName + * @typedef {(SourceSpec | BundleSpec | BundleRef | BundleName ) & { * creationOptions?: Record, * parameters?: Record, * }} SwingSetConfigProperties diff --git a/packages/SwingSet/test/reap-all/bootstrap-reap-all.js b/packages/SwingSet/test/reap-all/bootstrap-reap-all.js new file mode 100644 index 00000000000..615e7c46f45 --- /dev/null +++ b/packages/SwingSet/test/reap-all/bootstrap-reap-all.js @@ -0,0 +1,23 @@ +import { Far, E } from '@endo/far'; + +export function buildRootObject() { + let vatAdmin; + let bcap; + const roots = []; + + return Far('root', { + async bootstrap(vats, devices) { + vatAdmin = await E(vats.vatAdmin).createVatAdminService(devices.vatAdmin); + bcap = await E(vatAdmin).getNamedBundleCap('dumbo'); + console.log('end of bootstrap, vatAdmin', vatAdmin); + }, + + async createDynamicVats() { + for (let i = 0; i < 3; i += 1) { + const res = await E(vatAdmin).createVat(bcap); + roots.push(res.root); + } + return roots; + }, + }); +} diff --git a/packages/SwingSet/test/reap-all/test-reap-all.js b/packages/SwingSet/test/reap-all/test-reap-all.js new file mode 100644 index 00000000000..3e7ed85a70f --- /dev/null +++ b/packages/SwingSet/test/reap-all/test-reap-all.js @@ -0,0 +1,83 @@ +// eslint-disable-next-line import/order +import { test } from '../../tools/prepare-test-env-ava.js'; + +import { initSwingStore } from '@agoric/swing-store'; +import { kunser } from '@agoric/kmarshal'; + +import { initializeSwingset, makeSwingsetController } from '../../src/index.js'; + +function bfile(name) { + return new URL(name, import.meta.url).pathname; +} + +test('reap all vats', async t => { + /** @type {SwingSetConfig} */ + const config = { + defaultManagerType: 'local', + defaultReapInterval: 4, + bootstrap: 'bootstrap', + vats: { + bootstrap: { sourceSpec: bfile('bootstrap-reap-all.js') }, + staticDumbo1: { bundleName: 'dumbo' }, + staticDumbo2: { bundleName: 'dumbo' }, + staticDumbo3: { bundleName: 'dumbo' }, + }, + bundles: { + dumbo: { sourceSpec: bfile('vat-dumbo.js') }, + }, + }; + + const kernelStorage = initSwingStore().kernelStorage; + await initializeSwingset(config, [], kernelStorage); + const c = await makeSwingsetController(kernelStorage); + t.teardown(c.shutdown); + c.pinVatRoot('bootstrap'); + c.pinVatRoot('staticDumbo1'); + c.pinVatRoot('staticDumbo2'); + c.pinVatRoot('staticDumbo3'); + await c.run(); + + const kpid = c.queueToVatRoot('bootstrap', 'createDynamicVats'); + await c.run(); + + const dynamicRoots = kunser(c.kpResolution(kpid)); + for (let i = 0; i < 3; i += 1) { + for (let j = 0; j < i + 1; j += 1) { + c.queueToVatRoot(`staticDumbo${i + 1}`, 'doSomething', [ + `staticDumbo${i + 1} #${j + 1}`, + ]); + } + } + for (let i = 0; i < 3; i += 1) { + for (let j = 0; j < i + 1; j += 1) { + c.queueToVatObject(dynamicRoots[i], 'doSomething', [ + `dynamicDumbo${i + 1} #${j + 1}`, + ]); + } + } + // Note: no call to c.run() here, so all the above messages are still enqueued + + const dumpBefore = c.dump(); + t.is(dumpBefore.acceptanceQueue.length, 12); + t.is(dumpBefore.reapQueue.length, 0); + t.is(dumpBefore.runQueue.length, 0); + + c.reapAllVats(); + const dumpPreReap = c.dump(); + t.is(dumpPreReap.acceptanceQueue.length, 12); + t.is(dumpPreReap.reapQueue.length, 11); + t.is(dumpBefore.runQueue.length, 0); + // prettier-ignore + const reapQueueReference = + new Set(['v1', 'v3', 'v6', 'v7', 'v8', 'v5', 'v2', 'v4', 'v9', 'v10', 'v11']) + const reapQueueActual = new Set(dumpPreReap.reapQueue); + t.deepEqual(reapQueueActual, reapQueueReference); + + await c.run(); + const dumpPostReap = c.dump(); + t.is(dumpPostReap.acceptanceQueue.length, 0); + t.is(dumpPostReap.reapQueue.length, 0); + t.is(dumpBefore.runQueue.length, 0); + + t.pass(); +}); diff --git a/packages/SwingSet/test/reap-all/vat-dumbo.js b/packages/SwingSet/test/reap-all/vat-dumbo.js new file mode 100644 index 00000000000..3770cd3dde1 --- /dev/null +++ b/packages/SwingSet/test/reap-all/vat-dumbo.js @@ -0,0 +1,9 @@ +import { Far } from '@endo/far'; + +export function buildRootObject() { + return Far('root', { + doSomething(msg) { + console.log(`doSomething: ${msg}`); + }, + }); +} From 164f959cf5638beb8abef04bc7431333be04e1ff Mon Sep 17 00:00:00 2001 From: Chip Morningstar Date: Fri, 8 Dec 2023 17:40:39 -0800 Subject: [PATCH 22/58] chore: documentation copy editing --- .../SwingSet/src/controller/startNodeSubprocess.js | 4 ++++ packages/benchmark/doc/benchmarkerator.md | 12 +++++++----- packages/benchmark/src/benchmarkerator.js | 10 +++++----- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/packages/SwingSet/src/controller/startNodeSubprocess.js b/packages/SwingSet/src/controller/startNodeSubprocess.js index ddb77378551..3581242d412 100644 --- a/packages/SwingSet/src/controller/startNodeSubprocess.js +++ b/packages/SwingSet/src/controller/startNodeSubprocess.js @@ -17,6 +17,10 @@ export function makeStartSubprocessWorkerNode( args.push('--cpu-prof-interval'); args.push('100'); args.push('--cpu-prof-name'); + // cf. https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282 + nameDisplayArg = nameDisplayArg + .replaceAll(':', '-') + .replaceAll(/[^a-z0-9._-]/gi, '_'); args.push(`CPU.${nameDisplayArg}.cpuprofile`); } if (debugVats.includes(vatID)) { diff --git a/packages/benchmark/doc/benchmarkerator.md b/packages/benchmark/doc/benchmarkerator.md index 11cf5f9bade..971d7014a4f 100644 --- a/packages/benchmark/doc/benchmarkerator.md +++ b/packages/benchmark/doc/benchmarkerator.md @@ -164,12 +164,14 @@ The supported command line options are: | `-l`
`--local` | Shorthand for `--vat-type local` (vats run in the same process as the kernel; less realistic than `xs-worker` but much faster and easier to debug) | | `-n`
`--node` | Shorthand for `--vat-type node-subprocess` | | `-x`
`--xs` | Shorthand for `--vat-type xs-worker` | -| `-o PATH`
`--output PATH` | Output JSON-formated benchmark data into _PATH_ | -| `-s PATH`
`--slog PATH` | Output a slog file into _PATH_ | -| `-p VATID`
`--profile VATID` | Collect CPU profile data for vat VATID | -| `-d VATID`
`--debug VATID` | Enable debug mode for vat VATID | +| `-o PATH`
`--output PATH` | Output JSON-formated benchmark data into a file named _PATH_ | +| `-s PATH`
`--slog PATH` | Output a slog file into a file named _PATH_ | +| `-p VATID`
`--profile VATID` | Collect CPU profile data for vat VATID (may be specified more than once) | +| `-d VATID`
`--debug VATID` | Enable debug mode for vat VATID (may be specified more than once) | | `-h`
`--help` | Output this helpful usage information and then exit | +VATIDs take the form of a "v" followed by decimal digits, e.g, "v9" or "v47". + An optional `--` flag ends the options list. Any remaining command line arguments after `--` are are passed to the benchmark itself in the `context.argv` array. @@ -191,7 +193,7 @@ crank counts, and the various kernel resource usage data reported by Per-vat JS engine-level profiling is enabled for a given vat via the `--profile VATID` command line option. Note that this option is only available when the vat manager type is `node-process` or `xs-worker`. For `node-process` vats, the -profiling data will be placed in the file `CPU.${vatID}:${vatName}.cpuprofile`. +profiling data will be placed in the file `CPU.${vatID}-${vatName}.cpuprofile`. The `.cpuprofile` file format can be read and displayed by Chrome debugger, VS Code plugins available for this purpose, and various other tools. For `xs-worker` vats, profiling data format is TBD. diff --git a/packages/benchmark/src/benchmarkerator.js b/packages/benchmark/src/benchmarkerator.js index 88f5f23e091..f3032d5b8c9 100644 --- a/packages/benchmark/src/benchmarkerator.js +++ b/packages/benchmark/src/benchmarkerator.js @@ -187,13 +187,13 @@ FLAGS may be: --profile VATID - turn on CPU profile for vat VATID (may be repeated for multiple vats) -d VATID - --debug VATID - turn on debugging for vat VATID + --debug VATID - turn on debugging for vat VATID (may be repeated for multiple vats) -s PATH - --slog PATH - output a slog file into PATH + --slog PATH - output a slog file into a file named PATH -o PATH - --output PATH - output JSON-formatted benchmark data into PATH + --output PATH - output JSON-formatted benchmark data into a file named PATH -h --help - output this helpful usage information and then exit @@ -293,10 +293,10 @@ while (argv[0] && stillScanningArgs) { if (defaultManagerType === 'local') { if (profileVats.length > 0) { - fail`per-vat profiling not supported under vat type 'local'`; + fail(`per-vat profiling not supported under vat type 'local'`); } if (debugVats.length > 0) { - fail`per-vat debugging not supported under vat type 'local'`; + fail(`per-vat debugging not supported under vat type 'local'`); } } From bcda21c4371e904390b1bd09b5adf24ca198621c Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Thu, 14 Dec 2023 14:35:03 -0600 Subject: [PATCH 23/58] chore(SwingSet): convert `run-utils.ts` to JS --- .../tools/{run-utils.ts => run-utils.js} | 133 +++++++++--------- .../boot/test/upgrading/test-upgrade-vats.js | 2 +- packages/boot/tools/drivers.ts | 2 +- 3 files changed, 72 insertions(+), 65 deletions(-) rename packages/SwingSet/tools/{run-utils.ts => run-utils.js} (65%) diff --git a/packages/SwingSet/tools/run-utils.ts b/packages/SwingSet/tools/run-utils.js similarity index 65% rename from packages/SwingSet/tools/run-utils.ts rename to packages/SwingSet/tools/run-utils.js index 54e283d09f1..40f87d50728 100644 --- a/packages/SwingSet/tools/run-utils.ts +++ b/packages/SwingSet/tools/run-utils.js @@ -1,32 +1,29 @@ -/* eslint-disable @jessie.js/safe-await-separator */ import { Fail, q } from '@agoric/assert'; import { kunser } from '@agoric/kmarshal'; import { makeQueue } from '@endo/stream'; -import type { E } from '@endo/eventual-send'; - -import type { SwingsetController } from '../src/controller/controller.js'; const sink = () => {}; -export const makeRunUtils = ( - controller: SwingsetController, - log = (..._) => {}, -) => { +/** + * @param {import('../src/controller/controller.js').SwingsetController} controller + * @param {(...args: any[]) => void} [log] + */ +export const makeRunUtils = (controller, log = (..._) => {}) => { let cranksRun = 0; const mutex = makeQueue(); mutex.put(controller.run()); - const runThunk = async any>( - thunk: T, - ): Promise> => { - try { - // this promise for the last lock may fail - await mutex.get(); - } catch { - // noop because the result will resolve for the previous runMethod return - } + /** + * @template {() => any} T + * @param {T} thunk + * @returns {Promise>} + */ + const runThunk = async thunk => { + // this promise for the last lock may fail + // sink because the result will resolve for the previous runMethod return + await mutex.get().catch(sink); const thunkResult = await thunk(); @@ -60,10 +57,12 @@ export const makeRunUtils = ( } }; - type EVProxy = typeof E & { - sendOnly: (presence: unknown) => Record void>; - vat: (name: string) => Record Promise>; - }; + /** + * @typedef {import('@endo/eventual-send').EProxy & { + * sendOnly: (presence: unknown) => Record void>; + * vat: (name: string) => Record Promise>; + * }} EVProxy + */ // IMPORTANT WARNING TO USERS OF `EV` // @@ -109,48 +108,56 @@ export const makeRunUtils = ( // promise that can remain pending indefinitely, possibly to be settled by a // future message delivery. + /** @type {EVProxy} */ // @ts-expect-error cast, approximate - const EV: EVProxy = presence => - new Proxy(harden({}), { - get: (_t, method, _rx) => { - const boundMethod = (...args) => - queueAndRun(() => - controller.queueToVatObject(presence, method, args), - ); - return harden(boundMethod); - }, - }); - EV.vat = vatName => - new Proxy(harden({}), { - get: (_t, method, _rx) => { - const boundMethod = (...args) => - queueAndRun(() => controller.queueToVatRoot(vatName, method, args)); - return harden(boundMethod); - }, - }); - // @ts-expect-error xxx - EV.sendOnly = presence => - new Proxy(harden({}), { - get: (_t, method, _rx) => { - const boundMethod = (...args) => - queueAndRun( - () => controller.queueToVatObject(presence, method, args), - true, - ); - return harden(boundMethod); - }, - }); - // @ts-expect-error xxx - EV.get = presence => - new Proxy(harden({}), { - get: (_t, pathElement, _rx) => - queueAndRun(() => - controller.queueToVatRoot('bootstrap', 'awaitVatObject', [ - presence, - [pathElement], - ]), - ), - }); + const EV = Object.assign( + presence => + new Proxy(harden({}), { + get: (_t, method, _rx) => { + const boundMethod = (...args) => + queueAndRun(() => + controller.queueToVatObject(presence, method, args), + ); + return harden(boundMethod); + }, + }), + { + vat: vatName => + new Proxy(harden({}), { + get: (_t, method, _rx) => { + const boundMethod = (...args) => + queueAndRun(() => + controller.queueToVatRoot(vatName, method, args), + ); + return harden(boundMethod); + }, + }), + sendOnly: presence => + new Proxy(harden({}), { + get: (_t, method, _rx) => { + const boundMethod = (...args) => + queueAndRun( + () => controller.queueToVatObject(presence, method, args), + true, + ); + return harden(boundMethod); + }, + }), + get: presence => + new Proxy(harden({}), { + get: (_t, pathElement, _rx) => + queueAndRun(() => + controller.queueToVatRoot('bootstrap', 'awaitVatObject', [ + presence, + [pathElement], + ]), + ), + }), + }, + ); return harden({ runThunk, EV }); }; -export type RunUtils = ReturnType; + +/** + * @typedef {ReturnType} RunUtils + */ diff --git a/packages/boot/test/upgrading/test-upgrade-vats.js b/packages/boot/test/upgrading/test-upgrade-vats.js index 2733bcd6c4b..3f6838b5f8c 100644 --- a/packages/boot/test/upgrading/test-upgrade-vats.js +++ b/packages/boot/test/upgrading/test-upgrade-vats.js @@ -3,7 +3,7 @@ import { test as anyTest } from '@agoric/swingset-vat/tools/prepare-test-env-ava import { BridgeId } from '@agoric/internal'; import { buildVatController } from '@agoric/swingset-vat'; -import { makeRunUtils } from '@agoric/swingset-vat/tools/run-utils.ts'; +import { makeRunUtils } from '@agoric/swingset-vat/tools/run-utils.js'; import { resolve as importMetaResolve } from 'import-meta-resolve'; import { matchAmount, matchIter, matchRef } from '../../tools/supports.ts'; diff --git a/packages/boot/tools/drivers.ts b/packages/boot/tools/drivers.ts index d15e19a293b..b2464856d2d 100644 --- a/packages/boot/tools/drivers.ts +++ b/packages/boot/tools/drivers.ts @@ -22,7 +22,7 @@ import type { WalletFactoryStartResult } from '@agoric/vats/src/core/startWallet import type { OfferSpec } from '@agoric/smart-wallet/src/offers.js'; import type { TimerService } from '@agoric/time'; import type { OfferMaker } from '@agoric/smart-wallet/src/types.js'; -import type { RunUtils } from '@agoric/swingset-vat/tools/run-utils.ts'; +import type { RunUtils } from '@agoric/swingset-vat/tools/run-utils.js'; import type { SwingsetTestKit } from './supports.ts'; export const makeWalletFactoryDriver = async ( From b235bd8a53a4ac501040d9f3cb2b810d150a12e8 Mon Sep 17 00:00:00 2001 From: "Mark S. Miller" Date: Fri, 15 Dec 2023 08:08:54 -0800 Subject: [PATCH 24/58] fix(zoe): Fix guards to accurately guard args (#8642) --- packages/zoe/src/typeGuards.js | 17 ++++++++++------- .../zoe/src/zoeService/installationStorage.js | 8 ++++++-- packages/zoe/test/unitTests/test-zoe.js | 9 +++++++++ 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/packages/zoe/src/typeGuards.js b/packages/zoe/src/typeGuards.js index 14af2f0a1ed..cbc330fa374 100644 --- a/packages/zoe/src/typeGuards.js +++ b/packages/zoe/src/typeGuards.js @@ -276,10 +276,12 @@ export const ZoeStorageManagerIKit = harden({ getBundleIDFromInstallation: M.call(InstallationShape).returns( M.eref(M.string()), ), - installBundle: M.call(M.or(InstanceHandleShape, BundleShape)).returns( - M.promise(), - ), - installBundleID: M.call(M.string()).returns(M.promise()), + installBundle: M.call(M.or(InstanceHandleShape, BundleShape)) + .optional(M.string()) + .returns(M.promise()), + installBundleID: M.call(M.string()) + .optional(M.string()) + .returns(M.promise()), getPublicFacet: M.call(InstanceHandleShape).returns( M.eref(M.remotable('PublicFacet')), @@ -310,6 +312,7 @@ export const ZoeStorageManagerIKit = harden({ IssuerPKeywordRecordShape, M.or(InstanceHandleShape, BundleShape), M.or(BundleCapShape, BundleShape), + M.string(), ).returns(M.promise()), unwrapInstallation: M.callWhen(M.eref(InstallationShape)).returns( UnwrappedInstallationShape, @@ -321,10 +324,10 @@ export const ZoeStorageManagerIKit = harden({ }); export const ZoeServiceI = M.interface('ZoeService', { - install: M.call(M.any()).returns(M.promise()), - installBundleID: M.call(M.string()).returns(M.promise()), + install: M.call(M.any()).optional(M.string()).returns(M.promise()), + installBundleID: M.call(M.string()).optional(M.string()).returns(M.promise()), startInstance: M.call(M.eref(InstallationShape)) - .optional(IssuerPKeywordRecordShape, M.any(), M.any()) + .optional(IssuerPKeywordRecordShape, M.record(), M.record(), M.string()) .returns(M.promise()), offer: M.call(M.eref(InvitationShape)) .optional(ProposalShape, PaymentPKeywordRecordShape, M.any()) diff --git a/packages/zoe/src/zoeService/installationStorage.js b/packages/zoe/src/zoeService/installationStorage.js index 9b12197d706..b06c5ed26cf 100644 --- a/packages/zoe/src/zoeService/installationStorage.js +++ b/packages/zoe/src/zoeService/installationStorage.js @@ -84,8 +84,12 @@ export const makeInstallationStorage = (getBundleCapForID, zoeBaggage) => { InstanceHandleShape, M.recordOf(M.string(), M.string({ stringLengthLimit: Infinity })), ), - ).returns(M.promise()), - installBundleID: M.call(M.string()).returns(M.promise()), + ) + .optional(M.string()) + .returns(M.promise()), + installBundleID: M.call(M.string()) + .optional(M.string()) + .returns(M.promise()), unwrapInstallation: M.callWhen(M.await(InstallationShape)).returns( UnwrappedInstallationShape, ), diff --git a/packages/zoe/test/unitTests/test-zoe.js b/packages/zoe/test/unitTests/test-zoe.js index 6d98ddec86c..65b31efae82 100644 --- a/packages/zoe/test/unitTests/test-zoe.js +++ b/packages/zoe/test/unitTests/test-zoe.js @@ -55,6 +55,15 @@ test(`E(zoe).installBundleID bad id`, async t => { }); }); +test(`E(zoe).installBundleID bad label`, async t => { + const { zoe } = setup(); + // @ts-expect-error deliberate invalid arguments for testing + await t.throwsAsync(() => E(zoe).installBundleID('a', harden([])), { + message: + 'In "installBundleID" method of (ZoeService): arg 1?: copyArray [] - Must be a string', + }); +}); + test(`E(zoe).installBundleID(bundleID)`, async t => { const { zoe, vatAdminState } = setup(); const contractPath = `${dirname}/../../src/contracts/atomicSwap`; From 2b56fc66335c44b5d8ba06480841b14a6c4a83fb Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Fri, 15 Dec 2023 08:51:18 -0800 Subject: [PATCH 25/58] feat: agd vstorage 'path' for data or children --- golang/cosmos/x/vstorage/client/cli/query.go | 43 ++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/golang/cosmos/x/vstorage/client/cli/query.go b/golang/cosmos/x/vstorage/client/cli/query.go index 1adc1c9cc7c..92ab345a522 100644 --- a/golang/cosmos/x/vstorage/client/cli/query.go +++ b/golang/cosmos/x/vstorage/client/cli/query.go @@ -4,6 +4,7 @@ import ( "github.com/Agoric/agoric-sdk/golang/cosmos/x/vstorage/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/gogo/protobuf/proto" "github.com/spf13/cobra" ) @@ -18,6 +19,7 @@ func GetQueryCmd(storeKey string) *cobra.Command { swingsetQueryCmd.AddCommand( GetCmdGetData(storeKey), GetCmdGetChildren(storeKey), + GetCmdGetPath(storeKey), ) return swingsetQueryCmd @@ -86,3 +88,44 @@ func GetCmdGetChildren(queryRoute string) *cobra.Command { flags.AddQueryFlagsToCmd(cmd) return cmd } + +// GetCmdGetPath queries vstorage data or children, depending on the path +func GetCmdGetPath(queryRoute string) *cobra.Command { + cmd := &cobra.Command{ + Use: "path [path]", + Short: "get vstorage data, or children if path ends with '.'", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + path := args[0] + + var res proto.Message + + // if path ends with '.' then remove it and query children + if path[len(path)-1] == '.' { + path = path[:len(path)-1] + res, err = queryClient.Children(cmd.Context(), &types.QueryChildrenRequest{ + Path: path, + }) + } else { + res, err = queryClient.Data(cmd.Context(), &types.QueryDataRequest{ + Path: path, + }) + } + + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} From d97935883fa6fb983c85b9a016b3993018f35043 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Fri, 15 Dec 2023 08:52:44 -0800 Subject: [PATCH 26/58] docs: recommend 'path' style of vstorage query --- golang/cosmos/x/vstorage/README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/golang/cosmos/x/vstorage/README.md b/golang/cosmos/x/vstorage/README.md index c34fab5b3a3..3871cd4edb6 100644 --- a/golang/cosmos/x/vstorage/README.md +++ b/golang/cosmos/x/vstorage/README.md @@ -37,22 +37,20 @@ This is used by the SwingSet "bridge". ## CLI -A blockchain node may be interrogated by RPC using `agd [--node $url] query vstorage $command` via [client/cli](./client/cli/query.go). -* `children [--height $blockHeight] [-o {text,json}] [$path]` -* `data [--height $blockHeight] [-o {text,json}] $path` +A blockchain node may be interrogated by RPC using `agd [--node $url] query vstorage path` via [client/cli](./client/cli/query.go). (See command help for options and variants `data` and `children`.) Examples: ```sh -$ agd --node https://main.rpc.agoric.net:443/ query vstorage children published.reserve +$ agd --node https://main.rpc.agoric.net:443/ query vstorage path published.reserve. children: - governance - metrics pagination: null -$ agd --node https://main.rpc.agoric.net:443/ query vstorage children -o json published.reserve +$ agd --node https://main.rpc.agoric.net:443/ query vstorage path -o json published.reserve. {"children":["governance","metrics"],"pagination":null} -$ agd --node https://main.rpc.agoric.net:443/ query vstorage data published.reserve.metrics +$ agd --node https://main.rpc.agoric.net:443/ query vstorage path published.reserve.metrics value: '{"blockHeight":"11030240","values":["{\"body\":\"#{\\\"allocations\\\":{\\\"Fee\\\":{\\\"brand\\\":\\\"$0.Alleged: IST brand\\\",\\\"value\\\":\\\"+20053582387\\\"}},\\\"shortfallBalance\\\":{\\\"brand\\\":\\\"$0\\\",\\\"value\\\":\\\"+0\\\"},\\\"totalFeeBurned\\\":{\\\"brand\\\":\\\"$0\\\",\\\"value\\\":\\\"+0\\\"},\\\"totalFeeMinted\\\":{\\\"brand\\\":\\\"$0\\\",\\\"value\\\":\\\"+0\\\"}}\",\"slots\":[\"board0257\"]}"]}' ``` From d790b45d6efce61a7873028389ad52033b83c27f Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Fri, 15 Dec 2023 11:44:29 -0800 Subject: [PATCH 27/58] chore: deconflict core-eval export tsc is complaining about redefinition. maybe a bug but this workaround is clean. --- packages/inter-protocol/test/psm/gov-add-psm.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/inter-protocol/test/psm/gov-add-psm.js b/packages/inter-protocol/test/psm/gov-add-psm.js index aad39a4194c..cabcb990396 100644 --- a/packages/inter-protocol/test/psm/gov-add-psm.js +++ b/packages/inter-protocol/test/psm/gov-add-psm.js @@ -26,7 +26,7 @@ const config = { }; /** @param {unknown} permittedPowers see gov-add-psm-permit.json */ -const main = async permittedPowers => { +const govAddPsm = async permittedPowers => { console.log('starting PSM:', DAI); const { consume: { feeMintAccess: _, ...restC }, @@ -43,4 +43,4 @@ const main = async permittedPowers => { }; // "export" from script -main; +govAddPsm; From 8ae09f48ff8ce9ba52a1a57e6a278ea165923cef Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Fri, 15 Dec 2023 13:31:48 -0800 Subject: [PATCH 28/58] chore(types): BootstrapModules --- packages/vats/src/core/boot-chain.js | 1 + packages/vats/src/core/types-ambient.d.ts | 2 +- packages/vats/test/test-vat-bank-integration.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/vats/src/core/boot-chain.js b/packages/vats/src/core/boot-chain.js index 522e471866d..bb8b9e4a108 100644 --- a/packages/vats/src/core/boot-chain.js +++ b/packages/vats/src/core/boot-chain.js @@ -17,6 +17,7 @@ const modules = { behaviors: { ...behaviors }, utils: { ...utils }, }; +/** @typedef {typeof modules} BootstrapModules */ export const MANIFEST = CHAIN_BOOTSTRAP_MANIFEST; diff --git a/packages/vats/src/core/types-ambient.d.ts b/packages/vats/src/core/types-ambient.d.ts index bc58c45deb6..309c820c7bd 100644 --- a/packages/vats/src/core/types-ambient.d.ts +++ b/packages/vats/src/core/types-ambient.d.ts @@ -397,7 +397,7 @@ type BootstrapPowers = BootstrapSpace & { vatPowers: { [prop: string]: any; D: DProxy }; vatParameters: BootstrapVatParams; runBehaviors: (manifest: unknown) => Promise; - modules: Record>; + modules: import('./boot-chain.js').BootstrapModules; }; type BootstrapSpace = WellKnownSpaces & diff --git a/packages/vats/test/test-vat-bank-integration.js b/packages/vats/test/test-vat-bank-integration.js index 12c139cf0ea..1ef20aa8ef5 100644 --- a/packages/vats/test/test-vat-bank-integration.js +++ b/packages/vats/test/test-vat-bank-integration.js @@ -72,7 +72,7 @@ test('mintInitialSupply, addBankAssets bootstrap actions', async t => { vats: /** @type {any} */ ({}), vatPowers: /** @type {any} */ ({}), runBehaviors: /** @type {any} */ ({}), - modules: {}, + modules: /** @type {any} */ ({}), ...spaces, }); From 3764eeea9a391b5dc6c9c7a21e430f358b8f7476 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Fri, 15 Dec 2023 11:17:15 -0800 Subject: [PATCH 29/58] feat(types): coreEvalEnv --- .../test/psm/gov-replace-committee.js | 7 ++-- packages/vats/src/core/core-eval-env.d.ts | 37 +++++++++++++++++++ 2 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 packages/vats/src/core/core-eval-env.d.ts diff --git a/packages/inter-protocol/test/psm/gov-replace-committee.js b/packages/inter-protocol/test/psm/gov-replace-committee.js index 36be6a6023b..b222a09ee37 100644 --- a/packages/inter-protocol/test/psm/gov-replace-committee.js +++ b/packages/inter-protocol/test/psm/gov-replace-committee.js @@ -1,5 +1,6 @@ /* global E */ -// @ts-nocheck +// @ts-check +/// /** * @file Script to replace the econ governance committee in a SwingSet Core Eval * (aka big hammer) @@ -26,12 +27,12 @@ const { values } = Object; const zip = (xs, ys) => xs.map((x, i) => [x, ys[i]]); /** - * @param {ERef} nameAdmin + * @param {ERef} nameAdmin * @param {string[][]} paths */ const reserveThenGetNamePaths = async (nameAdmin, paths) => { /** - * @param {ERef} nextAdmin + * @param {ERef} nextAdmin * @param {string[]} path */ const nextPath = async (nextAdmin, path) => { diff --git a/packages/vats/src/core/core-eval-env.d.ts b/packages/vats/src/core/core-eval-env.d.ts new file mode 100644 index 00000000000..2fb497f6084 --- /dev/null +++ b/packages/vats/src/core/core-eval-env.d.ts @@ -0,0 +1,37 @@ +/* eslint-disable */ +/** + * @file typesdef for the CoreEval environment + * + * To use add this to the top of the proposal: /// + * + * That directive has to be before imports, but this one's only useful in + * modules that have no imports or named exports. + */ + +import type { VatData } from '@agoric/swingset-liveslots/src/vatDataTypes.js'; +import type { E, Far, getInterfaceOf, passStyleOf } from '@endo/far'; +import type { Assert, VirtualConsole } from 'ses'; +import type { BootstrapModules } from './boot-chain.js'; + +// Provided by 'CORE_EVAL' handler in chain-behaviors.js +declare global { + // bootstrap modules + var behaviors: BootstrapModules['behaviors']; + var utils: BootstrapModules['utils']; + + // @endo/far exports + var E: E; + var Far: Far; + var getInterfaceOfFar: getInterfaceOfFar; + var passStyleOfFar: passStyleOfFar; + + // endowments + var VatData: VatData; + var assert: Assert; + + // console is a VirtualConsole but this directive fails to override the extant global `console` + // var console: VirtualConsole; + + // Base64 and URL are not available in all environments +} From b00a6dfef107a38f817628d90735fd5e3eaf2a99 Mon Sep 17 00:00:00 2001 From: Chris Hibbert Date: Thu, 14 Dec 2023 16:36:21 -0800 Subject: [PATCH 30/58] docs: improve hints about cli commands that don't submit offers --- packages/agoric-cli/src/commands/oracle.js | 5 +++-- packages/agoric-cli/src/commands/psm.js | 4 ---- packages/agoric-cli/src/commands/vaults.js | 6 +++--- packages/agoric-cli/src/lib/wallet.js | 3 ++- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/agoric-cli/src/commands/oracle.js b/packages/agoric-cli/src/commands/oracle.js index 208be02e60c..dcc4dcd8859 100644 --- a/packages/agoric-cli/src/commands/oracle.js +++ b/packages/agoric-cli/src/commands/oracle.js @@ -15,6 +15,7 @@ import { makeWalletUtils, outputAction, sendAction, + sendHint, } from '../lib/wallet.js'; import { bigintReplacer } from '../lib/format.js'; @@ -128,7 +129,7 @@ export const makeOracleCommand = (logger, io = {}) => { offer, }); - console.warn('Now execute the prepared offer'); + console.warn(sendHint); }); oracle @@ -163,7 +164,7 @@ export const makeOracleCommand = (logger, io = {}) => { offer, }); - console.warn('Now execute the prepared offer'); + console.warn(sendHint); }); const findOracleCap = async (instance, from, readLatestHead) => { diff --git a/packages/agoric-cli/src/commands/psm.js b/packages/agoric-cli/src/commands/psm.js index 61eaedffa46..1daaa99f503 100644 --- a/packages/agoric-cli/src/commands/psm.js +++ b/packages/agoric-cli/src/commands/psm.js @@ -216,8 +216,6 @@ export const makePsmCommand = logger => { }; outputExecuteOfferAction(offer); - - console.warn('Now execute the prepared offer'); }); psm @@ -272,8 +270,6 @@ export const makePsmCommand = logger => { }; outputExecuteOfferAction(offer); - - console.warn('Now execute the prepared offer'); }); return psm; diff --git a/packages/agoric-cli/src/commands/vaults.js b/packages/agoric-cli/src/commands/vaults.js index 284f613f9cd..b45c55ff9de 100644 --- a/packages/agoric-cli/src/commands/vaults.js +++ b/packages/agoric-cli/src/commands/vaults.js @@ -54,7 +54,7 @@ export const makeVaultsCommand = logger => { vaults .command('open') - .description('open a new vault') + .description('Prepare an offer to open a new vault') .requiredOption('--giveCollateral ', 'Collateral to give', Number) .requiredOption('--wantMinted ', 'Minted wants', Number) .option('--offerId ', 'Offer id', String, `openVault-${Date.now()}`) @@ -76,7 +76,7 @@ export const makeVaultsCommand = logger => { vaults .command('adjust') - .description('adjust an existing vault') + .description('Prepare an offer to adjust an existing vault') .requiredOption( '--from

', 'wallet address literal or name', @@ -121,7 +121,7 @@ export const makeVaultsCommand = logger => { vaults .command('close') - .description('close an existing vault') + .description('Prepare an offer to close an existing vault') .requiredOption( '--from
', 'wallet address literal or name', diff --git a/packages/agoric-cli/src/lib/wallet.js b/packages/agoric-cli/src/lib/wallet.js index 2dcd0565cc1..9d405fb21f5 100644 --- a/packages/agoric-cli/src/lib/wallet.js +++ b/packages/agoric-cli/src/lib/wallet.js @@ -75,7 +75,7 @@ export const outputAction = (bridgeAction, stdout = process.stdout) => { stdout.write('\n'); }; -const sendHint = +export const sendHint = 'Now use `agoric wallet send ...` to sign and broadcast the offer.\n'; /** @@ -101,6 +101,7 @@ export const outputExecuteOfferAction = (offer, stdout = process.stdout) => { offer, }; outputAction(spendAction, stdout); + stdout.write(sendHint); }; /** From d80d451449ef83159f5dcf3327fcd0a5e82de203 Mon Sep 17 00:00:00 2001 From: Chris Hibbert Date: Mon, 18 Dec 2023 11:25:57 -0800 Subject: [PATCH 31/58] chore: print hint to stderr --- packages/agoric-cli/src/lib/wallet.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/agoric-cli/src/lib/wallet.js b/packages/agoric-cli/src/lib/wallet.js index 9d405fb21f5..a386bba6dca 100644 --- a/packages/agoric-cli/src/lib/wallet.js +++ b/packages/agoric-cli/src/lib/wallet.js @@ -93,15 +93,20 @@ export const outputActionAndHint = (bridgeAction, { stdout, stderr }) => { /** * @param {import('@agoric/smart-wallet/src/offers.js').OfferSpec} offer * @param {Pick} [stdout] + * @param {Pick} [stderr] */ -export const outputExecuteOfferAction = (offer, stdout = process.stdout) => { +export const outputExecuteOfferAction = ( + offer, + stdout = process.stdout, + stderr = process.stderr, +) => { /** @type {import('@agoric/smart-wallet/src/smartWallet').BridgeAction} */ const spendAction = { method: 'executeOffer', offer, }; outputAction(spendAction, stdout); - stdout.write(sendHint); + stderr.write(sendHint); }; /** From 9380cfe04661eaed6de168e65a96730a8798bffb Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Tue, 19 Dec 2023 12:28:40 -0500 Subject: [PATCH 32/58] chore: Avoid out-of-bounds reads in go-lang code (#8674) Replace panics with friendly error messages. --- golang/cosmos/x/swingset/client/cli/tx.go | 45 +++++++++---------- golang/cosmos/x/swingset/keeper/msg_server.go | 6 +-- golang/cosmos/x/swingset/keeper/querier.go | 18 +++++--- golang/cosmos/x/swingset/types/types.go | 27 ++++++----- golang/cosmos/x/vbank/keeper/querier.go | 6 ++- golang/cosmos/x/vstorage/keeper/querier.go | 6 ++- 6 files changed, 62 insertions(+), 46 deletions(-) diff --git a/golang/cosmos/x/swingset/client/cli/tx.go b/golang/cosmos/x/swingset/client/cli/tx.go index 371e184858d..365dcd2139f 100644 --- a/golang/cosmos/x/swingset/client/cli/tx.go +++ b/golang/cosmos/x/swingset/client/cli/tx.go @@ -2,6 +2,7 @@ package cli import ( "fmt" + "io" "os" "strings" @@ -56,20 +57,18 @@ func GetCmdDeliver() *cobra.Command { } jsonIn := args[0] - if jsonIn[0] == '@' { - fname := args[0][1:] + if strings.HasPrefix(jsonIn, "@") { + var jsonBytes []byte + fname := jsonIn[1:] if fname == "-" { - // Reading from stdin. - if _, err := fmt.Scanln(&jsonIn); err != nil { - return err - } + jsonBytes, err = io.ReadAll(os.Stdin) } else { - jsonBytes, err := os.ReadFile(fname) - if err != nil { - return err - } - jsonIn = string(jsonBytes) + jsonBytes, err = os.ReadFile(fname) } + if err != nil { + return err + } + jsonIn = string(jsonBytes) } msgs, err := types.UnmarshalMessagesJSON(jsonIn) if err != nil { @@ -102,20 +101,18 @@ func GetCmdInstallBundle() *cobra.Command { } jsonIn := args[0] - if jsonIn[0] == '@' { - fname := args[0][1:] + if strings.HasPrefix(jsonIn, "@") { + var jsonBytes []byte + fname := jsonIn[1:] if fname == "-" { - // Reading from stdin. - if _, err := fmt.Scanln(&jsonIn); err != nil { - return err - } + jsonBytes, err = io.ReadAll(os.Stdin) } else { - jsonBytes, err := os.ReadFile(fname) - if err != nil { - return err - } - jsonIn = string(jsonBytes) + jsonBytes, err = os.ReadFile(fname) } + if err != nil { + return err + } + jsonIn = string(jsonBytes) } msg := types.NewMsgInstallBundle(jsonIn, cctx.GetFromAddress()) @@ -160,6 +157,8 @@ func GetCmdProvisionOne() *cobra.Command { return err } + nickname := args[0] + addr, err := sdk.AccAddressFromBech32(args[1]) if err != nil { return err @@ -170,7 +169,7 @@ func GetCmdProvisionOne() *cobra.Command { powerFlags = strings.Split(args[2], ",") } - msg := types.NewMsgProvision(args[0], addr, powerFlags, cctx.GetFromAddress()) + msg := types.NewMsgProvision(nickname, addr, powerFlags, cctx.GetFromAddress()) if err := msg.ValidateBasic(); err != nil { return err } diff --git a/golang/cosmos/x/swingset/keeper/msg_server.go b/golang/cosmos/x/swingset/keeper/msg_server.go index e418bf7b3fb..583a9eb2f70 100644 --- a/golang/cosmos/x/swingset/keeper/msg_server.go +++ b/golang/cosmos/x/swingset/keeper/msg_server.go @@ -45,13 +45,11 @@ func (keeper msgServer) routeAction(ctx sdk.Context, msg vm.ControllerAdmissionM func (keeper msgServer) DeliverInbound(goCtx context.Context, msg *types.MsgDeliverInbound) (*types.MsgDeliverInboundResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) + // msg.Nums and msg.Messages must be zipped into an array of [num, message] pairs. messages := make([][]interface{}, len(msg.Messages)) for i, message := range msg.Messages { - messages[i] = make([]interface{}, 2) - messages[i][0] = msg.Nums[i] - messages[i][1] = message + messages[i] = []interface{}{msg.Nums[i], message} } - action := &deliverInboundAction{ Type: "DELIVER_INBOUND", Peer: msg.Submitter.String(), diff --git a/golang/cosmos/x/swingset/keeper/querier.go b/golang/cosmos/x/swingset/keeper/querier.go index 3195b40885b..005bcf57895 100644 --- a/golang/cosmos/x/swingset/keeper/querier.go +++ b/golang/cosmos/x/swingset/keeper/querier.go @@ -24,11 +24,21 @@ const ( // NewQuerier is the module level router for state queries func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { return func(ctx sdk.Context, path []string, req abci.RequestQuery) (res []byte, err error) { - switch path[0] { + var queryType string + if len(path) > 0 { + queryType = path[0] + } + switch queryType { case QueryEgress: + if len(path) < 2 || path[1] == "" { + return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "missing egress address") + } return queryEgress(ctx, path[1], req, keeper, legacyQuerierCdc) case QueryMailbox: - return queryMailbox(ctx, path[1:], req, keeper, legacyQuerierCdc) + if len(path) < 2 || path[1] == "" { + return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "missing mailbox peer") + } + return queryMailbox(ctx, path[1], req, keeper, legacyQuerierCdc) case LegacyQueryStorage: return legacyQueryStorage(ctx, strings.Join(path[1:], "/"), req, keeper, legacyQuerierCdc) case LegacyQueryKeys: @@ -60,9 +70,7 @@ func queryEgress(ctx sdk.Context, bech32 string, req abci.RequestQuery, keeper K } // nolint: unparam -func queryMailbox(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) (res []byte, err error) { - peer := path[0] - +func queryMailbox(ctx sdk.Context, peer string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) (res []byte, err error) { value := keeper.GetMailbox(ctx, peer) if value == "" { diff --git a/golang/cosmos/x/swingset/types/types.go b/golang/cosmos/x/swingset/types/types.go index 0793e8346da..1a8ddfc7b42 100644 --- a/golang/cosmos/x/swingset/types/types.go +++ b/golang/cosmos/x/swingset/types/types.go @@ -45,16 +45,18 @@ type Messages struct { Ack uint64 } -func UnmarshalMessagesJSON(jsonString string) (*Messages, error) { - // [message[], ack] - // message [num, body] - packet := make([]interface{}, 2) - err := json.Unmarshal([]byte(jsonString), &packet) +// UnmarshalMessagesJSON decodes Messages from JSON text. +// Input must represent an array in which the first element is an array of +// [messageNum: integer, messageBody: string] pairs and the second element is +// an "Ack" integer. +func UnmarshalMessagesJSON(jsonString string) (ret *Messages, err error) { + packet := [2]interface{}{} + err = json.Unmarshal([]byte(jsonString), &packet) if err != nil { return nil, err } - ret := &Messages{} + ret = &Messages{} ackFloat, ok := packet[1].(float64) if !ok { @@ -72,12 +74,13 @@ func UnmarshalMessagesJSON(jsonString string) (*Messages, error) { ret.Messages = make([]string, len(msgs)) ret.Nums = make([]uint64, len(msgs)) - for i, nummsgi := range msgs { - nummsg, ok := nummsgi.([]interface{}) - if !ok || len(nummsg) != 2 { + for i, rawMsg := range msgs { + arrMsg, ok := rawMsg.([]interface{}) + if !ok || len(arrMsg) != 2 { return nil, errors.New("Message is not a pair") } - numFloat, ok := nummsg[0].(float64) + + numFloat, ok := arrMsg[0].(float64) if !ok { return nil, errors.New("Message Num is not an integer") } @@ -85,11 +88,11 @@ func UnmarshalMessagesJSON(jsonString string) (*Messages, error) { if err != nil { return nil, errors.New("Message num is not a Nat") } - msg, ok := nummsg[1].(string) + + ret.Messages[i], ok = arrMsg[1].(string) if !ok { return nil, errors.New("Message is not a string") } - ret.Messages[i] = msg } return ret, nil diff --git a/golang/cosmos/x/vbank/keeper/querier.go b/golang/cosmos/x/vbank/keeper/querier.go index c53a6828f44..8b0735c7cf1 100644 --- a/golang/cosmos/x/vbank/keeper/querier.go +++ b/golang/cosmos/x/vbank/keeper/querier.go @@ -11,7 +11,11 @@ import ( func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { return func(ctx sdk.Context, path []string, req abci.RequestQuery) ([]byte, error) { - switch path[0] { + var queryType string + if len(path) > 0 { + queryType = path[0] + } + switch queryType { case types.QueryParams: return queryParams(ctx, path[1:], req, k, legacyQuerierCdc) diff --git a/golang/cosmos/x/vstorage/keeper/querier.go b/golang/cosmos/x/vstorage/keeper/querier.go index 8e2eb91db47..9da34af3214 100644 --- a/golang/cosmos/x/vstorage/keeper/querier.go +++ b/golang/cosmos/x/vstorage/keeper/querier.go @@ -33,7 +33,11 @@ func getVstorageEntryPath(urlPathSegments []string) (string, error) { // be used to extend it to a vstorage path such as "foo.bar.baz"). func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { return func(ctx sdk.Context, urlPathSegments []string, req abci.RequestQuery) (res []byte, err error) { - switch urlPathSegments[0] { + var queryType string + if len(urlPathSegments) > 0 { + queryType = urlPathSegments[0] + } + switch queryType { case QueryData: entryPath, entryPathErr := getVstorageEntryPath(urlPathSegments[1:]) if entryPathErr != nil { From 75b00b2a1596bbd4a43f3e103344079698a7da7a Mon Sep 17 00:00:00 2001 From: Luqi Pan Date: Wed, 20 Dec 2023 08:57:24 -0800 Subject: [PATCH 33/58] Update links to docs (#8673) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1aab3c7b9e8..11805405cf6 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ layers of the Agoric platform, with providing the lower layers. If you want to build on top of this platform, you don't need these repositories: instead you should -[follow our instructions for getting started](https://agoric.com/documentation/getting-started/) +[follow our instructions for getting started](https://docs.agoric.com/guides/getting-started/) with the Agoric SDK. But if you are improving the platform itself, these are the repositories @@ -89,7 +89,7 @@ To run the unit tests of just a single package (e.g. `eventual-send`): ## Run the larger demo -Visit [https://agoric.com/documentation/](https://agoric.com/documentation/getting-started/before-using-agoric.html) for getting started instructions. +Visit [https://docs.agoric.com](https://docs.agoric.com/guides/getting-started/) for getting started instructions. TL;DR: From ec6fad973bbf69b620d69498a28c0548dfaad178 Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Tue, 21 Nov 2023 17:18:39 -0800 Subject: [PATCH 34/58] fix(ci): Generate types when syncing Endo --- scripts/get-packed-versions.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/get-packed-versions.sh b/scripts/get-packed-versions.sh index e5f0c856a73..ffa4f0f1709 100755 --- a/scripts/get-packed-versions.sh +++ b/scripts/get-packed-versions.sh @@ -18,6 +18,9 @@ cd -- "$WORKDIR" 1>&2 # Install and build the source directory. yarn install 1>&2 yarn build 1>&2 + +yarn lerna run build:types 1>&2 + yarn --silent workspaces info | jq -r '.[].location' | while read -r dir; do # Skip private packages. echo "dir=$dir" 1>&2 From 59ab3c556c5d423cbc7c3a9be8a67d1e5b51ebf4 Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Tue, 28 Nov 2023 15:39:09 -0800 Subject: [PATCH 35/58] fix(zoe): Accommodate exo-stensibility by relaxing method name enumeration tests --- .../test/unitTests/test-zoe-startInstance.js | 59 ++++++++++++------- packages/zoe/test/unitTests/zcf/test-zcf.js | 5 +- 2 files changed, 42 insertions(+), 22 deletions(-) diff --git a/packages/zoe/test/unitTests/test-zoe-startInstance.js b/packages/zoe/test/unitTests/test-zoe-startInstance.js index 55d17a534dc..318e237e48c 100644 --- a/packages/zoe/test/unitTests/test-zoe-startInstance.js +++ b/packages/zoe/test/unitTests/test-zoe-startInstance.js @@ -23,24 +23,35 @@ test('bad installation', async t => { function isEmptyFacet(t, facet) { t.is(passStyleOf(facet), 'remotable'); - t.deepEqual(Object.getOwnPropertyNames(facet), []); + t.deepEqual( + Object.getOwnPropertyNames(facet).filter(name => !name.startsWith('__')), + [], + ); } function facetHasMethods(t, facet, names) { t.is(passStyleOf(facet), 'remotable'); - t.deepEqual(Object.getOwnPropertyNames(facet), names); + t.deepEqual( + Object.getOwnPropertyNames(facet).filter(name => !name.startsWith('__')), + names, + ); } test('no issuerKeywordRecord, no terms', async t => { const result = await setupZCFTest(); // Note that deepEqual treats all empty objects (handles) as interchangeable. - t.deepEqual(Object.getOwnPropertyNames(result.startInstanceResult).sort(), [ - 'adminFacet', - 'creatorFacet', - 'creatorInvitation', - 'instance', - 'publicFacet', - ]); + t.deepEqual( + Object.getOwnPropertyNames(result.startInstanceResult) + .filter(name => !name.startsWith('__')) + .sort(), + [ + 'adminFacet', + 'creatorFacet', + 'creatorInvitation', + 'instance', + 'publicFacet', + ], + ); isEmptyFacet(t, result.creatorFacet); t.deepEqual(result.creatorInvitation, undefined); facetHasMethods(t, result.startInstanceResult.publicFacet, [ @@ -54,21 +65,27 @@ test('promise for installation', async t => { const result = await startInstanceResult; // Note that deepEqual treats all empty objects (handles) as interchangeable. - t.deepEqual(Object.getOwnPropertyNames(result).sort(), [ - 'adminFacet', - 'creatorFacet', - 'creatorInvitation', - 'instance', - 'publicFacet', - ]); + t.deepEqual( + Object.getOwnPropertyNames(result) + .filter(name => !name.startsWith('__')) + .sort(), + [ + 'adminFacet', + 'creatorFacet', + 'creatorInvitation', + 'instance', + 'publicFacet', + ], + ); isEmptyFacet(t, result.creatorFacet); t.deepEqual(result.creatorInvitation, undefined); facetHasMethods(t, result.publicFacet, ['makeInvitation']); - t.deepEqual(getStringMethodNames(result.adminFacet), [ - 'getVatShutdownPromise', - 'restartContract', - 'upgradeContract', - ]); + t.deepEqual( + getStringMethodNames(result.adminFacet).filter( + name => !name.startsWith('__'), + ), + ['getVatShutdownPromise', 'restartContract', 'upgradeContract'], + ); }); test('terms, issuerKeywordRecord switched', async t => { diff --git a/packages/zoe/test/unitTests/zcf/test-zcf.js b/packages/zoe/test/unitTests/zcf/test-zcf.js index 89b32677911..ed4728fd615 100644 --- a/packages/zoe/test/unitTests/zcf/test-zcf.js +++ b/packages/zoe/test/unitTests/zcf/test-zcf.js @@ -707,7 +707,10 @@ test(`zcfSeat from zcf.makeEmptySeatKit - only these properties exist`, async t const { zcf } = await setupZCFTest(); const makeZCFSeat = () => zcf.makeEmptySeatKit().zcfSeat; const seat = makeZCFSeat(); - t.deepEqual(getStringMethodNames(seat), expectedStringMethods.sort()); + t.deepEqual( + getStringMethodNames(seat).filter(name => !name.startsWith('__')), + expectedStringMethods.sort(), + ); }); test(`zcfSeat.getProposal from zcf.makeEmptySeatKit`, async t => { From 7cc4f967d98416e41a0fdfd4392531b198a9233e Mon Sep 17 00:00:00 2001 From: "Mark S. Miller" Date: Tue, 28 Nov 2023 21:31:24 -0800 Subject: [PATCH 36/58] fix(zoe): Golden error regexp tolerant across endo versions --- packages/zoe/test/unitTests/test-zoe.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/zoe/test/unitTests/test-zoe.js b/packages/zoe/test/unitTests/test-zoe.js index 65b31efae82..ab704870417 100644 --- a/packages/zoe/test/unitTests/test-zoe.js +++ b/packages/zoe/test/unitTests/test-zoe.js @@ -143,7 +143,10 @@ test(`E(zoe).getPublicFacet - no instance`, async t => { // @ts-expect-error deliberate invalid arguments for testing await t.throwsAsync(() => E(zoe).getPublicFacet(), { message: - /In "getPublicFacet" method of \(ZoeService\): arg 0: .*"\[undefined\]" - Must be a remotable/, + // Golden test uses RegExp "Or" pattern to tolerate earlier versions of + // Endo. + // TODO: Remove first disjunct once no longer needed + /In "getPublicFacet" method of \(ZoeService\): (?:arg 0: .*"\[undefined\]" - Must be a remotable|Expected at least 1 arguments: \[\])/, }); }); @@ -174,7 +177,10 @@ test(`zoe.getIssuers - no instance`, async t => { // @ts-expect-error invalid arguments for testing await t.throwsAsync(() => E(zoe).getIssuers(), { message: - /In "getIssuers" method of \(ZoeService\): arg 0: .*"\[undefined\]" - Must be a remotable/, + // Golden test uses RegExp "Or" pattern to tolerate earlier versions of + // Endo. + // TODO: Remove first disjunct once no longer needed + /In "getIssuers" method of \(ZoeService\): (?:arg 0: .*"\[undefined\]" - Must be a remotable|Expected at least 1 arguments: \[\])/, }); }); @@ -205,7 +211,9 @@ test(`zoe.getBrands - no instance`, async t => { // @ts-expect-error invalid arguments for testing await t.throwsAsync(() => E(zoe).getBrands(), { message: - /In "getBrands" method of \(ZoeService\): arg 0: .*"\[undefined\]" - Must be a remotable/, + // Or pattern of golden error tolerant across versions of endo. + // TODO: Remove first disjunct once no longer needed + /In "getBrands" method of \(ZoeService\): (?:arg 0: .*"\[undefined\]" - Must be a remotable|Expected at least 1 arguments: \[\])/, }); }); @@ -261,7 +269,9 @@ test(`zoe.getTerms - no instance`, async t => { // @ts-expect-error invalid arguments for testing await t.throwsAsync(() => E(zoe).getTerms(), { message: - /In "getTerms" method of \(ZoeService\): arg 0: .*"\[undefined\]" - Must be a remotable/, + // Or pattern of golden error tolerant across versions of endo. + // TODO: Remove first disjunct once no longer needed + /In "getTerms" method of \(ZoeService\): (?:arg 0: .*"\[undefined\]" - Must be a remotable|Expected at least 1 arguments: \[\])/, }); }); From ad575b0f32c5fea30f73c28e729663a660a53f02 Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Wed, 6 Dec 2023 15:01:18 -0800 Subject: [PATCH 37/58] fix(vats): Shape of NameHub lookupAdmin rest args --- packages/vats/src/nameHub.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vats/src/nameHub.js b/packages/vats/src/nameHub.js index f5e9acc1236..505998fbd6d 100644 --- a/packages/vats/src/nameHub.js +++ b/packages/vats/src/nameHub.js @@ -37,7 +37,7 @@ export const NameHubIKit = harden({ update: M.call(KeyShape, M.any()) .optional(M.remotable('newAdminValue')) .returns(M.any()), - lookupAdmin: M.call(KeyShape).returns(M.promise()), + lookupAdmin: M.call().rest(M.arrayOf(KeyShape)).returns(M.promise()), delete: M.call(KeyShape).returns(M.any()), readonly: M.call().returns(M.remotable()), }), From ce4cc4788b04956994d594af9cf46ad4a7f0604f Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Wed, 6 Dec 2023 16:36:25 -0800 Subject: [PATCH 38/58] fix(inter-protocol): Relax rounds manager interface guards --- packages/inter-protocol/src/price/roundsManager.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/inter-protocol/src/price/roundsManager.js b/packages/inter-protocol/src/price/roundsManager.js index 30fed5827d8..8d80b8017ef 100644 --- a/packages/inter-protocol/src/price/roundsManager.js +++ b/packages/inter-protocol/src/price/roundsManager.js @@ -101,12 +101,14 @@ export const prepareRoundsManagerKit = baggage => contract: M.interface( 'contract', { - authenticateQuote: M.call(M.any()).returns(M.any()), - makeCreateQuote: M.call().optional(M.any()).returns(M.any()), - eligibleForSpecificRound: M.call(M.any()).returns(M.boolean()), - getRoundData: M.call(M.any()).returns(M.promise()), - getRoundStatus: M.call(M.any()).returns(M.record()), - oracleRoundStateSuggestRound: M.call(M.any()).returns(M.record()), + authenticateQuote: M.call().rest(M.any()).returns(M.any()), + makeCreateQuote: M.call().rest(M.any()).returns(M.any()), + eligibleForSpecificRound: M.call().rest(M.any()).returns(M.boolean()), + getRoundData: M.call().rest(M.any()).returns(M.promise()), + getRoundStatus: M.call().rest(M.any()).returns(M.record()), + oracleRoundStateSuggestRound: M.call() + .rest(M.any()) + .returns(M.record()), }, // TODO(6571) stop sloppy { sloppy: true }, From fe8ff260f83bc4f2668f3dd24c3ff922b2532e8a Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Wed, 6 Dec 2023 17:56:56 -0800 Subject: [PATCH 39/58] fix(inter-protocol): Satisfy interface guard in mock --- packages/inter-protocol/test/psm/test-psm.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/inter-protocol/test/psm/test-psm.js b/packages/inter-protocol/test/psm/test-psm.js index e53eee771c9..f5f4ad373e7 100644 --- a/packages/inter-protocol/test/psm/test-psm.js +++ b/packages/inter-protocol/test/psm/test-psm.js @@ -734,6 +734,7 @@ test('extra give wantMintedInvitation', async t => { const makeMockBankManager = t => { /** @type {BankManager} */ const bankManager = Far('mock BankManager', { + __getInterfaceGuard__: () => undefined, getAssetSubscription: () => assert.fail('not impl'), getModuleAccountAddress: () => assert.fail('not impl'), getRewardDistributorDepositFacet: () => From c6c69447b285bca85db27dd4cedaca5f8c34fb83 Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Thu, 7 Dec 2023 16:50:51 -0800 Subject: [PATCH 40/58] refactor(base-zone): Complete Endo migration --- packages/base-zone/tools/greeter.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/base-zone/tools/greeter.js b/packages/base-zone/tools/greeter.js index 9426b196f17..7379ecb8e69 100644 --- a/packages/base-zone/tools/greeter.js +++ b/packages/base-zone/tools/greeter.js @@ -44,7 +44,6 @@ export const GreeterWithAdminI = M.interface('GreeterWithAdmin', { */ export const prepareGreeterSingleton = (zone, label, nick) => { const myThis = Object.freeze({ state: { nick } }); - // @ts-expect-error Until https://github.com/endojs/endo/pull/1771 return zone.exo(label, GreeterWithAdminI, { ...bindAllMethodsTo(greetFacet, myThis), ...bindAllMethodsTo(adminFacet, myThis), @@ -55,7 +54,6 @@ export const prepareGreeterSingleton = (zone, label, nick) => { * @param {import('../src/types.js').Zone} zone */ export const prepareGreeter = zone => - // @ts-expect-error Until https://github.com/endojs/endo/pull/1771 zone.exoClass('Greeter', GreeterWithAdminI, nick => ({ nick }), { ...greetFacet, ...adminFacet, From 9aa58683e594f714c9ea0ff04934b26c7df2ca13 Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Fri, 10 Nov 2023 17:09:03 -0800 Subject: [PATCH 41/58] refactor: Make all TS import extensions explicit --- .../SwingSet/src/controller/controller.js | 2 +- .../SwingSet/src/controller/startXSnap.js | 2 +- packages/SwingSet/src/kernel/vat-warehouse.js | 2 +- packages/SwingSet/src/types-external.js | 4 ++-- packages/agoric-cli/src/commands/gov.js | 2 +- packages/agoric-cli/src/commands/inter.js | 2 +- packages/agoric-cli/src/lib/chain.js | 6 ++--- packages/agoric-cli/src/lib/format.js | 4 ++-- packages/agoric-cli/src/lib/wallet.js | 18 +++++++------- packages/base-zone/tools/testers.js | 4 ++-- packages/cache/src/cache.js | 2 +- packages/cache/src/state.js | 2 +- packages/cache/src/store.js | 20 ++++++++-------- packages/casting/src/casting-spec.js | 14 +++++------ packages/casting/src/change-follower.js | 4 ++-- packages/casting/src/defaults.js | 2 +- packages/casting/src/follower-cosmjs.js | 4 ++-- packages/casting/src/follower.js | 12 +++++----- packages/casting/src/iterable.js | 2 +- packages/deploy-script-support/src/install.js | 2 +- packages/deploy-script-support/src/offer.js | 2 +- .../deploy-script-support/src/saveIssuer.js | 4 ++-- .../src/startInstance.js | 2 +- .../test/unitTests/test-startInstance.js | 2 +- packages/governance/src/contractHelper.js | 6 ++--- packages/governance/tools/puppetGovernance.js | 2 +- packages/inter-protocol/src/clientSupport.js | 2 +- .../src/price/fluxAggregatorKit.js | 4 ++-- .../src/proposals/committee-proposal.js | 10 ++++---- .../src/proposals/econ-behaviors.js | 2 +- .../src/proposals/price-feed-proposal.js | 2 +- .../src/proposals/startEconCommittee.js | 2 +- packages/inter-protocol/src/provisionPool.js | 2 +- .../inter-protocol/src/provisionPoolKit.js | 4 ++-- packages/inter-protocol/src/psm/types.js | 2 +- .../src/vaultFactory/orderedVaultStore.js | 4 ++-- .../inter-protocol/src/vaultFactory/params.js | 2 +- .../src/vaultFactory/prioritizedVaults.js | 2 +- .../inter-protocol/src/vaultFactory/types.js | 10 ++++---- .../inter-protocol/src/vaultFactory/vault.js | 2 +- .../src/vaultFactory/vaultDirector.js | 2 +- .../src/vaultFactory/vaultFactory.js | 2 +- packages/inter-protocol/test/auction/tools.js | 4 ++-- packages/inter-protocol/test/metrics.js | 4 ++-- packages/inter-protocol/test/psm/test-psm.js | 2 +- packages/inter-protocol/test/reserve/setup.js | 4 ++-- .../test/smartWallet/contexts.js | 4 ++-- .../smartWallet/test-oracle-integration.js | 8 +++---- .../test/smartWallet/test-psm-integration.js | 12 +++++----- packages/inter-protocol/test/supports.js | 4 ++-- ...ootstrap-fluxAggregator-service-upgrade.js | 4 ++-- .../psmUpgrade/bootstrap-psm-upgrade.js | 10 ++++---- .../reserve/bootstrap-assetReserve-upgrade.js | 8 +++---- .../inter-protocol/test/test-provisionPool.js | 4 ++-- .../test/vaultFactory/driver.js | 2 +- .../test/vaultFactory/test-vaultFactory.js | 2 +- .../vaultFactory/test-vaultLiquidation.js | 2 +- packages/internal/src/callback.js | 4 ++-- packages/internal/src/lib-chainStorage.js | 4 ++-- packages/internal/test/test-callback.js | 22 ++++++++--------- packages/network/test/test-network-misc.js | 8 +++---- packages/pegasus/test/test-peg.js | 4 ++-- packages/smart-wallet/src/invitations.js | 2 +- packages/smart-wallet/src/offers.js | 6 ++--- packages/smart-wallet/src/smartWallet.js | 8 +++---- packages/smart-wallet/src/utils.js | 10 ++++---- packages/smart-wallet/src/walletFactory.js | 14 +++++------ packages/smart-wallet/test/supports.js | 2 +- .../upgradeWalletFactory/walletFactory-V2.js | 8 +++---- packages/swing-store/src/bundleStore.js | 2 +- packages/swing-store/src/importer.js | 4 ++-- packages/swing-store/src/internal.js | 6 ++--- packages/swing-store/src/repairMetadata.js | 2 +- packages/swing-store/src/snapStore.js | 4 ++-- packages/swing-store/src/swingStore.js | 18 +++++++------- packages/swing-store/src/util.js | 2 +- packages/swingset-liveslots/src/liveslots.js | 10 ++++---- packages/swingset-liveslots/src/message.js | 2 +- .../src/virtualObjectManager.js | 2 +- packages/telemetry/src/slog-sender-pipe.js | 4 ++-- packages/time/test/test-timeMath.js | 10 ++++---- packages/vats/src/bridge.js | 2 +- packages/vats/src/core/basic-behaviors.js | 2 +- packages/vats/src/core/chain-behaviors.js | 2 +- packages/vats/src/core/sim-behaviors.js | 2 +- packages/vats/src/core/startWalletFactory.js | 2 +- packages/vats/src/core/utils.js | 6 ++--- packages/vats/src/nameHub.js | 4 ++-- packages/vats/src/vat-bank.js | 2 +- packages/vats/src/vat-provisioning.js | 2 +- packages/vats/test/test-bootstrapPayment.js | 2 +- packages/vats/test/test-vpurse.js | 2 +- packages/wallet/api/src/internal-types.js | 4 ++-- packages/xsnap/src/avaAssertXS.js | 2 +- packages/xsnap/src/avaXS.js | 2 +- packages/xsnap/src/xsnap.js | 2 +- packages/xsnap/src/xsrepl.js | 2 +- packages/zoe/src/zoeService/internal-types.js | 2 +- packages/zoe/src/zoeService/startInstance.js | 2 +- packages/zoe/src/zoeService/types.js | 24 +++++++++---------- packages/zoe/test/unitTests/test-zoe.js | 4 ++-- 101 files changed, 244 insertions(+), 242 deletions(-) diff --git a/packages/SwingSet/src/controller/controller.js b/packages/SwingSet/src/controller/controller.js index 249036e9c87..c4544a98234 100644 --- a/packages/SwingSet/src/controller/controller.js +++ b/packages/SwingSet/src/controller/controller.js @@ -246,7 +246,7 @@ export async function makeSwingsetController( warehousePolicy, overrideVatManagerOptions, }; - /** @type { ReturnType } */ + /** @type { ReturnType } */ const kernel = buildKernel( kernelEndowments, deviceEndowments, diff --git a/packages/SwingSet/src/controller/startXSnap.js b/packages/SwingSet/src/controller/startXSnap.js index ff5e70a40ad..b68145ccf1d 100644 --- a/packages/SwingSet/src/controller/startXSnap.js +++ b/packages/SwingSet/src/controller/startXSnap.js @@ -81,7 +81,7 @@ export function makeStartXSnap(options) { }; } - /** @type { import('@agoric/xsnap/src/xsnap').XSnapOptions } */ + /** @type { import('@agoric/xsnap/src/xsnap.js').XSnapOptions } */ const xsnapOpts = { os: osType(), fs: { ...fs, ...fs.promises, tmpName }, diff --git a/packages/SwingSet/src/kernel/vat-warehouse.js b/packages/SwingSet/src/kernel/vat-warehouse.js index f1047a23560..6c3688363d8 100644 --- a/packages/SwingSet/src/kernel/vat-warehouse.js +++ b/packages/SwingSet/src/kernel/vat-warehouse.js @@ -255,7 +255,7 @@ export function makeVatWarehouse({ // console.debug('makeVatWarehouse', { warehousePolicy }); /** - * @typedef { ReturnType } VatTranslators + * @typedef { ReturnType } VatTranslators * @typedef {{ * manager: VatManager, * translators: VatTranslators, diff --git a/packages/SwingSet/src/types-external.js b/packages/SwingSet/src/types-external.js index 72179e46ce9..c539baa04d1 100644 --- a/packages/SwingSet/src/types-external.js +++ b/packages/SwingSet/src/types-external.js @@ -117,8 +117,8 @@ export {}; * @typedef { DeviceInvocationResultOk | DeviceInvocationResultError } DeviceInvocationResult * * @typedef { { transcriptCount: number } } VatStats - * @typedef { ReturnType } VatKeeper - * @typedef { ReturnType } KernelKeeper + * @typedef { ReturnType } VatKeeper + * @typedef { ReturnType } KernelKeeper * @typedef { Awaited> } XSnap * @typedef { (dr: VatDeliveryResult) => void } SlogFinishDelivery * @typedef { (ksr: KernelSyscallResult, vsr: VatSyscallResult) => void } SlogFinishSyscall diff --git a/packages/agoric-cli/src/commands/gov.js b/packages/agoric-cli/src/commands/gov.js index 12ec24da538..216bb471623 100644 --- a/packages/agoric-cli/src/commands/gov.js +++ b/packages/agoric-cli/src/commands/gov.js @@ -79,7 +79,7 @@ export const makeGovCommand = (_logger, io = {}) => { * given a sendFrom address; else print it. * * @param {{ - * toOffer: (agoricNames: *, current: import('@agoric/smart-wallet/src/smartWallet').CurrentWalletRecord | undefined) => OfferSpec, + * toOffer: (agoricNames: *, current: import('@agoric/smart-wallet/src/smartWallet.js').CurrentWalletRecord | undefined) => OfferSpec, * sendFrom?: string | undefined, * keyringBackend: string, * instanceName?: string, diff --git a/packages/agoric-cli/src/commands/inter.js b/packages/agoric-cli/src/commands/inter.js index 56cc40d0ae6..ccc092c9bcb 100644 --- a/packages/agoric-cli/src/commands/inter.js +++ b/packages/agoric-cli/src/commands/inter.js @@ -34,7 +34,7 @@ const bidInvitationShape = harden({ }); /** @typedef {import('@agoric/vats/tools/board-utils.js').VBankAssetDetail } AssetDescriptor */ -/** @typedef {import('@agoric/smart-wallet/src/smartWallet').TryExitOfferAction } TryExitOfferAction */ +/** @typedef {import('@agoric/smart-wallet/src/smartWallet.js').TryExitOfferAction } TryExitOfferAction */ /** @typedef {import('@agoric/inter-protocol/src/auction/auctionBook.js').OfferSpec} BidSpec */ /** @typedef {import('@agoric/inter-protocol/src/auction/scheduler.js').ScheduleNotification} ScheduleNotification */ /** @typedef {import('@agoric/inter-protocol/src/auction/auctionBook.js').BookDataNotification} BookDataNotification */ diff --git a/packages/agoric-cli/src/lib/chain.js b/packages/agoric-cli/src/lib/chain.js index 2870ca5b895..667cba70009 100644 --- a/packages/agoric-cli/src/lib/chain.js +++ b/packages/agoric-cli/src/lib/chain.js @@ -36,7 +36,7 @@ harden(normalizeAddressWithOptions); /** * @param {ReadonlyArray} swingsetArgs - * @param {import('./rpc').MinimalNetworkConfig & { + * @param {import('./rpc.js').MinimalNetworkConfig & { * from: string, * fees?: string, * dryRun?: boolean, @@ -110,7 +110,7 @@ export const fetchSwingsetParams = net => { harden(fetchSwingsetParams); /** - * @param {import('./rpc').MinimalNetworkConfig & { + * @param {import('./rpc.js').MinimalNetworkConfig & { * execFileSync: typeof import('child_process').execFileSync, * delay: (ms: number) => Promise, * period?: number, @@ -150,7 +150,7 @@ export const pollBlocks = opts => async lookup => { /** * @param {string} txhash - * @param {import('./rpc').MinimalNetworkConfig & { + * @param {import('./rpc.js').MinimalNetworkConfig & { * execFileSync: typeof import('child_process').execFileSync, * delay: (ms: number) => Promise, * period?: number, diff --git a/packages/agoric-cli/src/lib/format.js b/packages/agoric-cli/src/lib/format.js index 5c3a922a79e..3083b21c69b 100644 --- a/packages/agoric-cli/src/lib/format.js +++ b/packages/agoric-cli/src/lib/format.js @@ -89,7 +89,7 @@ export const asBoardRemote = x => { /** * Summarize the balances array as user-facing informative tuples * - * @param {import('@agoric/smart-wallet/src/smartWallet').CurrentWalletRecord['purses']} purses + * @param {import('@agoric/smart-wallet/src/smartWallet.js').CurrentWalletRecord['purses']} purses * @param {AssetDescriptor[]} assets */ export const purseBalanceTuples = (purses, assets) => { @@ -172,7 +172,7 @@ export const offerStatusTuples = (state, agoricNames) => { }; /** - * @param {import('@agoric/smart-wallet/src/smartWallet').CurrentWalletRecord} current + * @param {import('@agoric/smart-wallet/src/smartWallet.js').CurrentWalletRecord} current * @param {ReturnType['state']} coalesced * @param {import('./wallet.js').AgoricNamesRemotes} agoricNames */ diff --git a/packages/agoric-cli/src/lib/wallet.js b/packages/agoric-cli/src/lib/wallet.js index a386bba6dca..0549fa7ec3a 100644 --- a/packages/agoric-cli/src/lib/wallet.js +++ b/packages/agoric-cli/src/lib/wallet.js @@ -23,13 +23,13 @@ const emptyCurrentRecord = { /** * @param {string} addr * @param {Pick} io - * @returns {Promise} + * @returns {Promise} */ export const getCurrent = async (addr, { readLatestHead }) => { // Partial because older writes may not have had all properties // NB: assumes changes are only additions let current = - /** @type {Partial | undefined} */ ( + /** @type {Partial | undefined} */ ( await readLatestHead(`published.wallet.${addr}.current`) ); if (current === undefined) { @@ -58,7 +58,7 @@ export const getCurrent = async (addr, { readLatestHead }) => { /** * @param {string} addr * @param {Pick} io - * @returns {Promise} + * @returns {Promise} */ export const getLastUpdate = (addr, { readLatestHead }) => { // @ts-expect-error cast @@ -66,7 +66,7 @@ export const getLastUpdate = (addr, { readLatestHead }) => { }; /** - * @param {import('@agoric/smart-wallet/src/smartWallet').BridgeAction} bridgeAction + * @param {import('@agoric/smart-wallet/src/smartWallet.js').BridgeAction} bridgeAction * @param {Pick} [stdout] */ export const outputAction = (bridgeAction, stdout = process.stdout) => { @@ -79,7 +79,7 @@ export const sendHint = 'Now use `agoric wallet send ...` to sign and broadcast the offer.\n'; /** - * @param {import('@agoric/smart-wallet/src/smartWallet').BridgeAction} bridgeAction + * @param {import('@agoric/smart-wallet/src/smartWallet.js').BridgeAction} bridgeAction * @param {{ * stdout: Pick, * stderr: Pick, @@ -100,7 +100,7 @@ export const outputExecuteOfferAction = ( stdout = process.stdout, stderr = process.stderr, ) => { - /** @type {import('@agoric/smart-wallet/src/smartWallet').BridgeAction} */ + /** @type {import('@agoric/smart-wallet/src/smartWallet.js').BridgeAction} */ const spendAction = { method: 'executeOffer', offer, @@ -111,7 +111,7 @@ export const outputExecuteOfferAction = ( /** * @deprecated use `.current` node for current state - * @param {import('@agoric/casting').Follower>} follower + * @param {import('@agoric/casting').Follower>} follower * @param {Brand<'set'>} [invitationBrand] */ export const coalesceWalletState = async (follower, invitationBrand) => { @@ -141,8 +141,8 @@ export const coalesceWalletState = async (follower, invitationBrand) => { * Sign and broadcast a wallet-action. * * @throws { Error & { code: number } } if transaction fails - * @param {import('@agoric/smart-wallet/src/smartWallet').BridgeAction} bridgeAction - * @param {import('./rpc').MinimalNetworkConfig & { + * @param {import('@agoric/smart-wallet/src/smartWallet.js').BridgeAction} bridgeAction + * @param {import('./rpc.js').MinimalNetworkConfig & { * from: string, * fees?: string, * verbose?: boolean, diff --git a/packages/base-zone/tools/testers.js b/packages/base-zone/tools/testers.js index 86d51c919ba..c9d0be11af6 100644 --- a/packages/base-zone/tools/testers.js +++ b/packages/base-zone/tools/testers.js @@ -65,7 +65,7 @@ const secondThrows = (t, fn, spec = alreadyExceptionSpec) => { /** * @param {import('ava').Assertions} t - * @param {import('../src/index').Zone} rootZone + * @param {import('../src/index.js').Zone} rootZone */ export const testFirstZoneIncarnation = (t, rootZone) => { const subZone = secondThrows(t, () => rootZone.subZone('sub')); @@ -94,7 +94,7 @@ export const testFirstZoneIncarnation = (t, rootZone) => { /** * @param {import('ava').Assertions} t - * @param {import('../src/index').Zone} rootZone + * @param {import('../src/index.js').Zone} rootZone */ export const testSecondZoneIncarnation = (t, rootZone) => { const subZone = secondThrows(t, () => rootZone.subZone('sub')); diff --git a/packages/cache/src/cache.js b/packages/cache/src/cache.js index 2d2efb0e123..1788745a74f 100644 --- a/packages/cache/src/cache.js +++ b/packages/cache/src/cache.js @@ -12,7 +12,7 @@ import { makeScalarStoreCoordinator } from './store.js'; */ /** - * @param {ERef} [coordinator] + * @param {ERef} [coordinator] */ export const makeCache = (coordinator = makeScalarStoreCoordinator()) => { /** diff --git a/packages/cache/src/state.js b/packages/cache/src/state.js index 683922af6dd..67507ac79af 100644 --- a/packages/cache/src/state.js +++ b/packages/cache/src/state.js @@ -30,7 +30,7 @@ export const makeState = (value, priorState = GROUND_STATE) => /** * Wrap a state store to have a default value using the GROUND_STATE * - * @param {MapStore} stateStore + * @param {MapStore} stateStore */ export const withGroundState = stateStore => ({ ...stateStore, diff --git a/packages/cache/src/store.js b/packages/cache/src/store.js index a766af6eee0..01670024e8f 100644 --- a/packages/cache/src/store.js +++ b/packages/cache/src/store.js @@ -40,9 +40,9 @@ const makeKeyToString = (sanitize = obj => obj) => { * @param {(obj: unknown) => unknown} sanitize Process keys and values with * this function before storing them * @param {{ - * get(key: string): import('./state').State; - * set(key: string, value: import('./state').State): void; - * init(key: string, value: import('./state').State): void; + * get(key: string): import('./state.js').State; + * set(key: string, value: import('./state.js').State): void; + * init(key: string, value: import('./state.js').State): void; * }} stateStore * @returns {Promise} the value of the updated state */ @@ -56,8 +56,8 @@ const applyCacheTransaction = async ( /** * Retrieve a potential updated state from the transaction. * - * @param {import('./state').State} basisState - * @returns {Promise} the updated state, or null if no longer applicable + * @param {import('./state.js').State} basisState + * @returns {Promise} the updated state, or null if no longer applicable */ const getUpdatedState = async basisState => { const { value } = basisState; @@ -106,7 +106,7 @@ const applyCacheTransaction = async ( }; /** - * @param {MapStore} stateStore + * @param {MapStore} stateStore * @param {ERef} marshaller * @returns {Promise} */ @@ -124,7 +124,7 @@ const stringifyStateStore = async (stateStore, marshaller) => { * Make a cache coordinator backed by a MapStore. This coordinator doesn't * currently enforce any cache eviction, but that would be a useful feature. * - * @param {MapStore} [stateStore] + * @param {MapStore} [stateStore] * @param {(obj: unknown) => unknown} [sanitize] Process keys and values with * this function before storing them. Defaults to deeplyFulfilled. */ @@ -136,7 +136,7 @@ export const makeScalarStoreCoordinator = ( const defaultStateStore = withGroundState(stateStore); - /** @type {import('./types').Coordinator} */ + /** @type {import('./types.js').Coordinator} */ const coord = Far('store cache coordinator', { getRecentValue: async key => { const keyStr = await serializePassable(key); @@ -169,7 +169,7 @@ export const makeScalarStoreCoordinator = ( /** * Don't write any marshalled value that's older than what's already pushed * - * @param {MapStore} stateStore + * @param {MapStore} stateStore * @param {ERef} marshaller * @param {ERef} storageNode * @returns {(storedValue: T) => Promise} @@ -216,7 +216,7 @@ export const makeChainStorageCoordinator = (storageNode, marshaller) => { storageNode, ); - /** @type {import('./types').Coordinator} */ + /** @type {import('./types.js').Coordinator} */ const coord = Far('store cache coordinator', { getRecentValue: async key => { const keyStr = await serializePassable(key); diff --git a/packages/casting/src/casting-spec.js b/packages/casting/src/casting-spec.js index 65358aba947..fb776c20f3c 100644 --- a/packages/casting/src/casting-spec.js +++ b/packages/casting/src/casting-spec.js @@ -5,7 +5,7 @@ const { toAscii } = encodingStar; /** * @param {string} storagePath - * @returns {import('./types').CastingSpec} + * @returns {import('./types.js').CastingSpec} */ const swingsetPathToCastingSpec = storagePath => harden({ @@ -22,7 +22,7 @@ const NO_DATA_VALUE = new Uint8Array([255]); /** * @param {string} storagePath * @param {string} [storeName] - * @returns {import('./types').CastingSpec} + * @returns {import('./types.js').CastingSpec} */ const vstoragePathToCastingSpec = (storagePath, storeName = 'vstorage') => { const elems = storagePath ? storagePath.split('.') : []; @@ -58,7 +58,7 @@ export const vstorageKeySpecToPath = ({ storeName, storeSubkey }) => { export const DEFAULT_PATH_CONVERTER = vstoragePathToCastingSpec; /** - * @type {Record import('./types').CastingSpec>} + * @type {Record import('./types.js').CastingSpec>} */ export const pathPrefixToConverters = harden({ 'swingset:': swingsetPathToCastingSpec, @@ -68,7 +68,7 @@ export const pathPrefixToConverters = harden({ /** * @param {string} specString - * @returns {import('./types').CastingSpec} + * @returns {import('./types.js').CastingSpec} */ export const makeCastingSpecFromString = specString => { assert.typeof(specString, 'string'); @@ -88,7 +88,7 @@ const te = new TextEncoder(); /** * @param {any} specObj - * @returns {import('./types').CastingSpec} + * @returns {import('./types.js').CastingSpec} */ export const makeCastingSpecFromObject = specObj => { const { @@ -127,7 +127,7 @@ export const makeCastingSpecFromObject = specObj => { /** * @param {ERef} specCap - * @returns {Promise} + * @returns {Promise} */ export const makeCastingSpecFromRef = async specCap => { const specObj = await E(specCap).getStoreKey(); @@ -138,7 +138,7 @@ export const makeCastingSpecFromRef = async specCap => { * Create an abstract type from a given source representation * * @param {ERef} sourceP - * @returns {Promise} + * @returns {Promise} */ export const makeCastingSpec = async sourceP => { const spec = await sourceP; diff --git a/packages/casting/src/change-follower.js b/packages/casting/src/change-follower.js index d1b670ef807..e5d8cf38ef0 100644 --- a/packages/casting/src/change-follower.js +++ b/packages/casting/src/change-follower.js @@ -4,8 +4,8 @@ import { DEFAULT_KEEP_POLLING } from './defaults.js'; /** * Just return an unspecified allegedValue every poll period. * - * @param {import('./types').Leader} leader - * @returns {Promise>} + * @param {import('./types.js').Leader} leader + * @returns {Promise>} */ export const makePollingChangeFollower = async leader => { const { keepPolling = DEFAULT_KEEP_POLLING } = await E(leader).getOptions(); diff --git a/packages/casting/src/defaults.js b/packages/casting/src/defaults.js index 5d0923da3be..321e9eec29a 100644 --- a/packages/casting/src/defaults.js +++ b/packages/casting/src/defaults.js @@ -95,7 +95,7 @@ export const MAKE_DEFAULT_DECODER = () => { /** * Unserialize the JSONable data. * - * @type {() => import('./types').Unserializer} + * @type {() => import('./types.js').Unserializer} */ export const MAKE_DEFAULT_UNSERIALIZER = () => { const ifaceAllegedPrefix = 'Alleged: '; diff --git a/packages/casting/src/follower-cosmjs.js b/packages/casting/src/follower-cosmjs.js index 206d6c2c494..ffe7b26e372 100644 --- a/packages/casting/src/follower-cosmjs.js +++ b/packages/casting/src/follower-cosmjs.js @@ -90,8 +90,8 @@ const proofs = ['strict', 'none', 'optimistic']; /** * @template T * @param {any} sourceP - * @param {import('./types').LeaderOrMaker} [leaderOrMaker] - * @param {import('./types').FollowerOptions} [options] + * @param {import('./types.js').LeaderOrMaker} [leaderOrMaker] + * @param {import('./types.js').FollowerOptions} [options] * @returns {ValueFollower} */ export const makeCosmjsFollower = ( diff --git a/packages/casting/src/follower.js b/packages/casting/src/follower.js index 0eb0018460e..bc49801acab 100644 --- a/packages/casting/src/follower.js +++ b/packages/casting/src/follower.js @@ -11,12 +11,12 @@ import { makeCastingSpec } from './casting-spec.js'; /** * @template T - * @param {ERef} spec + * @param {ERef} spec */ const makeSubscriptionFollower = spec => { const transform = value => harden({ value, blockHeight: NaN, currentBlockHeight: NaN }); - /** @type {import('./types').Follower>} */ + /** @type {import('./types.js').Follower>} */ const follower = Far('subscription/notifier follower', { getLatestIterable: async () => { const { notifier, subscription } = await spec; @@ -53,10 +53,10 @@ const makeSubscriptionFollower = spec => { /** * @template T - * @param {ERef | string} specP - * @param {import('./types').LeaderOrMaker} [leaderOrMaker] - * @param {import('./types').FollowerOptions} [options] - * @returns {Promise>} + * @param {ERef | string} specP + * @param {import('./types.js').LeaderOrMaker} [leaderOrMaker] + * @param {import('./types.js').FollowerOptions} [options] + * @returns {Promise>} */ export const makeFollower = async (specP, leaderOrMaker, options) => { const spec = await makeCastingSpec(specP); diff --git a/packages/casting/src/iterable.js b/packages/casting/src/iterable.js index 7e9316cd79b..392a0c48227 100644 --- a/packages/casting/src/iterable.js +++ b/packages/casting/src/iterable.js @@ -22,7 +22,7 @@ export const mapAsyncIterable = (iterable, transform) => { * TODO: Remove this function when we have an @endo/publish-kit that suppports pull topics * * @template T - * @param {ERef>} follower + * @param {ERef>} follower */ export const iterateLatest = follower => // For now, just pass through the iterable. diff --git a/packages/deploy-script-support/src/install.js b/packages/deploy-script-support/src/install.js index c73410db2a3..9b236c4ddcf 100644 --- a/packages/deploy-script-support/src/install.js +++ b/packages/deploy-script-support/src/install.js @@ -3,7 +3,7 @@ import './externalTypes.js'; import { E } from '@endo/far'; -/** @typedef {import('@agoric/deploy-script-support/src/externalTypes').Petname} Petname */ +/** @typedef {import('@agoric/deploy-script-support/src/externalTypes.js').Petname} Petname */ // XXX board is Board but specifying that leads to type errors with imports which aren't worth fixing right now /** diff --git a/packages/deploy-script-support/src/offer.js b/packages/deploy-script-support/src/offer.js index f26151fe3a7..8ba945f20e4 100644 --- a/packages/deploy-script-support/src/offer.js +++ b/packages/deploy-script-support/src/offer.js @@ -4,7 +4,7 @@ import { assert } from '@agoric/assert'; // Avoid pulling in too many dependencies like notifiers import { AmountMath } from '@agoric/ertp/src/amountMath.js'; -/** @typedef {import('@agoric/deploy-script-support/src/externalTypes').Petname} Petname */ +/** @typedef {import('@agoric/deploy-script-support/src/externalTypes.js').Petname} Petname */ /** * @typedef {object} OfferHelperConfig diff --git a/packages/deploy-script-support/src/saveIssuer.js b/packages/deploy-script-support/src/saveIssuer.js index 6610a2ed06e..e21315032c2 100644 --- a/packages/deploy-script-support/src/saveIssuer.js +++ b/packages/deploy-script-support/src/saveIssuer.js @@ -1,12 +1,12 @@ // @ts-check import { E } from '@endo/far'; -/** @typedef {import('@agoric/deploy-script-support/src/externalTypes').Petname} Petname */ +/** @typedef {import('@agoric/deploy-script-support/src/externalTypes.js').Petname} Petname */ /** * @param {ERef} walletAdmin - an internal type of the * wallet, not defined here - * @param {ERef} issuerManager + * @param {ERef} issuerManager */ export const makeSaveIssuer = (walletAdmin, issuerManager) => { /** diff --git a/packages/deploy-script-support/src/startInstance.js b/packages/deploy-script-support/src/startInstance.js index c4ebc004253..0a1e17996de 100644 --- a/packages/deploy-script-support/src/startInstance.js +++ b/packages/deploy-script-support/src/startInstance.js @@ -2,7 +2,7 @@ import { assert } from '@agoric/assert'; import { E, passStyleOf } from '@endo/far'; -/** @typedef {import('@agoric/deploy-script-support/src/externalTypes').Petname} Petname */ +/** @typedef {import('@agoric/deploy-script-support/src/externalTypes.js').Petname} Petname */ /** * @template T diff --git a/packages/deploy-script-support/test/unitTests/test-startInstance.js b/packages/deploy-script-support/test/unitTests/test-startInstance.js index f356fff7dd0..1f191f42614 100644 --- a/packages/deploy-script-support/test/unitTests/test-startInstance.js +++ b/packages/deploy-script-support/test/unitTests/test-startInstance.js @@ -9,7 +9,7 @@ import { E } from '@endo/far'; import { makeStartInstance } from '../../src/startInstance.js'; -/** @typedef {import('@agoric/deploy-script-support/src/externalTypes').Petname} Petname */ +/** @typedef {import('@agoric/deploy-script-support/src/externalTypes.js').Petname} Petname */ test('startInstance', async t => { const MOOLA_BRAND_PETNAME = 'moola'; diff --git a/packages/governance/src/contractHelper.js b/packages/governance/src/contractHelper.js index 7410bf7ae67..894f6f041d0 100644 --- a/packages/governance/src/contractHelper.js +++ b/packages/governance/src/contractHelper.js @@ -32,7 +32,7 @@ const publicMixinAPI = harden({ /** * @param {ZCF & {}>} zcf - * @param {import('./contractGovernance/typedParamManager').TypedParamManager} paramManager + * @param {import('./contractGovernance/typedParamManager.js').TypedParamManager} paramManager */ export const validateElectorate = (zcf, paramManager) => { const { governedParams } = zcf.getTerms(); @@ -55,7 +55,7 @@ harden(validateElectorate); * * @template {import('./contractGovernance/typedParamManager.js').ParamTypesMap} T * @param {ZCF & {}>} zcf - * @param {import('./contractGovernance/typedParamManager').TypedParamManager} paramManager + * @param {import('./contractGovernance/typedParamManager.js').TypedParamManager} paramManager */ const facetHelpers = (zcf, paramManager) => { // validate async to wait for params to be finished @@ -245,7 +245,7 @@ const facetHelpers = (zcf, paramManager) => { * parameter values, and the governance guarantees only hold if they're not used * directly by the governed contract. * - * @template {import('./contractGovernance/typedParamManager').ParamTypesMap} M + * @template {import('./contractGovernance/typedParamManager.js').ParamTypesMap} M * Map of types of custom governed terms * @param {ZCF>} zcf * @param {Invitation} initialPoserInvitation diff --git a/packages/governance/tools/puppetGovernance.js b/packages/governance/tools/puppetGovernance.js index 10ce1dd5a24..6e6624f02ba 100644 --- a/packages/governance/tools/puppetGovernance.js +++ b/packages/governance/tools/puppetGovernance.js @@ -43,7 +43,7 @@ export const setUpGovernedContract = async ( /** * @type {[ - * Installation, + * Installation, * Installation, * Installation, * ]} diff --git a/packages/inter-protocol/src/clientSupport.js b/packages/inter-protocol/src/clientSupport.js index 56e0b283498..a4526ff624c 100644 --- a/packages/inter-protocol/src/clientSupport.js +++ b/packages/inter-protocol/src/clientSupport.js @@ -160,7 +160,7 @@ const makeCloseOffer = ({ brand }, opts, previousOffer) => { /** * @param {string} vaultId * @param {Promise< - * import('@agoric/smart-wallet/src/smartWallet').CurrentWalletRecord + * import('@agoric/smart-wallet/src/smartWallet.js').CurrentWalletRecord * >} currentP * @returns {Promise} offer id in which the vault was made */ diff --git a/packages/inter-protocol/src/price/fluxAggregatorKit.js b/packages/inter-protocol/src/price/fluxAggregatorKit.js index 39601167799..910f060d489 100644 --- a/packages/inter-protocol/src/price/fluxAggregatorKit.js +++ b/packages/inter-protocol/src/price/fluxAggregatorKit.js @@ -27,8 +27,8 @@ export const INVITATION_MAKERS_DESC = 'oracle invitation'; * * @typedef {import('@agoric/time').Timestamp} Timestamp * - * @typedef {import('@agoric/time').RelativeTime} RelativeTime // TODO: use - * RelativeTime, not RelativeTimeValue + * @typedef {import('@agoric/time').RelativeTime} RelativeTime // + * TODO: use RelativeTime, not RelativeTimeValue * * @typedef {import('@agoric/time').RelativeTimeValue} RelativeTimeValue * diff --git a/packages/inter-protocol/src/proposals/committee-proposal.js b/packages/inter-protocol/src/proposals/committee-proposal.js index 8ebe07367f9..5f86fb31443 100644 --- a/packages/inter-protocol/src/proposals/committee-proposal.js +++ b/packages/inter-protocol/src/proposals/committee-proposal.js @@ -10,7 +10,7 @@ const zip = (xs, ys) => xs.map((x, i) => [x, ys[i]]); const EC_HIGH_PRIORITY_SENDERS_NAMESPACE = 'economicCommittee'; /** - * @param {import('./econ-behaviors').EconomyBootstrapPowers} powers + * @param {import('./econ-behaviors.js').EconomyBootstrapPowers} powers * @param {{ options: { voterAddresses: Record } }} param1 */ export const inviteCommitteeMembers = async ( @@ -51,7 +51,7 @@ export const inviteCommitteeMembers = async ( harden(inviteCommitteeMembers); -/** @param {import('./econ-behaviors').EconomyBootstrapPowers} powers */ +/** @param {import('./econ-behaviors.js').EconomyBootstrapPowers} powers */ export const startEconCharter = async ({ consume: { zoe }, produce: { econCharterKit }, @@ -72,7 +72,7 @@ export const startEconCharter = async ({ }), ); - /** @type {Promise} */ + /** @type {Promise} */ const startResult = E(zoe).startInstance( charterInstall, undefined, @@ -88,7 +88,7 @@ harden(startEconCharter); /** * Introduce charter to governed creator facets. * - * @param {import('./econ-behaviors').EconomyBootstrapPowers} powers + * @param {import('./econ-behaviors.js').EconomyBootstrapPowers} powers */ export const addGovernorsToEconCharter = async ({ consume: { reserveKit, vaultFactoryKit, econCharterKit, auctioneerKit }, @@ -126,7 +126,7 @@ export const addGovernorsToEconCharter = async ({ harden(addGovernorsToEconCharter); /** - * @param {import('./econ-behaviors').EconomyBootstrapPowers} powers + * @param {import('./econ-behaviors.js').EconomyBootstrapPowers} powers * @param {{ options: { voterAddresses: Record } }} param1 */ export const inviteToEconCharter = async ( diff --git a/packages/inter-protocol/src/proposals/econ-behaviors.js b/packages/inter-protocol/src/proposals/econ-behaviors.js index e553f78776d..2a9f363934a 100644 --- a/packages/inter-protocol/src/proposals/econ-behaviors.js +++ b/packages/inter-protocol/src/proposals/econ-behaviors.js @@ -75,7 +75,7 @@ export const SECONDS_PER_WEEK = 7n * SECONDS_PER_DAY; /** * @typedef {import('@agoric/zoe/src/zoeService/utils.js').StartedInstanceKit< - * import('../econCommitteeCharter')['start'] + * import('../econCommitteeCharter.js')['start'] * >} EconCharterStartResult */ /** diff --git a/packages/inter-protocol/src/proposals/price-feed-proposal.js b/packages/inter-protocol/src/proposals/price-feed-proposal.js index b0a55b67470..a5dd1fa8c0b 100644 --- a/packages/inter-protocol/src/proposals/price-feed-proposal.js +++ b/packages/inter-protocol/src/proposals/price-feed-proposal.js @@ -293,7 +293,7 @@ export const getManifestForPriceFeed = async ( }); /** - * @param {import('./econ-behaviors').EconomyBootstrapPowers} powers + * @param {import('./econ-behaviors.js').EconomyBootstrapPowers} powers * @param {object} [config] * @param {object} [config.options] * @param {string[]} [config.options.demoOracleAddresses] diff --git a/packages/inter-protocol/src/proposals/startEconCommittee.js b/packages/inter-protocol/src/proposals/startEconCommittee.js index 72bbc90b577..f4e40fc0ef8 100644 --- a/packages/inter-protocol/src/proposals/startEconCommittee.js +++ b/packages/inter-protocol/src/proposals/startEconCommittee.js @@ -21,7 +21,7 @@ const sanitizePathSegment = name => { */ /** - * @param {import('./econ-behaviors').EconomyBootstrapPowers} powers + * @param {import('./econ-behaviors.js').EconomyBootstrapPowers} powers * @param {object} config * @param {object} [config.options] * @param {EconCommitteeOptions} [config.options.econCommitteeOptions] diff --git a/packages/inter-protocol/src/provisionPool.js b/packages/inter-protocol/src/provisionPool.js index b192b2fcb54..27a7622cf64 100644 --- a/packages/inter-protocol/src/provisionPool.js +++ b/packages/inter-protocol/src/provisionPool.js @@ -46,7 +46,7 @@ harden(meta); * initialPoserInvitation: Invitation; * storageNode: StorageNode; * marshaller: Marshaller; - * metricsOverride?: import('./provisionPoolKit').MetricsNotification; + * metricsOverride?: import('./provisionPoolKit.js').MetricsNotification; * }} privateArgs * @param {import('@agoric/vat-data').Baggage} baggage */ diff --git a/packages/inter-protocol/src/provisionPoolKit.js b/packages/inter-protocol/src/provisionPoolKit.js index b2a416ccda0..d5626a522f0 100644 --- a/packages/inter-protocol/src/provisionPoolKit.js +++ b/packages/inter-protocol/src/provisionPoolKit.js @@ -24,7 +24,7 @@ import { Far, deeplyFulfilled } from '@endo/marshal'; const { details: X, quote: q, Fail } = assert; /** - * @typedef {import('@agoric/zoe/src/zoeService/utils').Instance< + * @typedef {import('@agoric/zoe/src/zoeService/utils.js').Instance< * import('@agoric/inter-protocol/src/psm/psm.js').start * >} PsmInstance */ @@ -34,7 +34,7 @@ const { details: X, quote: q, Fail } = assert; * @property {ERef} bankManager * @property {ERef} namesByAddressAdmin * @property {ERef< - * import('@agoric/vats/src/core/startWalletFactory').WalletFactoryStartResult['creatorFacet'] + * import('@agoric/vats/src/core/startWalletFactory.js').WalletFactoryStartResult['creatorFacet'] * >} walletFactory */ diff --git a/packages/inter-protocol/src/psm/types.js b/packages/inter-protocol/src/psm/types.js index 8790cb8b40d..622fffa556d 100644 --- a/packages/inter-protocol/src/psm/types.js +++ b/packages/inter-protocol/src/psm/types.js @@ -1,3 +1,3 @@ // @jessie-check -/** @typedef {import('./psm').PsmPublicFacet} PsmPublicFacet */ +/** @typedef {import('./psm.js').PsmPublicFacet} PsmPublicFacet */ diff --git a/packages/inter-protocol/src/vaultFactory/orderedVaultStore.js b/packages/inter-protocol/src/vaultFactory/orderedVaultStore.js index d4423b2b7cf..6826c423f8d 100644 --- a/packages/inter-protocol/src/vaultFactory/orderedVaultStore.js +++ b/packages/inter-protocol/src/vaultFactory/orderedVaultStore.js @@ -11,8 +11,8 @@ import { fromVaultKey, toVaultKey } from './storeUtils.js'; * debt-to-collateral come first.) */ -/** @typedef {import('./vault').Vault} Vault */ -/** @typedef {import('./storeUtils').CompositeKey} CompositeKey */ +/** @typedef {import('./vault.js').Vault} Vault */ +/** @typedef {import('./storeUtils.js').CompositeKey} CompositeKey */ /** @param {MapStore} store */ export const makeOrderedVaultStore = store => { diff --git a/packages/inter-protocol/src/vaultFactory/params.js b/packages/inter-protocol/src/vaultFactory/params.js index 39387f98c2d..239a33ce53f 100644 --- a/packages/inter-protocol/src/vaultFactory/params.js +++ b/packages/inter-protocol/src/vaultFactory/params.js @@ -76,7 +76,7 @@ const makeVaultDirectorParams = ( harden(makeVaultDirectorParams); /** - * @typedef {import('@agoric/governance/src/contractGovernance/typedParamManager').ParamTypesMapFromRecord< + * @typedef {import('@agoric/governance/src/contractGovernance/typedParamManager.js').ParamTypesMapFromRecord< * ReturnType * >} VaultDirectorParams */ diff --git a/packages/inter-protocol/src/vaultFactory/prioritizedVaults.js b/packages/inter-protocol/src/vaultFactory/prioritizedVaults.js index 0402e8ffa4e..9e56855ba91 100644 --- a/packages/inter-protocol/src/vaultFactory/prioritizedVaults.js +++ b/packages/inter-protocol/src/vaultFactory/prioritizedVaults.js @@ -13,7 +13,7 @@ import { normalizedCollRatio, } from './storeUtils.js'; -/** @typedef {import('./vault').Vault} Vault */ +/** @typedef {import('./vault.js').Vault} Vault */ /** @typedef {import('./storeUtils.js').NormalizedDebt} NormalizedDebt */ const trace = makeTracer('PVaults', true); diff --git a/packages/inter-protocol/src/vaultFactory/types.js b/packages/inter-protocol/src/vaultFactory/types.js index 2dd51b986c8..01c3750b9ad 100644 --- a/packages/inter-protocol/src/vaultFactory/types.js +++ b/packages/inter-protocol/src/vaultFactory/types.js @@ -1,15 +1,15 @@ // @jessie-check /** - * @typedef {import('./vault').VaultNotification} VaultNotification + * @typedef {import('./vault.js').VaultNotification} VaultNotification * - * @typedef {import('./vault').Vault} Vault + * @typedef {import('./vault.js').Vault} Vault * - * @typedef {import('./vaultKit').VaultKit} VaultKit + * @typedef {import('./vaultKit.js').VaultKit} VaultKit * - * @typedef {import('./vaultManager').VaultManager} VaultManager + * @typedef {import('./vaultManager.js').VaultManager} VaultManager * - * @typedef {import('./vaultManager').CollateralManager} CollateralManager + * @typedef {import('./vaultManager.js').CollateralManager} CollateralManager * * @typedef {import('../reserve/assetReserve.js').AssetReserveLimitedCreatorFacet} AssetReserveCreatorFacet * diff --git a/packages/inter-protocol/src/vaultFactory/vault.js b/packages/inter-protocol/src/vaultFactory/vault.js index 951e5ccde97..15fb0a1fc80 100644 --- a/packages/inter-protocol/src/vaultFactory/vault.js +++ b/packages/inter-protocol/src/vaultFactory/vault.js @@ -85,7 +85,7 @@ const validTransitions = { // XXX masks typedef from types.js, but using that causes circular def problems /** * @typedef {object} VaultManager - * @property {() => Subscriber} getAssetSubscriber + * @property {() => Subscriber} getAssetSubscriber * @property {(collateralAmount: Amount) => Amount<'nat'>} maxDebtFor * @property {() => Brand} getCollateralBrand * @property {(base: string) => string} scopeDescription diff --git a/packages/inter-protocol/src/vaultFactory/vaultDirector.js b/packages/inter-protocol/src/vaultFactory/vaultDirector.js index 2dfcbf5a9d8..1d3d0aeac30 100644 --- a/packages/inter-protocol/src/vaultFactory/vaultDirector.js +++ b/packages/inter-protocol/src/vaultFactory/vaultDirector.js @@ -69,7 +69,7 @@ const trace = makeTracer('VD', true); * state: State; * }>} MethodContext * - * @typedef {import('@agoric/governance/src/contractGovernance/typedParamManager').TypedParamManager< + * @typedef {import('@agoric/governance/src/contractGovernance/typedParamManager.js').TypedParamManager< * import('./params.js').VaultDirectorParams * >} VaultDirectorParamManager */ diff --git a/packages/inter-protocol/src/vaultFactory/vaultFactory.js b/packages/inter-protocol/src/vaultFactory/vaultFactory.js index 9852c781e19..18a6c3e7f50 100644 --- a/packages/inter-protocol/src/vaultFactory/vaultFactory.js +++ b/packages/inter-protocol/src/vaultFactory/vaultFactory.js @@ -35,7 +35,7 @@ const trace = makeTracer('VF', true); /** * @typedef {ZCF< - * GovernanceTerms & { + * GovernanceTerms & { * auctioneerPublicFacet: import('../auction/auctioneer.js').AuctioneerPublicFacet; * priceAuthority: ERef; * reservePublicFacet: AssetReservePublicFacet; diff --git a/packages/inter-protocol/test/auction/tools.js b/packages/inter-protocol/test/auction/tools.js index 04405e5cfb5..0c78bfe8c97 100644 --- a/packages/inter-protocol/test/auction/tools.js +++ b/packages/inter-protocol/test/auction/tools.js @@ -13,9 +13,9 @@ import { resolve as importMetaResolve } from 'import-meta-resolve'; /** * @typedef {{ * autoRefund: Installation< - * import('@agoric/zoe/src/contracts/automaticRefund').start + * import('@agoric/zoe/src/contracts/automaticRefund.js').start * >; - * auctioneer: Installation; + * auctioneer: Installation; * governor: Installation< * import('@agoric/governance/src/contractGovernor.js')['start'] * >; diff --git a/packages/inter-protocol/test/metrics.js b/packages/inter-protocol/test/metrics.js index 8f9d8520357..8ccd4a50d2d 100644 --- a/packages/inter-protocol/test/metrics.js +++ b/packages/inter-protocol/test/metrics.js @@ -89,7 +89,7 @@ export const metricsTracker = async (t, publicFacet) => { /** * @param {import('ava').ExecutionContext} t - * @param {import('../src/vaultFactory/vaultManager').CollateralManager} publicFacet + * @param {import('../src/vaultFactory/vaultManager.js').CollateralManager} publicFacet */ export const vaultManagerMetricsTracker = async (t, publicFacet) => { let totalDebtEver = 0n; @@ -97,7 +97,7 @@ export const vaultManagerMetricsTracker = async (t, publicFacet) => { * @type {Awaited< * ReturnType< * typeof subscriptionTracker< - * import('../src/vaultFactory/vaultManager').MetricsNotification + * import('../src/vaultFactory/vaultManager.js').MetricsNotification * > * > * >} diff --git a/packages/inter-protocol/test/psm/test-psm.js b/packages/inter-protocol/test/psm/test-psm.js index f5f4ad373e7..38066486922 100644 --- a/packages/inter-protocol/test/psm/test-psm.js +++ b/packages/inter-protocol/test/psm/test-psm.js @@ -751,7 +751,7 @@ const makeMockBankManager = t => { }; test('restore PSM: startPSM with previous metrics, params', async t => { - /** @type {import('../../src/proposals/econ-behaviors').EconomyBootstrapPowers} */ + /** @type {import('../../src/proposals/econ-behaviors.js').EconomyBootstrapPowers} */ // @ts-expect-error mock const { produce, consume } = makePromiseSpace(); const { agoricNames, agoricNamesAdmin, spaces } = diff --git a/packages/inter-protocol/test/reserve/setup.js b/packages/inter-protocol/test/reserve/setup.js index b74b9637f86..a76b0080e41 100644 --- a/packages/inter-protocol/test/reserve/setup.js +++ b/packages/inter-protocol/test/reserve/setup.js @@ -54,8 +54,8 @@ const setupReserveBootstrap = async (t, timer, farZoeKit) => { /** * @typedef {{ - * reserveCreatorFacet: import('../../src/reserve/assetReserve').AssetReserveLimitedCreatorFacet; - * reservePublicFacet: import('../../src/reserve/assetReserve').AssetReservePublicFacet; + * reserveCreatorFacet: import('../../src/reserve/assetReserve.js').AssetReserveLimitedCreatorFacet; + * reservePublicFacet: import('../../src/reserve/assetReserve.js').AssetReservePublicFacet; * instance: Instance; * }} ReserveKit */ diff --git a/packages/inter-protocol/test/smartWallet/contexts.js b/packages/inter-protocol/test/smartWallet/contexts.js index 91cf8f017b0..a2cb53e6919 100644 --- a/packages/inter-protocol/test/smartWallet/contexts.js +++ b/packages/inter-protocol/test/smartWallet/contexts.js @@ -244,7 +244,7 @@ export const currentPurseBalance = (record, brand) => { * @param {ERef} committeePublic * @param {string} voterAcceptanceOID * @returns {Promise< - * import('@agoric/smart-wallet/src/invitations').ContinuingInvitationSpec + * import('@agoric/smart-wallet/src/invitations.js').ContinuingInvitationSpec * >} */ export const voteForOpenQuestion = async ( @@ -257,7 +257,7 @@ export const voteForOpenQuestion = async ( const { positions, questionHandle } = await E(question).getDetails(); const yesPosition = harden([positions[0]]); - /** @type {import('@agoric/smart-wallet/src/invitations').ContinuingInvitationSpec} */ + /** @type {import('@agoric/smart-wallet/src/invitations.js').ContinuingInvitationSpec} */ const getVoteSpec = { source: 'continuing', previousOffer: voterAcceptanceOID, diff --git a/packages/inter-protocol/test/smartWallet/test-oracle-integration.js b/packages/inter-protocol/test/smartWallet/test-oracle-integration.js index a11846e0c86..f9a290bdad6 100644 --- a/packages/inter-protocol/test/smartWallet/test-oracle-integration.js +++ b/packages/inter-protocol/test/smartWallet/test-oracle-integration.js @@ -374,7 +374,7 @@ test.serial('govern oracles list', async t => { 'econCommitteeCharter', ); /** - * @type {import('@agoric/zoe/src/zoeService/utils').Instance< + * @type {import('@agoric/zoe/src/zoeService/utils.js').Instance< * import('@agoric/governance/src/committee.js')['start'] * >} */ @@ -419,7 +419,7 @@ test.serial('govern oracles list', async t => { // Accept the EC invitation makers /////////// { - /** @type {import('@agoric/smart-wallet/src/invitations').PurseInvitationSpec} */ + /** @type {import('@agoric/smart-wallet/src/invitations.js').PurseInvitationSpec} */ const getInvMakersSpec = { source: 'purse', instance: econCharter, @@ -482,7 +482,7 @@ test.serial('govern oracles list', async t => { // Call for a vote to addOracles //////////////////////////////// { - /** @type {import('@agoric/smart-wallet/src/invitations').ContinuingInvitationSpec} */ + /** @type {import('@agoric/smart-wallet/src/invitations.js').ContinuingInvitationSpec} */ const proposeInvitationSpec = { source: 'continuing', previousOffer: 'acceptEcInvitationOID', @@ -538,7 +538,7 @@ test.serial('govern oracles list', async t => { // Call for a vote to removeOracles //////////////////////////////// { - /** @type {import('@agoric/smart-wallet/src/invitations').ContinuingInvitationSpec} */ + /** @type {import('@agoric/smart-wallet/src/invitations.js').ContinuingInvitationSpec} */ const proposeInvitationSpec = { source: 'continuing', previousOffer: 'acceptEcInvitationOID', diff --git a/packages/inter-protocol/test/smartWallet/test-psm-integration.js b/packages/inter-protocol/test/smartWallet/test-psm-integration.js index f3cc6448c4c..1b0f0bddb80 100644 --- a/packages/inter-protocol/test/smartWallet/test-psm-integration.js +++ b/packages/inter-protocol/test/smartWallet/test-psm-integration.js @@ -67,7 +67,7 @@ test('null swap', async t => { const computedState = coalesceUpdates(E(wallet).getUpdatesSubscriber()); const currents = sequenceCurrents(E(wallet).getCurrentSubscriber()); - /** @type {import('@agoric/smart-wallet/src/invitations').AgoricContractInvitationSpec} */ + /** @type {import('@agoric/smart-wallet/src/invitations.js').AgoricContractInvitationSpec} */ const invitationSpec = { source: 'agoricContract', instancePath: ['psm-IST-AUSD'], @@ -124,7 +124,7 @@ test('want stable', async t => { await wallet.getDepositFacet().receive(payment); t.log('Execute the swap'); - /** @type {import('@agoric/smart-wallet/src/invitations').AgoricContractInvitationSpec} */ + /** @type {import('@agoric/smart-wallet/src/invitations.js').AgoricContractInvitationSpec} */ const invitationSpec = { source: 'agoricContract', instancePath: ['psm-IST-AUSD'], @@ -169,7 +169,7 @@ test('want stable (insufficient funds)', async t => { await wallet.getDepositFacet().receive(payment); t.log('Execute the swap'); - /** @type {import('@agoric/smart-wallet/src/invitations').AgoricContractInvitationSpec} */ + /** @type {import('@agoric/smart-wallet/src/invitations.js').AgoricContractInvitationSpec} */ const invitationSpec = { source: 'agoricContract', instancePath: ['psm-IST-AUSD'], @@ -266,7 +266,7 @@ test('govern offerFilter', async t => { // The purse has the invitation to get the makers /////////// - /** @type {import('@agoric/smart-wallet/src/invitations').PurseInvitationSpec} */ + /** @type {import('@agoric/smart-wallet/src/invitations.js').PurseInvitationSpec} */ const getInvMakersSpec = { source: 'purse', instance: econCharter, @@ -307,7 +307,7 @@ test('govern offerFilter', async t => { t.is(voteInvitationDetail.description, 'Voter0'); t.is(voteInvitationDetail.instance, economicCommittee); - /** @type {import('@agoric/smart-wallet/src/invitations').PurseInvitationSpec} */ + /** @type {import('@agoric/smart-wallet/src/invitations.js').PurseInvitationSpec} */ const getCommitteeInvMakersSpec = { source: 'purse', instance: economicCommittee, @@ -336,7 +336,7 @@ test('govern offerFilter', async t => { // Call for a vote //////////////////////////////// - /** @type {import('@agoric/smart-wallet/src/invitations').ContinuingInvitationSpec} */ + /** @type {import('@agoric/smart-wallet/src/invitations.js').ContinuingInvitationSpec} */ const proposeInvitationSpec = { source: 'continuing', previousOffer: 'acceptEcInvitationOID', diff --git a/packages/inter-protocol/test/supports.js b/packages/inter-protocol/test/supports.js index dc6e707ece7..45771750b53 100644 --- a/packages/inter-protocol/test/supports.js +++ b/packages/inter-protocol/test/supports.js @@ -187,7 +187,7 @@ export const subscriptionKey = subscription => { /** * @param {ERef<{ - * getPublicTopics: () => import('@agoric/zoe/src/contractSupport').TopicsRecord; + * getPublicTopics: () => import('@agoric/zoe/src/contractSupport/index.js').TopicsRecord; * }>} hasTopics * @param {string} subscriberName */ @@ -222,7 +222,7 @@ export const headValueLegacy = async subscription => { /** * @param {import('ava').ExecutionContext} t * @param {ERef<{ - * getPublicTopics: () => import('@agoric/zoe/src/contractSupport').TopicsRecord; + * getPublicTopics: () => import('@agoric/zoe/src/contractSupport/index.js').TopicsRecord; * }>} hasTopics * @param {string} topicName * @param {string} path diff --git a/packages/inter-protocol/test/swingsetTests/fluxAggregator/bootstrap-fluxAggregator-service-upgrade.js b/packages/inter-protocol/test/swingsetTests/fluxAggregator/bootstrap-fluxAggregator-service-upgrade.js index 4a1aa61fcfc..f7ee468d911 100644 --- a/packages/inter-protocol/test/swingsetTests/fluxAggregator/bootstrap-fluxAggregator-service-upgrade.js +++ b/packages/inter-protocol/test/swingsetTests/fluxAggregator/bootstrap-fluxAggregator-service-upgrade.js @@ -43,10 +43,10 @@ export const buildRootObject = async () => { * import('@agoric/governance/src/committee.js')['start'] * >; * fluxAggregatorV1?: Installation< - * import('../../../src/price/fluxAggregatorContract').start + * import('../../../src/price/fluxAggregatorContract.js').start * >; * puppetContractGovernor?: Installation< - * import('@agoric/governance/tools/puppetContractGovernor').start + * import('@agoric/governance/tools/puppetContractGovernor.js').start * >; * }} */ diff --git a/packages/inter-protocol/test/swingsetTests/psmUpgrade/bootstrap-psm-upgrade.js b/packages/inter-protocol/test/swingsetTests/psmUpgrade/bootstrap-psm-upgrade.js index d4fa3a05a2f..64982243d48 100644 --- a/packages/inter-protocol/test/swingsetTests/psmUpgrade/bootstrap-psm-upgrade.js +++ b/packages/inter-protocol/test/swingsetTests/psmUpgrade/bootstrap-psm-upgrade.js @@ -71,13 +71,13 @@ export const buildRootObject = async () => { * >; * psmV1?: Installation; * puppetContractGovernor?: Installation< - * import('@agoric/governance/tools/puppetContractGovernor').start + * import('@agoric/governance/tools/puppetContractGovernor.js').start * >; * }} */ const installations = {}; - /** @type {import('@agoric/governance/tools/puppetContractGovernor').PuppetContractGovernorKit} */ + /** @type {import('@agoric/governance/tools/puppetContractGovernor.js').PuppetContractGovernorKit} */ let governorFacets; /** @@ -122,9 +122,11 @@ export const buildRootObject = async () => { /** * @param {{ * vatAdmin: ReturnType< - * import('@agoric/swingset-vat/src/vats/vat-admin/vat-vat-admin')['buildRootObject'] + * import('@agoric/swingset-vat/src/vats/vat-admin/vat-vat-admin.js')['buildRootObject'] + * >; + * zoe: ReturnType< + * import('@agoric/vats/src/vat-zoe.js')['buildRootObject'] * >; - * zoe: ReturnType; * }} vats * @param {any} devices */ diff --git a/packages/inter-protocol/test/swingsetTests/reserve/bootstrap-assetReserve-upgrade.js b/packages/inter-protocol/test/swingsetTests/reserve/bootstrap-assetReserve-upgrade.js index 8fbf978e11a..c6f00c8655a 100644 --- a/packages/inter-protocol/test/swingsetTests/reserve/bootstrap-assetReserve-upgrade.js +++ b/packages/inter-protocol/test/swingsetTests/reserve/bootstrap-assetReserve-upgrade.js @@ -56,20 +56,20 @@ export const buildRootObject = async () => { /** * @type {{ * committee?: Installation< - * import('@agoric/governance/src/committee')['start'] + * import('@agoric/governance/src/committee.js')['start'] * >; * assetReserveV1?: Installation< - * import('../../../src/reserve/assetReserve')['start'] + * import('../../../src/reserve/assetReserve.js')['start'] * >; * puppetContractGovernor?: Installation< - * import('@agoric/governance/tools/puppetContractGovernor')['start'] + * import('@agoric/governance/tools/puppetContractGovernor.js')['start'] * >; * }} */ const installations = {}; /** - * @type {import('@agoric/governance/tools/puppetContractGovernor').PuppetContractGovernorKit< + * @type {import('@agoric/governance/tools/puppetContractGovernor.js').PuppetContractGovernorKit< * import('../../../src/reserve/assetReserve.js').start * >} */ diff --git a/packages/inter-protocol/test/test-provisionPool.js b/packages/inter-protocol/test/test-provisionPool.js index 60ac910bb73..ef53965c3fc 100644 --- a/packages/inter-protocol/test/test-provisionPool.js +++ b/packages/inter-protocol/test/test-provisionPool.js @@ -63,7 +63,7 @@ const makeTestContext = async () => { const committeeInstall = await E(zoe).install(committeeBundle); const psmInstall = await E(zoe).install(psmBundle); const centralSupply = await E(zoe).install(centralSupplyBundle); - /** @type {Installation} */ + /** @type {Installation} */ const policyInstall = await E(zoe).install(policyBundle); const mintLimit = AmountMath.make(mintedBrand, MINT_LIMIT); @@ -328,7 +328,7 @@ const makeWalletFactoryKitForAddresses = async addresses => { }; const done = new Set(); - /** @type {import('@agoric/vats/src/core/startWalletFactory').WalletFactoryStartResult['creatorFacet']} */ + /** @type {import('@agoric/vats/src/core/startWalletFactory.js').WalletFactoryStartResult['creatorFacet']} */ const walletFactory = Far('mock walletFactory', { provideSmartWallet: async (addr, _b, nameAdmin) => { const wallet = wallets.get(addr); diff --git a/packages/inter-protocol/test/vaultFactory/driver.js b/packages/inter-protocol/test/vaultFactory/driver.js index d35a87e2bf8..b0fdb36c2fd 100644 --- a/packages/inter-protocol/test/vaultFactory/driver.js +++ b/packages/inter-protocol/test/vaultFactory/driver.js @@ -29,7 +29,7 @@ import { withAmountUtils, } from '../supports.js'; -/** @typedef {import('../../src/vaultFactory/vaultFactory').VaultFactoryContract} VFC */ +/** @typedef {import('../../src/vaultFactory/vaultFactory.js').VaultFactoryContract} VFC */ const trace = makeTracer('VFDriver'); diff --git a/packages/inter-protocol/test/vaultFactory/test-vaultFactory.js b/packages/inter-protocol/test/vaultFactory/test-vaultFactory.js index 62da14d5e70..f8e134481ef 100644 --- a/packages/inter-protocol/test/vaultFactory/test-vaultFactory.js +++ b/packages/inter-protocol/test/vaultFactory/test-vaultFactory.js @@ -61,7 +61,7 @@ const contractRoots = { auctioneer: './src/auction/auctioneer.js', }; -/** @typedef {import('../../src/vaultFactory/vaultFactory').VaultFactoryContract} VFC */ +/** @typedef {import('../../src/vaultFactory/vaultFactory.js').VaultFactoryContract} VFC */ const trace = makeTracer('TestVF', false); diff --git a/packages/inter-protocol/test/vaultFactory/test-vaultLiquidation.js b/packages/inter-protocol/test/vaultFactory/test-vaultLiquidation.js index 325fb356178..2240f539d3f 100644 --- a/packages/inter-protocol/test/vaultFactory/test-vaultLiquidation.js +++ b/packages/inter-protocol/test/vaultFactory/test-vaultLiquidation.js @@ -62,7 +62,7 @@ const contractRoots = { auctioneer: './src/auction/auctioneer.js', }; -/** @typedef {import('../../src/vaultFactory/vaultFactory').VaultFactoryContract} VFC */ +/** @typedef {import('../../src/vaultFactory/vaultFactory.js').VaultFactoryContract} VFC */ const trace = makeTracer('TestST', false); diff --git a/packages/internal/src/callback.js b/packages/internal/src/callback.js index 14a7ba38138..20668739d79 100644 --- a/packages/internal/src/callback.js +++ b/packages/internal/src/callback.js @@ -20,12 +20,12 @@ const ownKeys = /** * @template {(...args: unknown[]) => any} I - * @typedef {import('./types').Callback} Callback + * @typedef {import('./types.js').Callback} Callback */ /** * @template {(...args: unknown[]) => any} I - * @typedef {import('./types').SyncCallback} SyncCallback + * @typedef {import('./types.js').SyncCallback} SyncCallback */ /** @template T @typedef {import('@endo/eventual-send').RemotableBrand<{}, T> & T} Farable */ diff --git a/packages/internal/src/lib-chainStorage.js b/packages/internal/src/lib-chainStorage.js index 385fc886abe..1b79339e523 100644 --- a/packages/internal/src/lib-chainStorage.js +++ b/packages/internal/src/lib-chainStorage.js @@ -130,7 +130,7 @@ export const prepareChainStorageNode = zone => { /** * Create a storage node for a given backing storage interface and path. * - * @param {import('./callback').Callback<(message: StorageMessage) => any>} messenger a callback + * @param {import('./callback.js').Callback<(message: StorageMessage) => any>} messenger a callback * for sending a storageMessage object to the storage implementation * (cf. golang/cosmos/x/vstorage/vstorage.go) * @param {string} path @@ -145,7 +145,7 @@ export const prepareChainStorageNode = zone => { 'ChainStorageNode', ChainStorageNodeI, /** - * @param {import('./callback').Callback<(message: StorageMessage) => any>} messenger + * @param {import('./callback.js').Callback<(message: StorageMessage) => any>} messenger * @param {string} path * @param {object} [options] * @param {boolean} [options.sequence] diff --git a/packages/internal/test/test-callback.js b/packages/internal/test/test-callback.js index 2b16494de54..ca23cec186c 100644 --- a/packages/internal/test/test-callback.js +++ b/packages/internal/test/test-callback.js @@ -14,15 +14,15 @@ test('near function callbacks', t => { */ const f = (a, b, c) => `${a + b}${c}`; - /** @type {import('../src/callback').SyncCallback} */ + /** @type {import('../src/callback.js').SyncCallback} */ const cb0 = cb.makeSyncFunctionCallback(f); t.deepEqual(cb0, { target: f, bound: [], isSync: true }); - /** @type {import('../src/callback').SyncCallback<(b: number, c: string) => string>} */ + /** @type {import('../src/callback.js').SyncCallback<(b: number, c: string) => string>} */ const cb1 = cb.makeSyncFunctionCallback(f, 9); t.deepEqual(cb1, { target: f, bound: [9], isSync: true }); - /** @type {import('../src/callback').SyncCallback<(c: string) => string>} */ + /** @type {import('../src/callback.js').SyncCallback<(c: string) => string>} */ const cb2 = cb.makeSyncFunctionCallback(f, 9, 10); t.deepEqual(cb2, { target: f, bound: [9, 10], isSync: true }); @@ -40,7 +40,7 @@ test('near function callbacks', t => { t.is(cb.callSync(cb2, 'go'), '19go'); const cbp2 = - /** @type {import('../src/callback').SyncCallback<(...args: unknown[]) => any>} */ ({ + /** @type {import('../src/callback.js').SyncCallback<(...args: unknown[]) => any>} */ ({ target: Promise.resolve(f), methodName: undefined, bound: [9, 10], @@ -72,15 +72,15 @@ test('near method callbacks', t => { }, }; - /** @type {import('../src/callback').SyncCallback} */ + /** @type {import('../src/callback.js').SyncCallback} */ const cb0 = cb.makeSyncMethodCallback(o, 'm1'); t.deepEqual(cb0, { target: o, methodName: 'm1', bound: [], isSync: true }); - /** @type {import('../src/callback').SyncCallback<(b: number, c: string) => string>} */ + /** @type {import('../src/callback.js').SyncCallback<(b: number, c: string) => string>} */ const cb1 = cb.makeSyncMethodCallback(o, 'm1', 9); t.deepEqual(cb1, { target: o, methodName: 'm1', bound: [9], isSync: true }); - /** @type {import('../src/callback').SyncCallback<(c: string) => string>} */ + /** @type {import('../src/callback.js').SyncCallback<(c: string) => string>} */ const cb2 = cb.makeSyncMethodCallback(o, 'm1', 9, 10); t.deepEqual(cb2, { target: o, @@ -98,7 +98,7 @@ test('near method callbacks', t => { isSync: true, }); - /** @type {import('../src/callback').SyncCallback<(c: string) => string>} */ + /** @type {import('../src/callback.js').SyncCallback<(c: string) => string>} */ const cb4 = cb.makeSyncMethodCallback(o, m2, 9, 10); t.deepEqual(cb4, { target: o, methodName: m2, bound: [9, 10], isSync: true }); @@ -145,7 +145,7 @@ test('far method callbacks', async t => { }, }); - /** @type {import('../src/callback').Callback<(c: string) => Promise>} */ + /** @type {import('../src/callback.js').Callback<(c: string) => Promise>} */ const cbp2 = cb.makeMethodCallback(Promise.resolve(o), 'm1', 9, 10); t.like(cbp2, { methodName: 'm1', bound: [9, 10] }); t.assert(cbp2.target instanceof Promise); @@ -153,7 +153,7 @@ test('far method callbacks', async t => { t.assert(p2r instanceof Promise); t.is(await p2r, '19go'); - /** @type {import('../src/callback').Callback<(c: string) => Promise>} */ + /** @type {import('../src/callback.js').Callback<(c: string) => Promise>} */ const cbp3 = cb.makeMethodCallback(Promise.resolve(o), m2, 9, 10); t.like(cbp3, { methodName: m2, bound: [9, 10] }); t.assert(cbp3.target instanceof Promise); @@ -175,7 +175,7 @@ test('far function callbacks', async t => { */ const f = async (a, b, c) => `${a + b}${c}`; - /** @type {import('../src/callback').Callback<(c: string) => Promise>} */ + /** @type {import('../src/callback.js').Callback<(c: string) => Promise>} */ const cbp2 = cb.makeFunctionCallback(Promise.resolve(f), 9, 10); t.like(cbp2, { bound: [9, 10] }); t.assert(cbp2.target instanceof Promise); diff --git a/packages/network/test/test-network-misc.js b/packages/network/test/test-network-misc.js index 410b70d3769..b10714a0dd8 100644 --- a/packages/network/test/test-network-misc.js +++ b/packages/network/test/test-network-misc.js @@ -18,10 +18,10 @@ const log = false ? console.log : () => {}; /** * @param {any} t - * @returns {import('../src').ProtocolHandler} A testing handler + * @returns {import('../src.js').ProtocolHandler} A testing handler */ const makeProtocolHandler = t => { - /** @type {import('../src').ListenHandler} */ + /** @type {import('../src.js').ListenHandler} */ let l; let lp; let nonce = 0; @@ -109,7 +109,7 @@ test('protocol connection listen', async t => { const port = await protocol.bind('/net/ordered/ordered/some-portname'); - /** @type {import('../src').ListenHandler} */ + /** @type {import('../src.js').ListenHandler} */ const listener = Far('listener', { async onListen(p, listenHandler) { t.is(p, port, `port is tracked in onListen`); @@ -193,7 +193,7 @@ test('loopback protocol', async t => { const port = await protocol.bind('/loopback/foo'); - /** @type {import('../src').ListenHandler} */ + /** @type {import('../src.js').ListenHandler} */ const listener = Far('listener', { async onAccept(_p, _localAddr, _remoteAddr, _listenHandler) { return harden({ diff --git a/packages/pegasus/test/test-peg.js b/packages/pegasus/test/test-peg.js index dfb86e70fbd..cbd574d7c09 100644 --- a/packages/pegasus/test/test-peg.js +++ b/packages/pegasus/test/test-peg.js @@ -73,7 +73,7 @@ async function testRemotePeg(t) { ); /** - * @type {import('../src/pegasus').Pegasus} + * @type {import('../src/pegasus.js').Pegasus} */ const pegasus = publicAPI; const network = makeNetworkProtocol(makeLoopbackProtocolHandler()); @@ -84,7 +84,7 @@ async function testRemotePeg(t) { /** * Pretend we're Gaia. * - * @type {import('@agoric/network/src').Connection?} + * @type {import('@agoric/network/src.js').Connection?} */ let gaiaConnection; E(portP).addListener( diff --git a/packages/smart-wallet/src/invitations.js b/packages/smart-wallet/src/invitations.js index 12d7fccf4c9..a5fcc32557d 100644 --- a/packages/smart-wallet/src/invitations.js +++ b/packages/smart-wallet/src/invitations.js @@ -62,7 +62,7 @@ const MAX_PIPE_LENGTH = 2; * @param {ERef} agoricNames * @param {Brand<'set'>} invitationBrand * @param {Purse<'set'>} invitationsPurse - * @param {(fromOfferId: string) => import('./types').InvitationMakers} getInvitationContinuation + * @param {(fromOfferId: string) => import('./types.js').InvitationMakers} getInvitationContinuation */ export const makeInvitationsHelper = ( zoe, diff --git a/packages/smart-wallet/src/offers.js b/packages/smart-wallet/src/offers.js index 10b4848fa68..72c74a1d2d6 100644 --- a/packages/smart-wallet/src/offers.js +++ b/packages/smart-wallet/src/offers.js @@ -9,7 +9,7 @@ import { makePaymentsHelper } from './payments.js'; /** * @typedef {{ * id: OfferId, - * invitationSpec: import('./invitations').InvitationSpec, + * invitationSpec: import('./invitations.js').InvitationSpec, * proposal: Proposal, * offerArgs?: unknown * }} OfferSpec @@ -35,10 +35,10 @@ export const UNPUBLISHED_RESULT = 'UNPUBLISHED'; * @param {ERef>} opts.invitationIssuer * @param {object} opts.powers * @param {Pick} opts.powers.logger - * @param {(spec: import('./invitations').InvitationSpec) => ERef} opts.powers.invitationFromSpec + * @param {(spec: import('./invitations.js').InvitationSpec) => ERef} opts.powers.invitationFromSpec * @param {(brand: Brand) => Promise} opts.powers.purseForBrand * @param {(status: OfferStatus) => void} opts.onStatusChange - * @param {(offerId: string, invitationAmount: Amount<'set'>, invitationMakers: import('./types').InvitationMakers, publicSubscribers: import('./types').PublicSubscribers | import('@agoric/zoe/src/contractSupport').TopicsRecord ) => Promise} opts.onNewContinuingOffer + * @param {(offerId: string, invitationAmount: Amount<'set'>, invitationMakers: import('./types.js').InvitationMakers, publicSubscribers: import('./types.js').PublicSubscribers | import('@agoric/zoe/src/contractSupport/index.js').TopicsRecord ) => Promise} opts.onNewContinuingOffer */ export const makeOfferExecutor = ({ zoe, diff --git a/packages/smart-wallet/src/smartWallet.js b/packages/smart-wallet/src/smartWallet.js index d7a1f94a145..1c08267c3db 100644 --- a/packages/smart-wallet/src/smartWallet.js +++ b/packages/smart-wallet/src/smartWallet.js @@ -106,7 +106,7 @@ const trace = makeTracer('SmrtWlt'); * brand: Brand, * displayInfo: DisplayInfo, * issuer: Issuer, - * petname: import('./types').Petname + * petname: import('./types.js').Petname * }} BrandDescriptor * For use by clients to describe brands to users. Includes `displayInfo` to save a remote call. */ @@ -114,7 +114,7 @@ const trace = makeTracer('SmrtWlt'); /** * @typedef {{ * address: string, - * bank: ERef, + * bank: ERef, * currentStorageNode: StorageNode, * invitationPurse: Purse<'set'>, * walletStorageNode: StorageNode, @@ -139,7 +139,7 @@ const trace = makeTracer('SmrtWlt'); * * @typedef {Readonly>, - * offerToInvitationMakers: MapStore, + * offerToInvitationMakers: MapStore, * offerToPublicSubscriberPaths: MapStore>, * offerToUsedInvitation: MapStore, * purseBalances: MapStore, @@ -621,7 +621,7 @@ export const prepareSmartWallet = (baggage, shared) => { } } }, - /** @type {(offerId: string, invitationAmount: Amount<'set'>, invitationMakers: import('./types').InvitationMakers, publicSubscribers?: import('./types').PublicSubscribers | import('@agoric/zoe/src/contractSupport').TopicsRecord) => Promise} */ + /** @type {(offerId: string, invitationAmount: Amount<'set'>, invitationMakers: import('./types.js').InvitationMakers, publicSubscribers?: import('./types.js').PublicSubscribers | import('@agoric/zoe/src/contractSupport/index.js').TopicsRecord) => Promise} */ onNewContinuingOffer: async ( offerId, invitationAmount, diff --git a/packages/smart-wallet/src/utils.js b/packages/smart-wallet/src/utils.js index de4758f5bd9..d89155ea8a5 100644 --- a/packages/smart-wallet/src/utils.js +++ b/packages/smart-wallet/src/utils.js @@ -9,7 +9,7 @@ const trace = makeTracer('WUTIL', false); /** @param {Brand<'set'>} [invitationBrand] */ export const makeWalletStateCoalescer = (invitationBrand = undefined) => { - /** @type {Map} */ + /** @type {Map} */ const offerStatuses = new Map(); /** @type {Map} */ const balances = new Map(); @@ -17,11 +17,11 @@ export const makeWalletStateCoalescer = (invitationBrand = undefined) => { /** * keyed by description; xxx assumes unique * - * @type {Map} + * @type {Map} */ const invitationsReceived = new Map(); - /** @param {import('./smartWallet').UpdateRecord | {}} updateRecord newer than previous */ + /** @param {import('./smartWallet.js').UpdateRecord | {}} updateRecord newer than previous */ const update = updateRecord => { if (!('updated' in updateRecord)) { return; @@ -93,7 +93,7 @@ export const makeWalletStateCoalescer = (invitationBrand = undefined) => { * If this proves to be a problem we can add an option to this or a related * utility to reset state from RPC. * - * @param {ERef>} updates + * @param {ERef>} updates * @param {Brand<'set'>} [invitationBrand] */ export const coalesceUpdates = (updates, invitationBrand) => { @@ -125,7 +125,7 @@ export const assertHasData = async follower => { /** * Handles the case of falsy argument so the caller can consistently await. * - * @param {import('./types.js').PublicSubscribers | import('@agoric/zoe/src/contractSupport').TopicsRecord} [subscribers] + * @param {import('./types.js').PublicSubscribers | import('@agoric/zoe/src/contractSupport/index.js').TopicsRecord} [subscribers] * @returns {ERef> | null} */ export const objectMapStoragePath = subscribers => { diff --git a/packages/smart-wallet/src/walletFactory.js b/packages/smart-wallet/src/walletFactory.js index bc9cb0c8c48..2751631f37a 100644 --- a/packages/smart-wallet/src/walletFactory.js +++ b/packages/smart-wallet/src/walletFactory.js @@ -68,7 +68,7 @@ export const makeAssetRegistry = assetPublisher => { * brand: Brand, * displayInfo: DisplayInfo, * issuer: Issuer, - * petname: import('./types').Petname + * petname: import('./types.js').Petname * }} BrandDescriptor * For use by clients to describe brands to users. Includes `displayInfo` to save a remote call. */ @@ -119,12 +119,12 @@ export const makeAssetRegistry = assetPublisher => { * * @typedef {{ * getAssetSubscription: () => ERef< - * IterableEachTopic> + * IterableEachTopic> * }} AssetPublisher * * @typedef {boolean} isRevive * @typedef {{ - * reviveWallet: (address: string) => Promise, + * reviveWallet: (address: string) => Promise, * ackWallet: (address: string) => isRevive, * }} WalletReviver */ @@ -250,16 +250,16 @@ export const prepare = async (zcf, privateArgs, baggage) => { { /** * @param {string} address - * @param {ERef} bank - * @param {ERef} namesByAddressAdmin - * @returns {Promise<[wallet: import('./smartWallet').SmartWallet, isNew: boolean]>} wallet + * @param {ERef} bank + * @param {ERef} namesByAddressAdmin + * @returns {Promise<[wallet: import('./smartWallet.js').SmartWallet, isNew: boolean]>} wallet * along with a flag to distinguish between looking up an existing wallet * and creating a new one. */ provideSmartWallet(address, bank, namesByAddressAdmin) { let isNew = false; - /** @type {(address: string) => Promise} */ + /** @type {(address: string) => Promise} */ const maker = async _address => { const invitationPurse = await E(invitationIssuer).makeEmptyPurse(); const walletStorageNode = E(storageNode).makeChildNode(address); diff --git a/packages/smart-wallet/test/supports.js b/packages/smart-wallet/test/supports.js index 05421bf9b60..2d1546880f4 100644 --- a/packages/smart-wallet/test/supports.js +++ b/packages/smart-wallet/test/supports.js @@ -154,7 +154,7 @@ export const makeMockTestSpace = async log => { }; /** - * @param {ERef<{getPublicTopics: () => import('@agoric/zoe/src/contractSupport').TopicsRecord}>} hasTopics + * @param {ERef<{getPublicTopics: () => import('@agoric/zoe/src/contractSupport/index.js').TopicsRecord}>} hasTopics * @param {string} subscriberName */ export const topicPath = (hasTopics, subscriberName) => { diff --git a/packages/smart-wallet/test/swingsetTests/upgradeWalletFactory/walletFactory-V2.js b/packages/smart-wallet/test/swingsetTests/upgradeWalletFactory/walletFactory-V2.js index dba7ecc5369..f774ea76fa1 100644 --- a/packages/smart-wallet/test/swingsetTests/upgradeWalletFactory/walletFactory-V2.js +++ b/packages/smart-wallet/test/swingsetTests/upgradeWalletFactory/walletFactory-V2.js @@ -110,15 +110,15 @@ export const prepare = async (zcf, privateArgs, baggage) => { { /** * @param {string} address - * @param {ERef} bank - * @param {ERef} namesByAddressAdmin - * @returns {Promise<[import('../../../src/smartWallet').SmartWallet, boolean]>} wallet + * @param {ERef} bank + * @param {ERef} namesByAddressAdmin + * @returns {Promise<[import('../../../src/smartWallet.js').SmartWallet, boolean]>} wallet * along with a flag to distinguish between looking up an existing wallet * and creating a new one. */ provideSmartWallet(address, bank, namesByAddressAdmin) { let makerCalled = false; - /** @type {() => Promise} */ + /** @type {() => Promise} */ const maker = async () => { const invitationPurse = await E(invitationIssuer).makeEmptyPurse(); const walletStorageNode = E(storageNode).makeChildNode(address); diff --git a/packages/swing-store/src/bundleStore.js b/packages/swing-store/src/bundleStore.js index 95f76957ece..fe74b9d53ad 100644 --- a/packages/swing-store/src/bundleStore.js +++ b/packages/swing-store/src/bundleStore.js @@ -15,7 +15,7 @@ import { createSHA256 } from './hasher.js'; * @typedef { EndoZipBase64Bundle | GetExportBundle | NestedEvaluateBundle } Bundle */ /** - * @typedef { import('./exporter').SwingStoreExporter } SwingStoreExporter + * @typedef { import('./exporter.js').SwingStoreExporter } SwingStoreExporter * @typedef { import('./internal.js').ArtifactMode } ArtifactMode * * @typedef {{ diff --git a/packages/swing-store/src/importer.js b/packages/swing-store/src/importer.js index 6bbf8a48ad8..8b13bfbaddb 100644 --- a/packages/swing-store/src/importer.js +++ b/packages/swing-store/src/importer.js @@ -17,10 +17,10 @@ import { assertComplete } from './assertComplete.js'; * returned swingStore is not suitable for execution, and thus only contains * the host facet for committing the populated swingStore. * - * @param {import('./exporter').SwingStoreExporter} exporter + * @param {import('./exporter.js').SwingStoreExporter} exporter * @param {string | null} [dirPath] * @param {ImportSwingStoreOptions} [options] - * @returns {Promise>} + * @returns {Promise>} */ export async function importSwingStore(exporter, dirPath = null, options = {}) { if (dirPath && typeof dirPath !== 'string') { diff --git a/packages/swing-store/src/internal.js b/packages/swing-store/src/internal.js index 18ece829261..890c04b02d3 100644 --- a/packages/swing-store/src/internal.js +++ b/packages/swing-store/src/internal.js @@ -1,9 +1,9 @@ import { Fail, q } from '@agoric/assert'; /** - * @typedef { import('./snapStore').SnapStoreInternal } SnapStoreInternal - * @typedef { import('./transcriptStore').TranscriptStoreInternal } TranscriptStoreInternal - * @typedef { import('./bundleStore').BundleStoreInternal } BundleStoreInternal + * @typedef { import('./snapStore.js').SnapStoreInternal } SnapStoreInternal + * @typedef { import('./transcriptStore.js').TranscriptStoreInternal } TranscriptStoreInternal + * @typedef { import('./bundleStore.js').BundleStoreInternal } BundleStoreInternal * * @typedef {{ * transcriptStore: TranscriptStoreInternal, diff --git a/packages/swing-store/src/repairMetadata.js b/packages/swing-store/src/repairMetadata.js index 8ebc53fc4d7..1e40498c30c 100644 --- a/packages/swing-store/src/repairMetadata.js +++ b/packages/swing-store/src/repairMetadata.js @@ -25,7 +25,7 @@ import { assertComplete } from './assertComplete.js'; * `hostStorage.commit()` when they are ready. * * @param {import('./internal.js').SwingStoreInternal} internal - * @param {import('./exporter').SwingStoreExporter} exporter + * @param {import('./exporter.js').SwingStoreExporter} exporter * @returns {Promise} */ export async function doRepairMetadata(internal, exporter) { diff --git a/packages/swing-store/src/snapStore.js b/packages/swing-store/src/snapStore.js index 4953359bdea..9df9a4a20bb 100644 --- a/packages/swing-store/src/snapStore.js +++ b/packages/swing-store/src/snapStore.js @@ -26,11 +26,11 @@ import { buffer } from './util.js'; /** * @template T - * @typedef { import('./exporter').AnyIterableIterator } AnyIterableIterator + * @typedef { import('./exporter.js').AnyIterableIterator } AnyIterableIterator */ /** - * @typedef { import('./exporter').SwingStoreExporter } SwingStoreExporter + * @typedef { import('./exporter.js').SwingStoreExporter } SwingStoreExporter * @typedef { import('./internal.js').ArtifactMode } ArtifactMode * * @typedef {{ diff --git a/packages/swing-store/src/swingStore.js b/packages/swing-store/src/swingStore.js index 1b488273f22..5fc7c1a4cfe 100644 --- a/packages/swing-store/src/swingStore.js +++ b/packages/swing-store/src/swingStore.js @@ -17,18 +17,18 @@ import { makeSnapStoreIO } from './snapStoreIO.js'; import { doRepairMetadata } from './repairMetadata.js'; /** - * @typedef { import('./kvStore').KVStore } KVStore + * @typedef { import('./kvStore.js').KVStore } KVStore * - * @typedef { import('./snapStore').SnapStore } SnapStore - * @typedef { import('./snapStore').SnapshotResult } SnapshotResult + * @typedef { import('./snapStore.js').SnapStore } SnapStore + * @typedef { import('./snapStore.js').SnapshotResult } SnapshotResult * - * @typedef { import('./transcriptStore').TranscriptStore } TranscriptStore - * @typedef { import('./transcriptStore').TranscriptStoreDebug } TranscriptStoreDebug + * @typedef { import('./transcriptStore.js').TranscriptStore } TranscriptStore + * @typedef { import('./transcriptStore.js').TranscriptStoreDebug } TranscriptStoreDebug * - * @typedef { import('./bundleStore').BundleStore } BundleStore - * @typedef { import('./bundleStore').BundleStoreDebug } BundleStoreDebug + * @typedef { import('./bundleStore.js').BundleStore } BundleStore + * @typedef { import('./bundleStore.js').BundleStoreDebug } BundleStoreDebug * - * @typedef { import('./exporter').KVPair } KVPair + * @typedef { import('./exporter.js').KVPair } KVPair * * @typedef {{ * kvStore: KVStore, // a key-value API object to load and store data on behalf of the kernel @@ -49,7 +49,7 @@ import { doRepairMetadata } from './repairMetadata.js'; * close: () => Promise, // shutdown the store, abandoning any uncommitted changes * diskUsage?: () => number, // optional stats method * setExportCallback: (cb: (updates: KVPair[]) => void) => void, // Set a callback invoked by swingStore when new serializable data is available for export - * repairMetadata: (exporter: import('./exporter').SwingStoreExporter) => Promise, + * repairMetadata: (exporter: import('./exporter.js').SwingStoreExporter) => Promise, * }} SwingStoreHostStorage */ diff --git a/packages/swing-store/src/util.js b/packages/swing-store/src/util.js index f22f974d325..60c224a9693 100644 --- a/packages/swing-store/src/util.js +++ b/packages/swing-store/src/util.js @@ -6,7 +6,7 @@ import { Buffer } from 'buffer'; * 'stream/consumers' package, which unfortunately only exists in newer versions * of Node. * - * @param {import('./exporter').AnyIterable} inStream + * @param {import('./exporter.js').AnyIterable} inStream */ export const buffer = async inStream => { const chunks = []; diff --git a/packages/swingset-liveslots/src/liveslots.js b/packages/swingset-liveslots/src/liveslots.js index 63ea6dd0d50..1474a5d0dd5 100644 --- a/packages/swingset-liveslots/src/liveslots.js +++ b/packages/swingset-liveslots/src/liveslots.js @@ -34,7 +34,7 @@ const { details: X } = assert; * @param {*} syscall Kernel syscall interface that the vat will have access to * @param {*} forVatID Vat ID label, for use in debug diagnostics * @param {*} vatPowers - * @param {import('./types').LiveSlotsOptions} liveSlotsOptions + * @param {import('./types.js').LiveSlotsOptions} liveSlotsOptions * @param {*} gcTools { WeakRef, FinalizationRegistry, waitUntilQuiescent, gcAndFinalize, * meterControl } * @param {Pick} console @@ -1469,7 +1469,7 @@ function build( } /** - * @param {import('./types').VatDeliveryObject} delivery + * @param {import('./types.js').VatDeliveryObject} delivery * @returns {void | Promise} */ function dispatchToUserspace(delivery) { @@ -1534,7 +1534,7 @@ function build( } /** - * @param { import('./types').SwingSetCapData } _disconnectObjectCapData + * @param { import('./types.js').SwingSetCapData } _disconnectObjectCapData * @returns {Promise} */ async function stopVat(_disconnectObjectCapData) { @@ -1586,7 +1586,7 @@ function build( * terminate the vat). Userspace should not be able to cause the delivery * to fail: only a bug in liveslots should trigger a failure. * - * @param {import('./types').VatDeliveryObject} delivery + * @param {import('./types.js').VatDeliveryObject} delivery * @returns {Promise} */ async function dispatch(delivery) { @@ -1637,7 +1637,7 @@ function build( * @param {*} syscall Kernel syscall interface that the vat will have access to * @param {*} forVatID Vat ID label, for use in debug diagostics * @param {*} vatPowers - * @param {import('./types').LiveSlotsOptions} liveSlotsOptions + * @param {import('./types.js').LiveSlotsOptions} liveSlotsOptions * @param {*} gcTools { WeakRef, FinalizationRegistry, waitUntilQuiescent } * @param {Pick} [liveSlotsConsole] * @param {*} [buildVatNamespace] diff --git a/packages/swingset-liveslots/src/message.js b/packages/swingset-liveslots/src/message.js index fabc0e3120f..3da9e83e63f 100644 --- a/packages/swingset-liveslots/src/message.js +++ b/packages/swingset-liveslots/src/message.js @@ -3,7 +3,7 @@ import { insistCapData } from './capdata.js'; /** * @typedef {{ - * methargs: import('./types').SwingSetCapData, // of [method, args] + * methargs: import('./types.js').SwingSetCapData, // of [method, args] * result: string | undefined | null, * }} Message */ diff --git a/packages/swingset-liveslots/src/virtualObjectManager.js b/packages/swingset-liveslots/src/virtualObjectManager.js index 3fc056e0ae9..8a7fa0eabf9 100644 --- a/packages/swingset-liveslots/src/virtualObjectManager.js +++ b/packages/swingset-liveslots/src/virtualObjectManager.js @@ -314,7 +314,7 @@ const insistSameCapData = (oldCD, newCD) => { * @param {import('@endo/marshal').FromCapData} unserialize Unserializer for this vat * @param {*} assertAcceptableSyscallCapdataSize Function to check for oversized * syscall params - * @param {import('./types').LiveSlotsOptions} [liveSlotsOptions] + * @param {import('./types.js').LiveSlotsOptions} [liveSlotsOptions] * @param {{ WeakMap: typeof WeakMap, WeakSet: typeof WeakSet }} [powers] * Specifying the underlying WeakMap/WeakSet objects to wrap with * VirtualObjectAwareWeakMap/Set. By default, capture the ones currently diff --git a/packages/telemetry/src/slog-sender-pipe.js b/packages/telemetry/src/slog-sender-pipe.js index 9c378c75e20..f17b8c859b9 100644 --- a/packages/telemetry/src/slog-sender-pipe.js +++ b/packages/telemetry/src/slog-sender-pipe.js @@ -78,11 +78,11 @@ export const makeSlogSender = async opts => { /** * @typedef {{ * init: { - * message: import('./slog-sender-pipe-entrypoint').InitMessage; + * message: import('./slog-sender-pipe-entrypoint.js').InitMessage; * reply: SlogSenderInitReply; * }; * flush: { - * message: import('./slog-sender-pipe-entrypoint').FlushMessage; + * message: import('./slog-sender-pipe-entrypoint.js').FlushMessage; * reply: SlogSenderFlushReply; * }; * }} SlogSenderWaitMessagesAndReplies diff --git a/packages/time/test/test-timeMath.js b/packages/time/test/test-timeMath.js index 14fc4a12f3e..5b17c835933 100644 --- a/packages/time/test/test-timeMath.js +++ b/packages/time/test/test-timeMath.js @@ -3,11 +3,11 @@ import { Far } from '@endo/far'; import { TimeMath } from '../src/timeMath.js'; /** - * @typedef {import('../src/types').TimerBrand} TimerBrand - * @typedef {import('../src/types').Timestamp} Timestamp - * @typedef {import('../src/types').RelativeTime} RelativeTime - * @typedef {import('../src/types').TimestampValue} TimestampValue - * @typedef {import('../src/types').TimeMathType} TimeMathType + * @typedef {import('../src/types.js').TimerBrand} TimerBrand + * @typedef {import('../src/types.js').Timestamp} Timestamp + * @typedef {import('../src/types.js').RelativeTime} RelativeTime + * @typedef {import('../src/types.js').TimestampValue} TimestampValue + * @typedef {import('../src/types.js').TimeMathType} TimeMathType * */ diff --git a/packages/vats/src/bridge.js b/packages/vats/src/bridge.js index 2bc642c38c5..9de5e59cf09 100644 --- a/packages/vats/src/bridge.js +++ b/packages/vats/src/bridge.js @@ -42,7 +42,7 @@ const prepareScopedManager = zone => { * @param {{ * outbound: (bridgeId: string, obj: unknown) => Promise; * }} toBridge - * @param {import('./types').BridgeHandler} [inboundHandler] + * @param {import('./types.js').BridgeHandler} [inboundHandler] */ (bridgeId, toBridge, inboundHandler) => ({ bridgeId, diff --git a/packages/vats/src/core/basic-behaviors.js b/packages/vats/src/core/basic-behaviors.js index ec0abbc0c7c..ef9812a7cc6 100644 --- a/packages/vats/src/core/basic-behaviors.js +++ b/packages/vats/src/core/basic-behaviors.js @@ -697,7 +697,7 @@ export const addBankAssets = async ({ }; harden(addBankAssets); -/** @type {import('./lib-boot').BootstrapManifest} */ +/** @type {import('./lib-boot.js').BootstrapManifest} */ export const BASIC_BOOTSTRAP_PERMITS = { bridgeCoreEval: true, // Needs all the powers. [makeOracleBrands.name]: { diff --git a/packages/vats/src/core/chain-behaviors.js b/packages/vats/src/core/chain-behaviors.js index f7fd36b92f4..6ed04ee409d 100644 --- a/packages/vats/src/core/chain-behaviors.js +++ b/packages/vats/src/core/chain-behaviors.js @@ -498,7 +498,7 @@ export const connectChainFaucet = async ({ consume: { client } }) => { }; harden(connectChainFaucet); -/** @type {import('./lib-boot').BootstrapManifest} */ +/** @type {import('./lib-boot.js').BootstrapManifest} */ export const SHARED_CHAIN_BOOTSTRAP_MANIFEST = { ...BASIC_BOOTSTRAP_PERMITS, diff --git a/packages/vats/src/core/sim-behaviors.js b/packages/vats/src/core/sim-behaviors.js index bfafac62be6..fd8a1a61d24 100644 --- a/packages/vats/src/core/sim-behaviors.js +++ b/packages/vats/src/core/sim-behaviors.js @@ -39,7 +39,7 @@ export const grantRunBehaviors = async ({ }; harden(grantRunBehaviors); -/** @type {import('./lib-boot').BootstrapManifest} */ +/** @type {import('./lib-boot.js').BootstrapManifest} */ export const SIM_CHAIN_BOOTSTRAP_PERMITS = { [installSimEgress.name]: { vatParameters: { argv: { hardcodedClientAddresses: true } }, diff --git a/packages/vats/src/core/startWalletFactory.js b/packages/vats/src/core/startWalletFactory.js index 2db46c90028..9b04c34227d 100644 --- a/packages/vats/src/core/startWalletFactory.js +++ b/packages/vats/src/core/startWalletFactory.js @@ -17,7 +17,7 @@ const trace = makeTracer('StartWF'); /** * @param {ERef} zoe * @param {Installation< - * import('@agoric/smart-wallet/src/walletFactory').start + * import('@agoric/smart-wallet/src/walletFactory.js').start * >} inst * * @typedef {Awaited>} WalletFactoryStartResult diff --git a/packages/vats/src/core/utils.js b/packages/vats/src/core/utils.js index 31cc6e4f8a9..1150cca0fd6 100644 --- a/packages/vats/src/core/utils.js +++ b/packages/vats/src/core/utils.js @@ -199,7 +199,7 @@ harden(runModuleBehaviors); const noop = harden(() => {}); /** - * @param {ERef} nameAdmin + * @param {ERef} nameAdmin * @param {typeof console.log} [log] */ export const makePromiseSpaceForNameHub = (nameAdmin, log = noop) => { @@ -227,7 +227,7 @@ export const makePromiseSpaceForNameHub = (nameAdmin, log = noop) => { }; /** - * @param {ERef} parentAdmin + * @param {ERef} parentAdmin * @param {typeof console.log} [log] * @param {string[]} [kinds] */ @@ -299,7 +299,7 @@ export const makeMyAddressNameAdminKit = address => { // Create a name hub for this address. const { nameHub, nameAdmin: rawMyAddressNameAdmin } = makeNameHubKit(); - /** @type {import('../types').MyAddressNameAdmin} */ + /** @type {import('../types.js').MyAddressNameAdmin} */ const myAddressNameAdmin = Far('myAddressNameAdmin', { ...rawMyAddressNameAdmin, getMyAddress: () => address, diff --git a/packages/vats/src/nameHub.js b/packages/vats/src/nameHub.js index 505998fbd6d..d06821e2924 100644 --- a/packages/vats/src/nameHub.js +++ b/packages/vats/src/nameHub.js @@ -141,7 +141,7 @@ export const prepareNameHubKit = zone => { /** @param {{}} me */ const my = me => provideWeak(ephemera, me, init1); - /** @type {() => import('./types').NameHubKit} */ + /** @type {() => import('./types.js').NameHubKit} */ const makeNameHubKit = zone.exoClassKit( 'NameHubKit', NameHubIKit, @@ -150,7 +150,7 @@ export const prepareNameHubKit = zone => { /** @type {MapStore} */ keyToValue: zone.detached().mapStore('nameKey'), - /** @type {MapStore} */ + /** @type {MapStore} */ keyToAdmin: zone.detached().mapStore('nameKey'), /** @type {undefined | { write: (item: unknown) => void }} */ diff --git a/packages/vats/src/vat-bank.js b/packages/vats/src/vat-bank.js index 31385e3e658..d0d0ffa0a9a 100644 --- a/packages/vats/src/vat-bank.js +++ b/packages/vats/src/vat-bank.js @@ -33,7 +33,7 @@ const BridgeChannelI = M.interface('BridgeChannel', { }); /** - * @typedef {import('./virtual-purse').VirtualPurseController} VirtualPurseController + * @typedef {import('./virtual-purse.js').VirtualPurseController} VirtualPurseController * * @typedef {Awaited>>} VirtualPurse */ diff --git a/packages/vats/src/vat-provisioning.js b/packages/vats/src/vat-provisioning.js index 3caa07b915d..8db80b8e59a 100644 --- a/packages/vats/src/vat-provisioning.js +++ b/packages/vats/src/vat-provisioning.js @@ -56,7 +56,7 @@ const prepareSpecializedNameAdmin = zone => { // XXX relies on callers not to provide other admins via update() // TODO: enforce? - /** @type {import('./types').MyAddressNameAdmin} */ + /** @type {import('./types.js').MyAddressNameAdmin} */ // eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error // @ts-ignore cast const myAdmin = nameAdmin.lookupAdmin(address); diff --git a/packages/vats/test/test-bootstrapPayment.js b/packages/vats/test/test-bootstrapPayment.js index 933841611ca..e3555282816 100644 --- a/packages/vats/test/test-bootstrapPayment.js +++ b/packages/vats/test/test-bootstrapPayment.js @@ -12,7 +12,7 @@ import { feeIssuerConfig } from '../src/core/utils.js'; /** * @template T @typedef - * {import('@agoric/zoe/src/zoeService/utils').Installation} + * {import('@agoric/zoe/src/zoeService/utils.js').Installation} * Installation */ /** diff --git a/packages/vats/test/test-vpurse.js b/packages/vats/test/test-vpurse.js index c7a71782564..053e65e06cc 100644 --- a/packages/vats/test/test-vpurse.js +++ b/packages/vats/test/test-vpurse.js @@ -54,7 +54,7 @@ const setup = (t, zone, escrowValue = 0n) => { }, }); - /** @type {import('../src/virtual-purse').VirtualPurseController} */ + /** @type {import('../src/virtual-purse.js').VirtualPurseController} */ const vpcontroller = zone.exo('TestController', undefined, { getBalances(b) { t.is(b, brand); diff --git a/packages/wallet/api/src/internal-types.js b/packages/wallet/api/src/internal-types.js index 8d52b33a1b4..5a65ad08e07 100644 --- a/packages/wallet/api/src/internal-types.js +++ b/packages/wallet/api/src/internal-types.js @@ -7,7 +7,7 @@ * @property {PurseActions} actions */ -/** @typedef {import('@agoric/deploy-script-support/src/externalTypes').Petname} Petname */ +/** @typedef {import('@agoric/deploy-script-support/src/externalTypes.js').Petname} Petname */ /** * @typedef {PursesJSONState & PursesAddedState} PursesFullState @@ -93,6 +93,6 @@ * would make them part of the WalletUser available as `home.wallet` in the * REPL. Then, the Wallet UI could use that instead. * - * @typedef {import('./lib-wallet').WalletRoot['admin']} + * @typedef {import('./lib-wallet.js').WalletRoot['admin']} * WalletAdminFacet */ diff --git a/packages/xsnap/src/avaAssertXS.js b/packages/xsnap/src/avaAssertXS.js index beff7c15c64..dcb11614fcc 100644 --- a/packages/xsnap/src/avaAssertXS.js +++ b/packages/xsnap/src/avaAssertXS.js @@ -66,7 +66,7 @@ function deepDifference(x, y) { * @param {(msg: TapMessage) => void} send * * @typedef { ReturnType } TapFormat - * @typedef {import('./avaXS').TapMessage} TapMessage + * @typedef {import('./avaXS.js').TapMessage} TapMessage */ function tapFormat(send) { return freeze({ diff --git a/packages/xsnap/src/avaXS.js b/packages/xsnap/src/avaXS.js index dd6cdd9db91..e3962fcd311 100644 --- a/packages/xsnap/src/avaXS.js +++ b/packages/xsnap/src/avaXS.js @@ -91,7 +91,7 @@ function isMatch(specimen, pattern) { * * @typedef {{ total: number, pass: number, fail: { filename: string, name: string }[] }} TestResults * @typedef { 'ok' | 'not ok' | 'SKIP' } Status - * @typedef {ReturnType} XSnap + * @typedef {ReturnType} XSnap */ async function runTestScript( filename, diff --git a/packages/xsnap/src/xsnap.js b/packages/xsnap/src/xsnap.js index 4cccd30b6dc..d2b46e95755 100644 --- a/packages/xsnap/src/xsnap.js +++ b/packages/xsnap/src/xsnap.js @@ -9,7 +9,7 @@ /** * @template T - * @typedef {import('./defer').Deferred} Deferred + * @typedef {import('./defer.js').Deferred} Deferred */ import { finished } from 'stream/promises'; diff --git a/packages/xsnap/src/xsrepl.js b/packages/xsnap/src/xsrepl.js index 45369109a1b..abfa02c8baa 100755 --- a/packages/xsnap/src/xsrepl.js +++ b/packages/xsnap/src/xsrepl.js @@ -7,7 +7,7 @@ import '@endo/init'; /** * @template T - * @typedef {import('./defer').Deferred} Deferred + * @typedef {import('./defer.js').Deferred} Deferred */ import * as childProcess from 'child_process'; import fs from 'fs'; diff --git a/packages/zoe/src/zoeService/internal-types.js b/packages/zoe/src/zoeService/internal-types.js index b661dfde644..fbf1938a2e4 100644 --- a/packages/zoe/src/zoeService/internal-types.js +++ b/packages/zoe/src/zoeService/internal-types.js @@ -133,7 +133,7 @@ * @property {import('./utils.js').GetPublicFacet} getPublicFacet * @property {GetBrands} getBrands * @property {GetIssuers} getIssuers - * @property {import('./utils').GetTerms} getTerms + * @property {import('./utils.js').GetTerms} getTerms * @property {GetOfferFilter} getOfferFilter * @property {SetOfferFilter} setOfferFilter * @property {GetInstallationForInstance} getInstallationForInstance diff --git a/packages/zoe/src/zoeService/startInstance.js b/packages/zoe/src/zoeService/startInstance.js index 518e134d8f8..03b0a2a7c2c 100644 --- a/packages/zoe/src/zoeService/startInstance.js +++ b/packages/zoe/src/zoeService/startInstance.js @@ -23,7 +23,7 @@ const { Fail, quote: q } = assert; * @param {() => ERef} getZcfBundleCapP * @param {(id: string) => BundleCap} getBundleCapByIdNow * @param {Baggage} zoeBaggage - * @returns {import('./utils').StartInstance} + * @returns {import('./utils.js').StartInstance} */ export const makeStartInstance = ( startInstanceAccess, diff --git a/packages/zoe/src/zoeService/types.js b/packages/zoe/src/zoeService/types.js index 7ca1c8d5d63..0f61ae80fad 100644 --- a/packages/zoe/src/zoeService/types.js +++ b/packages/zoe/src/zoeService/types.js @@ -28,12 +28,12 @@ * * @property {InstallBundle} install * @property {InstallBundleID} installBundleID - * @property {import('./utils').StartInstance} startInstance + * @property {import('./utils.js').StartInstance} startInstance * @property {Offer} offer - * @property {import('./utils').GetPublicFacet} getPublicFacet + * @property {import('./utils.js').GetPublicFacet} getPublicFacet * @property {GetIssuers} getIssuers * @property {GetBrands} getBrands - * @property {import('./utils').GetTerms} getTerms + * @property {import('./utils.js').GetTerms} getTerms * @property {GetOfferFilter} getOfferFilter * @property {GetInstallationForInstance} getInstallationForInstance * @property {GetInstance} getInstance @@ -66,19 +66,19 @@ /** * @callback GetIssuers - * @param {import('./utils').Instance} instance + * @param {import('./utils.js').Instance} instance * @returns {Promise} */ /** * @callback GetBrands - * @param {import('./utils').Instance} instance + * @param {import('./utils.js').Instance} instance * @returns {Promise} */ /** * @callback GetOfferFilter - * @param {import('./utils').Instance} instance + * @param {import('./utils.js').Instance} instance * @returns {string[]} */ @@ -90,14 +90,14 @@ /** * @callback GetInstallationForInstance - * @param {import('./utils').Instance} instance + * @param {import('./utils.js').Instance} instance * @returns {Promise} */ /** * @callback GetInstance * @param {ERef} invitation - * @returns {Promise>} + * @returns {Promise>} */ /** @@ -271,7 +271,7 @@ */ /** - * @typedef {import('./utils').Instance} Instance + * @typedef {import('./utils.js').Instance} Instance */ /** @@ -295,7 +295,7 @@ /** * @typedef {object} InvitationDetails * @property {Installation} installation - * @property {import('./utils').Instance} instance + * @property {import('./utils.js').Instance} instance * @property {InvitationHandle} handle * @property {string} description * @property {Record} [customDetails] @@ -303,12 +303,12 @@ /** * @template [SF=any] contract start function - * @typedef {import('./utils').Installation} Installation + * @typedef {import('./utils.js').Installation} Installation */ /** * @template {Installation} I - * @typedef {import('./utils').InstallationStart} InstallationStart + * @typedef {import('./utils.js').InstallationStart} InstallationStart */ /** diff --git a/packages/zoe/test/unitTests/test-zoe.js b/packages/zoe/test/unitTests/test-zoe.js index ab704870417..2ceaaf2fe1c 100644 --- a/packages/zoe/test/unitTests/test-zoe.js +++ b/packages/zoe/test/unitTests/test-zoe.js @@ -105,7 +105,7 @@ test(`E(zoe).getPublicFacet`, async t => { const contractPath = `${dirname}/../../src/contracts/automaticRefund`; const bundle = await bundleSource(contractPath); vatAdminState.installBundle('b1-refund', bundle); - /** @type {Installation} */ + /** @type {Installation} */ const installation = await E(zoe).installBundleID('b1-refund'); const { publicFacet, instance } = await E(zoe).startInstance(installation); await t.throwsAsync(() => @@ -235,7 +235,7 @@ test(`zoe.getTerms`, async t => { const contractPath = `${dirname}/../../src/contracts/automaticRefund`; const bundle = await bundleSource(contractPath); vatAdminState.installBundle('b1-refund', bundle); - /** @type {Installation} */ + /** @type {Installation} */ const installation = await E(zoe).installBundleID('b1-refund'); const { instance } = await E(zoe).startInstance( installation, From cffa8c0a23726dc3a99802812a461df4e131cfef Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Fri, 8 Dec 2023 13:01:26 -0800 Subject: [PATCH 42/58] fix(time): Export top-level types --- packages/inter-protocol/src/price/fluxAggregatorKit.js | 4 ++-- packages/time/package.json | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/inter-protocol/src/price/fluxAggregatorKit.js b/packages/inter-protocol/src/price/fluxAggregatorKit.js index 910f060d489..39601167799 100644 --- a/packages/inter-protocol/src/price/fluxAggregatorKit.js +++ b/packages/inter-protocol/src/price/fluxAggregatorKit.js @@ -27,8 +27,8 @@ export const INVITATION_MAKERS_DESC = 'oracle invitation'; * * @typedef {import('@agoric/time').Timestamp} Timestamp * - * @typedef {import('@agoric/time').RelativeTime} RelativeTime // - * TODO: use RelativeTime, not RelativeTimeValue + * @typedef {import('@agoric/time').RelativeTime} RelativeTime // TODO: use + * RelativeTime, not RelativeTimeValue * * @typedef {import('@agoric/time').RelativeTimeValue} RelativeTimeValue * diff --git a/packages/time/package.json b/packages/time/package.json index 2ae3dd423db..c44b6b2879d 100644 --- a/packages/time/package.json +++ b/packages/time/package.json @@ -4,6 +4,7 @@ "description": "Timestamps, time math, timer service API definition", "type": "module", "main": "index.js", + "types": "index.js", "engines": { "node": ">=14.15.0" }, From 014fb5ba6fb997bb408eaa31a87fc95f2fac16fe Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Fri, 8 Dec 2023 16:08:41 -0800 Subject: [PATCH 43/58] fix(zone): Ignore type error that occurrs only integration with vats --- packages/zone/src/durable.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/zone/src/durable.js b/packages/zone/src/durable.js index 22cfe4b733a..a8460f43935 100644 --- a/packages/zone/src/durable.js +++ b/packages/zone/src/durable.js @@ -89,6 +89,10 @@ export const makeDurableZone = (baggage, baseLabel = 'durableZone') => { /** @type {import('.').Zone['exoClass']} */ const exoClass = (...args) => prepareExoClass(baggage, ...args); /** @type {import('.').Zone['exoClassKit']} */ + // @ts-ignore This type check regressed inexplicably with the release + // following after @endo/exo@0.2.6. + // The lint error does not occur in local lint, but does in integration with + // @agoric/vats, so can not be suppressed with ts-expect-error. const exoClassKit = (...args) => prepareExoClassKit(baggage, ...args); /** @type {import('.').Zone['exo']} */ const exo = (...args) => prepareExo(baggage, ...args); From 3844fcc9dc6eb386c75f6f20d0a4c562af6342b8 Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Wed, 20 Dec 2023 13:33:52 -0800 Subject: [PATCH 44/58] chore: Sync Endo versions --- package.json | 2 +- packages/ERTP/package.json | 14 ++++---- packages/SwingSet/package.json | 32 +++++++++---------- packages/agoric-cli/package.json | 18 +++++------ packages/assert/package.json | 2 +- packages/base-zone/package.json | 10 +++--- packages/benchmark/package.json | 2 +- packages/boot/package.json | 16 +++++----- packages/builders/package.json | 16 +++++----- packages/cache/package.json | 4 +-- packages/casting/package.json | 12 +++---- packages/cosmic-swingset/package.json | 14 ++++---- packages/deploy-script-support/package.json | 16 +++++----- packages/deployment/package.json | 4 +-- packages/eslint-config/package.json | 2 +- packages/governance/package.json | 18 +++++------ packages/inter-protocol/package.json | 18 +++++------ packages/internal/package.json | 14 ++++---- packages/kmarshal/package.json | 4 +-- packages/network/package.json | 8 ++--- packages/notifier/package.json | 12 +++---- packages/pegasus/package.json | 12 +++---- packages/same-structure/package.json | 2 +- packages/smart-wallet/package.json | 16 +++++----- packages/solo/package.json | 14 ++++---- packages/spawner/package.json | 10 +++--- packages/store/package.json | 12 +++---- packages/swing-store/package.json | 10 +++--- packages/swingset-liveslots/package.json | 18 +++++------ packages/swingset-runner/package.json | 10 +++--- .../swingset-xsnap-supervisor/package.json | 8 ++--- packages/telemetry/package.json | 10 +++--- packages/time/package.json | 8 ++--- packages/vat-data/package.json | 4 +-- packages/vats/package.json | 16 +++++----- packages/wallet/api/package.json | 14 ++++---- packages/xsnap-lockdown/package.json | 4 +-- packages/xsnap/package.json | 16 +++++----- packages/zoe/package.json | 20 ++++++------ packages/zone/package.json | 6 ++-- 40 files changed, 224 insertions(+), 224 deletions(-) diff --git a/package.json b/package.json index 89316fbd9f5..1dd9e06b3d9 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "type": "module", "packageManager": "yarn@1.22.19", "devDependencies": { - "@endo/eslint-plugin": "^0.5.1", + "@endo/eslint-plugin": "^2.0.0", "@jessie.js/eslint-plugin": "^0.4.0", "@types/express": "^4.17.17", "@types/node": "^16.13.0", diff --git a/packages/ERTP/package.json b/packages/ERTP/package.json index 0fb9f53e104..301dfb70ad2 100644 --- a/packages/ERTP/package.json +++ b/packages/ERTP/package.json @@ -43,16 +43,16 @@ "@agoric/notifier": "^0.6.2", "@agoric/store": "^0.9.2", "@agoric/vat-data": "^0.5.2", - "@endo/eventual-send": "^0.17.5", - "@endo/far": "^0.2.21", - "@endo/marshal": "^0.8.8", - "@endo/nat": "^4.1.30", - "@endo/patterns": "^0.2.5", - "@endo/promise-kit": "^0.2.59" + "@endo/eventual-send": "^1.0.1", + "@endo/far": "^1.0.1", + "@endo/marshal": "^1.0.1", + "@endo/nat": "^5.0.1", + "@endo/patterns": "^1.0.1", + "@endo/promise-kit": "^1.0.1" }, "devDependencies": { "@agoric/swingset-vat": "^0.32.2", - "@endo/bundle-source": "^2.7.0", + "@endo/bundle-source": "^3.0.1", "@fast-check/ava": "^1.1.5", "ava": "^5.3.0", "tsd": "^0.28.1" diff --git a/packages/SwingSet/package.json b/packages/SwingSet/package.json index cb9a7ab6688..a54b1fb7191 100644 --- a/packages/SwingSet/package.json +++ b/packages/SwingSet/package.json @@ -38,22 +38,22 @@ "@agoric/vat-data": "^0.5.2", "@agoric/xsnap": "^0.14.2", "@agoric/xsnap-lockdown": "^0.14.0", - "@endo/base64": "^0.2.34", - "@endo/bundle-source": "^2.7.0", - "@endo/captp": "^3.1.4", - "@endo/check-bundle": "^0.2.21", - "@endo/compartment-mapper": "^0.9.1", - "@endo/eventual-send": "^0.17.5", - "@endo/far": "^0.2.21", - "@endo/import-bundle": "^0.4.1", - "@endo/init": "^0.5.59", - "@endo/marshal": "^0.8.8", - "@endo/nat": "^4.1.30", - "@endo/patterns": "^0.2.5", - "@endo/promise-kit": "^0.2.59", - "@endo/ses-ava": "^0.2.43", - "@endo/stream": "^0.3.28", - "@endo/zip": "^0.2.34", + "@endo/base64": "^1.0.0", + "@endo/bundle-source": "^3.0.1", + "@endo/captp": "^4.0.1", + "@endo/check-bundle": "^1.0.1", + "@endo/compartment-mapper": "^1.0.1", + "@endo/eventual-send": "^1.0.1", + "@endo/far": "^1.0.1", + "@endo/import-bundle": "^1.0.1", + "@endo/init": "^1.0.1", + "@endo/marshal": "^1.0.1", + "@endo/nat": "^5.0.1", + "@endo/patterns": "^1.0.1", + "@endo/promise-kit": "^1.0.1", + "@endo/ses-ava": "^1.0.1", + "@endo/stream": "^1.0.1", + "@endo/zip": "^1.0.0", "ansi-styles": "^6.2.1", "anylogger": "^0.21.0", "better-sqlite3": "^9.1.1", diff --git a/packages/agoric-cli/package.json b/packages/agoric-cli/package.json index 1b1d2eeccff..07051578283 100644 --- a/packages/agoric-cli/package.json +++ b/packages/agoric-cli/package.json @@ -57,15 +57,15 @@ "@cosmjs/math": "^0.30.1", "@cosmjs/proto-signing": "^0.30.1", "@cosmjs/stargate": "^0.30.1", - "@endo/bundle-source": "^2.7.0", - "@endo/captp": "^3.1.4", - "@endo/compartment-mapper": "^0.9.1", - "@endo/far": "^0.2.21", - "@endo/init": "^0.5.59", - "@endo/marshal": "^0.8.8", - "@endo/nat": "^4.1.30", - "@endo/patterns": "^0.2.6", - "@endo/promise-kit": "^0.2.59", + "@endo/bundle-source": "^3.0.1", + "@endo/captp": "^4.0.1", + "@endo/compartment-mapper": "^1.0.1", + "@endo/far": "^1.0.1", + "@endo/init": "^1.0.1", + "@endo/marshal": "^1.0.1", + "@endo/nat": "^5.0.1", + "@endo/patterns": "^1.0.1", + "@endo/promise-kit": "^1.0.1", "@iarna/toml": "^2.2.3", "anylogger": "^0.21.0", "chalk": "^5.2.0", diff --git a/packages/assert/package.json b/packages/assert/package.json index f95a9635516..9879e5d6c33 100755 --- a/packages/assert/package.json +++ b/packages/assert/package.json @@ -18,7 +18,7 @@ "lint:types": "tsc" }, "devDependencies": { - "@endo/init": "^0.5.59", + "@endo/init": "^1.0.1", "ava": "^5.3.0" }, "ava": { diff --git a/packages/base-zone/package.json b/packages/base-zone/package.json index 5173dd415d6..58238e29e43 100644 --- a/packages/base-zone/package.json +++ b/packages/base-zone/package.json @@ -27,13 +27,13 @@ "license": "Apache-2.0", "dependencies": { "@agoric/store": "^0.9.2", - "@endo/exo": "^0.2.5", - "@endo/far": "^0.2.21", - "@endo/pass-style": "^0.1.6", - "@endo/patterns": "^0.2.5" + "@endo/exo": "^1.0.1", + "@endo/far": "^1.0.1", + "@endo/pass-style": "^1.0.1", + "@endo/patterns": "^1.0.1" }, "devDependencies": { - "@endo/init": "^0.5.59", + "@endo/init": "^1.0.1", "ava": "^5.3.0" }, "publishConfig": { diff --git a/packages/benchmark/package.json b/packages/benchmark/package.json index d0ac7f9484d..f50276be471 100644 --- a/packages/benchmark/package.json +++ b/packages/benchmark/package.json @@ -29,7 +29,7 @@ "@agoric/inter-protocol": "^0.16.1", "@agoric/vats": "^0.15.1", "@agoric/zoe": "^0.26.2", - "@endo/init": "^0.5.59" + "@endo/init": "^1.0.1" }, "devDependencies": {}, "files": [ diff --git a/packages/boot/package.json b/packages/boot/package.json index 8c0e269bf9a..04057d845e7 100644 --- a/packages/boot/package.json +++ b/packages/boot/package.json @@ -33,14 +33,14 @@ "@agoric/vats": "^0.15.1", "@agoric/vm-config": "^0.1.0", "@agoric/zoe": "^0.26.2", - "@endo/marshal": "^0.8.8", - "@endo/bundle-source": "^2.7.0", - "@endo/captp": "^3.1.4", - "@endo/eventual-send": "^0.17.5", - "@endo/init": "^0.5.59", - "@endo/far": "^0.2.21", - "@endo/promise-kit": "^0.2.59", - "@endo/stream": "^0.3.28", + "@endo/marshal": "^1.0.1", + "@endo/bundle-source": "^3.0.1", + "@endo/captp": "^4.0.1", + "@endo/eventual-send": "^1.0.1", + "@endo/init": "^1.0.1", + "@endo/far": "^1.0.1", + "@endo/promise-kit": "^1.0.1", + "@endo/stream": "^1.0.1", "import-meta-resolve": "^2.2.1" }, "devDependencies": { diff --git a/packages/builders/package.json b/packages/builders/package.json index c4960efe864..8c125767897 100644 --- a/packages/builders/package.json +++ b/packages/builders/package.json @@ -32,14 +32,14 @@ "@agoric/vat-data": "^0.5.2", "@agoric/vats": "^0.15.1", "@agoric/zoe": "^0.26.2", - "@endo/bundle-source": "^2.7.0", - "@endo/captp": "^3.1.4", - "@endo/eventual-send": "^0.17.5", - "@endo/far": "^0.2.21", - "@endo/init": "^0.5.59", - "@endo/marshal": "^0.8.8", - "@endo/promise-kit": "^0.2.59", - "@endo/stream": "^0.3.28", + "@endo/bundle-source": "^3.0.1", + "@endo/captp": "^4.0.1", + "@endo/eventual-send": "^1.0.1", + "@endo/far": "^1.0.1", + "@endo/init": "^1.0.1", + "@endo/marshal": "^1.0.1", + "@endo/promise-kit": "^1.0.1", + "@endo/stream": "^1.0.1", "import-meta-resolve": "^2.2.1" }, "devDependencies": { diff --git a/packages/cache/package.json b/packages/cache/package.json index d17b2632aff..284520d970b 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -23,8 +23,8 @@ "@agoric/notifier": "^0.6.2", "@agoric/store": "^0.9.2", "@agoric/vat-data": "^0.5.2", - "@endo/far": "^0.2.21", - "@endo/marshal": "^0.8.8" + "@endo/far": "^1.0.1", + "@endo/marshal": "^1.0.1" }, "devDependencies": { "@agoric/zoe": "^0.26.2", diff --git a/packages/casting/package.json b/packages/casting/package.json index f62939568ce..49b4d639518 100644 --- a/packages/casting/package.json +++ b/packages/casting/package.json @@ -30,16 +30,16 @@ "@cosmjs/proto-signing": "^0.30.1", "@cosmjs/stargate": "^0.30.1", "@cosmjs/tendermint-rpc": "^0.30.1", - "@endo/far": "^0.2.21", - "@endo/init": "^0.5.59", - "@endo/lockdown": "^0.1.31", - "@endo/marshal": "^0.8.8", - "@endo/promise-kit": "^0.2.59", + "@endo/far": "^1.0.1", + "@endo/init": "^1.0.1", + "@endo/lockdown": "^1.0.1", + "@endo/marshal": "^1.0.1", + "@endo/promise-kit": "^1.0.1", "node-fetch": "^2.6.0" }, "devDependencies": { "@agoric/cosmic-proto": "^0.3.0", - "@endo/ses-ava": "^0.2.43", + "@endo/ses-ava": "^1.0.1", "@types/node-fetch": "^2.6.2", "ava": "^5.3.0", "c8": "^7.13.0", diff --git a/packages/cosmic-swingset/package.json b/packages/cosmic-swingset/package.json index 627156322c2..ae8f557f1d5 100644 --- a/packages/cosmic-swingset/package.json +++ b/packages/cosmic-swingset/package.json @@ -32,13 +32,13 @@ "@agoric/swingset-vat": "^0.32.2", "@agoric/telemetry": "^0.6.2", "@agoric/vm-config": "^0.1.0", - "@endo/bundle-source": "^2.7.0", - "@endo/far": "^0.2.21", - "@endo/import-bundle": "^0.4.1", - "@endo/init": "^0.5.59", - "@endo/marshal": "^0.8.8", - "@endo/nat": "^4.1.30", - "@endo/promise-kit": "^0.2.59", + "@endo/bundle-source": "^3.0.1", + "@endo/far": "^1.0.1", + "@endo/import-bundle": "^1.0.1", + "@endo/init": "^1.0.1", + "@endo/marshal": "^1.0.1", + "@endo/nat": "^5.0.1", + "@endo/promise-kit": "^1.0.1", "@iarna/toml": "^2.2.3", "@opentelemetry/sdk-metrics": "~1.9.0", "@opentelemetry/api": "~1.3.0", diff --git a/packages/deploy-script-support/package.json b/packages/deploy-script-support/package.json index 5dcd55eafb3..5cb257d78d4 100644 --- a/packages/deploy-script-support/package.json +++ b/packages/deploy-script-support/package.json @@ -42,17 +42,17 @@ "@agoric/store": "^0.9.2", "@agoric/time": "^0.3.2", "@agoric/zoe": "^0.26.2", - "@endo/base64": "^0.2.34", - "@endo/bundle-source": "^2.7.0", - "@endo/far": "^0.2.21", - "@endo/marshal": "^0.8.8", - "@endo/nat": "^4.1.30", - "@endo/promise-kit": "^0.2.59", - "@endo/zip": "^0.2.34" + "@endo/base64": "^1.0.0", + "@endo/bundle-source": "^3.0.1", + "@endo/far": "^1.0.1", + "@endo/marshal": "^1.0.1", + "@endo/nat": "^5.0.1", + "@endo/promise-kit": "^1.0.1", + "@endo/zip": "^1.0.0" }, "devDependencies": { "@agoric/vats": "^0.15.1", - "@endo/init": "^0.5.59", + "@endo/init": "^1.0.1", "ava": "^5.3.0", "import-meta-resolve": "^2.2.1" }, diff --git a/packages/deployment/package.json b/packages/deployment/package.json index 002bc92c6a6..abd4f5eaebd 100644 --- a/packages/deployment/package.json +++ b/packages/deployment/package.json @@ -20,8 +20,8 @@ "license": "Apache-2.0", "dependencies": { "@agoric/assert": "^0.6.0", - "@endo/init": "^0.5.59", - "@endo/marshal": "^0.8.8", + "@endo/init": "^1.0.1", + "@endo/marshal": "^1.0.1", "better-sqlite3": "^9.1.1", "chalk": "^5.2.0", "deterministic-json": "^1.0.5", diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 2e735eb6f8a..a45c8368f6b 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -25,7 +25,7 @@ "eslint-config.*" ], "peerDependencies": { - "@endo/eslint-plugin": "^0.5.1", + "@endo/eslint-plugin": "^2.0.0", "@jessie.js/eslint-plugin": "^0.4.0", "@typescript-eslint/eslint-plugin": "^6.13.2", "@typescript-eslint/parser": "^6.13.2", diff --git a/packages/governance/package.json b/packages/governance/package.json index 0da53fc5ab0..f45e3d6bd57 100644 --- a/packages/governance/package.json +++ b/packages/governance/package.json @@ -40,19 +40,19 @@ "@agoric/time": "^0.3.2", "@agoric/vat-data": "^0.5.2", "@agoric/zoe": "^0.26.2", - "@endo/bundle-source": "^2.7.0", - "@endo/captp": "^3.1.4", - "@endo/eventual-send": "^0.17.5", - "@endo/far": "^0.2.21", - "@endo/marshal": "^0.8.8", - "@endo/nat": "^4.1.30", - "@endo/promise-kit": "^0.2.59", + "@endo/bundle-source": "^3.0.1", + "@endo/captp": "^4.0.1", + "@endo/eventual-send": "^1.0.1", + "@endo/far": "^1.0.1", + "@endo/marshal": "^1.0.1", + "@endo/nat": "^5.0.1", + "@endo/promise-kit": "^1.0.1", "import-meta-resolve": "^2.2.1" }, "devDependencies": { "@agoric/swingset-vat": "^0.32.2", - "@endo/bundle-source": "^2.7.0", - "@endo/init": "^0.5.59", + "@endo/bundle-source": "^3.0.1", + "@endo/init": "^1.0.1", "ava": "^5.3.0", "c8": "^7.13.0" }, diff --git a/packages/inter-protocol/package.json b/packages/inter-protocol/package.json index 5d88e536104..722259a384c 100644 --- a/packages/inter-protocol/package.json +++ b/packages/inter-protocol/package.json @@ -41,12 +41,12 @@ "@agoric/vat-data": "^0.5.2", "@agoric/vats": "^0.15.1", "@agoric/zoe": "^0.26.2", - "@endo/captp": "^3.1.4", - "@endo/eventual-send": "^0.17.5", - "@endo/far": "^0.2.21", - "@endo/marshal": "^0.8.8", - "@endo/nat": "^4.1.30", - "@endo/promise-kit": "^0.2.59", + "@endo/captp": "^4.0.1", + "@endo/eventual-send": "^1.0.1", + "@endo/far": "^1.0.1", + "@endo/marshal": "^1.0.1", + "@endo/nat": "^5.0.1", + "@endo/promise-kit": "^1.0.1", "jessie.js": "^0.3.2" }, "devDependencies": { @@ -54,9 +54,9 @@ "@agoric/swingset-liveslots": "^0.10.2", "@agoric/swingset-vat": "^0.32.2", "@agoric/zone": "^0.2.2", - "@endo/bundle-source": "^2.7.0", - "@endo/init": "^0.5.59", - "@endo/promise-kit": "^0.2.59", + "@endo/bundle-source": "^3.0.1", + "@endo/init": "^1.0.1", + "@endo/promise-kit": "^1.0.1", "@fast-check/ava": "^1.1.5", "ava": "^5.3.0", "c8": "^7.13.0", diff --git a/packages/internal/package.json b/packages/internal/package.json index c4cef0a9aa5..96cfe7c9344 100755 --- a/packages/internal/package.json +++ b/packages/internal/package.json @@ -22,17 +22,17 @@ "dependencies": { "@agoric/assert": "^0.6.0", "@agoric/base-zone": "^0.1.0", - "@endo/far": "^0.2.21", - "@endo/init": "^0.5.59", - "@endo/marshal": "^0.8.8", - "@endo/patterns": "^0.2.5", - "@endo/promise-kit": "^0.2.59", - "@endo/stream": "^0.3.28", + "@endo/far": "^1.0.1", + "@endo/init": "^1.0.1", + "@endo/marshal": "^1.0.1", + "@endo/patterns": "^1.0.1", + "@endo/promise-kit": "^1.0.1", + "@endo/stream": "^1.0.1", "anylogger": "^0.21.0", "jessie.js": "^0.3.2" }, "devDependencies": { - "@endo/init": "^0.5.59", + "@endo/init": "^1.0.1", "ava": "^5.3.0", "tsd": "^0.28.1" }, diff --git a/packages/kmarshal/package.json b/packages/kmarshal/package.json index 493c73f7443..d6b6df75c9d 100644 --- a/packages/kmarshal/package.json +++ b/packages/kmarshal/package.json @@ -21,8 +21,8 @@ "lint:eslint": "eslint ." }, "dependencies": { - "@endo/far": "^0.2.21", - "@endo/marshal": "^0.8.8", + "@endo/far": "^1.0.1", + "@endo/marshal": "^1.0.1", "@agoric/assert": "^0.6.0" }, "devDependencies": { diff --git a/packages/network/package.json b/packages/network/package.json index 5c19fcd9a29..77ba45d0d4a 100644 --- a/packages/network/package.json +++ b/packages/network/package.json @@ -24,13 +24,13 @@ "@agoric/assert": "^0.6.0", "@agoric/internal": "^0.3.2", "@agoric/store": "^0.9.2", - "@endo/base64": "^0.2.34", - "@endo/far": "^0.2.21", - "@endo/promise-kit": "^0.2.59" + "@endo/base64": "^1.0.0", + "@endo/far": "^1.0.1", + "@endo/promise-kit": "^1.0.1" }, "devDependencies": { "@agoric/swingset-vat": "^0.32.2", - "@endo/bundle-source": "^2.7.0", + "@endo/bundle-source": "^3.0.1", "ava": "^5.3.0", "c8": "^7.13.0" }, diff --git a/packages/notifier/package.json b/packages/notifier/package.json index 29fd48e5533..cd3b0afa617 100644 --- a/packages/notifier/package.json +++ b/packages/notifier/package.json @@ -36,18 +36,18 @@ "@agoric/assert": "^0.6.0", "@agoric/internal": "^0.3.2", "@agoric/vat-data": "^0.5.2", - "@endo/far": "^0.2.21", - "@endo/marshal": "^0.8.8", - "@endo/patterns": "^0.2.5", - "@endo/promise-kit": "^0.2.59" + "@endo/far": "^1.0.1", + "@endo/marshal": "^1.0.1", + "@endo/patterns": "^1.0.1", + "@endo/promise-kit": "^1.0.1" }, "devDependencies": { "@agoric/kmarshal": "^0.1.0", "@agoric/swingset-liveslots": "^0.10.2", "@agoric/swing-store": "^0.9.1", "@agoric/swingset-vat": "^0.32.2", - "@endo/init": "^0.5.59", - "@endo/ses-ava": "^0.2.43", + "@endo/init": "^1.0.1", + "@endo/ses-ava": "^1.0.1", "ava": "^5.3.0", "c8": "^7.13.0" }, diff --git a/packages/pegasus/package.json b/packages/pegasus/package.json index 4d8d6be1ef3..04dd7bcf4b1 100644 --- a/packages/pegasus/package.json +++ b/packages/pegasus/package.json @@ -37,12 +37,12 @@ "@agoric/swingset-vat": "^0.32.2", "@agoric/vats": "^0.15.1", "@agoric/zoe": "^0.26.2", - "@endo/bundle-source": "^2.7.0", - "@endo/captp": "^3.1.4", - "@endo/far": "^0.2.21", - "@endo/init": "^0.5.59", - "@endo/nat": "^4.1.30", - "@endo/promise-kit": "^0.2.59" + "@endo/bundle-source": "^3.0.1", + "@endo/captp": "^4.0.1", + "@endo/far": "^1.0.1", + "@endo/init": "^1.0.1", + "@endo/nat": "^5.0.1", + "@endo/promise-kit": "^1.0.1" }, "devDependencies": { "ava": "^5.3.0", diff --git a/packages/same-structure/package.json b/packages/same-structure/package.json index ed9f85b2692..ce1a9c640cb 100644 --- a/packages/same-structure/package.json +++ b/packages/same-structure/package.json @@ -32,7 +32,7 @@ "dependencies": { "@agoric/assert": "^0.6.0", "@agoric/store": "^0.9.2", - "@endo/marshal": "^0.8.8" + "@endo/marshal": "^1.0.1" }, "files": [ "*.js", diff --git a/packages/smart-wallet/package.json b/packages/smart-wallet/package.json index daf497575d3..35a30427ac9 100644 --- a/packages/smart-wallet/package.json +++ b/packages/smart-wallet/package.json @@ -18,9 +18,9 @@ "devDependencies": { "@agoric/cosmic-proto": "^0.3.0", "@agoric/swingset-vat": "^0.32.2", - "@endo/bundle-source": "^2.7.0", - "@endo/captp": "^3.1.4", - "@endo/init": "^0.5.59", + "@endo/bundle-source": "^3.0.1", + "@endo/captp": "^4.0.1", + "@endo/init": "^1.0.1", "ava": "^5.3.0", "import-meta-resolve": "^2.2.1" }, @@ -34,11 +34,11 @@ "@agoric/vat-data": "^0.5.2", "@agoric/vats": "^0.15.1", "@agoric/zoe": "^0.26.2", - "@endo/eventual-send": "^0.17.5", - "@endo/far": "^0.2.21", - "@endo/marshal": "^0.8.8", - "@endo/nat": "^4.1.30", - "@endo/promise-kit": "^0.2.59" + "@endo/eventual-send": "^1.0.1", + "@endo/far": "^1.0.1", + "@endo/marshal": "^1.0.1", + "@endo/nat": "^5.0.1", + "@endo/promise-kit": "^1.0.1" }, "files": [ "src/" diff --git a/packages/solo/package.json b/packages/solo/package.json index 5ae8cdfcbd3..549cdb0222d 100644 --- a/packages/solo/package.json +++ b/packages/solo/package.json @@ -36,12 +36,12 @@ "@agoric/time": "^0.3.2", "@agoric/vats": "^0.15.1", "@agoric/wallet": "^0.18.3", - "@endo/captp": "^3.1.4", - "@endo/eventual-send": "^0.17.5", - "@endo/import-bundle": "^0.4.1", - "@endo/init": "^0.5.59", - "@endo/marshal": "^0.8.8", - "@endo/promise-kit": "^0.2.59", + "@endo/captp": "^4.0.1", + "@endo/eventual-send": "^1.0.1", + "@endo/import-bundle": "^1.0.1", + "@endo/init": "^1.0.1", + "@endo/marshal": "^1.0.1", + "@endo/promise-kit": "^1.0.1", "anylogger": "^0.21.0", "deterministic-json": "^1.0.5", "esm": "agoric-labs/esm#Agoric-built", @@ -57,7 +57,7 @@ }, "devDependencies": { "@agoric/ertp": "^0.16.2", - "@endo/bundle-source": "^2.7.0", + "@endo/bundle-source": "^3.0.1", "ava": "^5.3.0", "c8": "^7.13.0" }, diff --git a/packages/spawner/package.json b/packages/spawner/package.json index 5cbf00cfe7a..debb0bda259 100644 --- a/packages/spawner/package.json +++ b/packages/spawner/package.json @@ -32,15 +32,15 @@ "homepage": "https://github.com/Agoric/agoric-sdk#readme", "dependencies": { "@agoric/assert": "^0.6.0", - "@endo/eventual-send": "^0.17.5", - "@endo/import-bundle": "^0.4.1", - "@endo/marshal": "^0.8.8" + "@endo/eventual-send": "^1.0.1", + "@endo/import-bundle": "^1.0.1", + "@endo/marshal": "^1.0.1" }, "devDependencies": { "@agoric/internal": "^0.3.2", "@agoric/swingset-vat": "^0.32.2", - "@endo/bundle-source": "^2.7.0", - "@endo/init": "^0.5.59", + "@endo/bundle-source": "^3.0.1", + "@endo/init": "^1.0.1", "ava": "^5.3.0", "c8": "^7.13.0" }, diff --git a/packages/store/package.json b/packages/store/package.json index 70bb4e127b7..325429b7683 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -31,15 +31,15 @@ "homepage": "https://github.com/Agoric/agoric-sdk#readme", "dependencies": { "@agoric/assert": "^0.6.0", - "@endo/exo": "^0.2.5", - "@endo/marshal": "^0.8.8", - "@endo/pass-style": "^0.1.6", - "@endo/patterns": "^0.2.5" + "@endo/exo": "^1.0.1", + "@endo/marshal": "^1.0.1", + "@endo/pass-style": "^1.0.1", + "@endo/patterns": "^1.0.1" }, "devDependencies": { "@agoric/time": "^0.3.2", - "@endo/init": "^0.5.59", - "@endo/ses-ava": "^0.2.43", + "@endo/init": "^1.0.1", + "@endo/ses-ava": "^1.0.1", "ava": "^5.3.0" }, "files": [ diff --git a/packages/swing-store/package.json b/packages/swing-store/package.json index a31d11ed1a4..62b8a415c22 100644 --- a/packages/swing-store/package.json +++ b/packages/swing-store/package.json @@ -23,14 +23,14 @@ "dependencies": { "@agoric/assert": "^0.6.0", "@agoric/internal": "^0.3.2", - "@endo/base64": "^0.2.34", - "@endo/bundle-source": "^2.7.0", - "@endo/check-bundle": "^0.2.21", - "@endo/nat": "^4.1.30", + "@endo/base64": "^1.0.0", + "@endo/bundle-source": "^3.0.1", + "@endo/check-bundle": "^1.0.1", + "@endo/nat": "^5.0.1", "better-sqlite3": "^9.1.1" }, "devDependencies": { - "@endo/init": "^0.5.59", + "@endo/init": "^1.0.1", "@types/better-sqlite3": "^7.5.0", "ava": "^5.3.0", "c8": "^7.13.0", diff --git a/packages/swingset-liveslots/package.json b/packages/swingset-liveslots/package.json index 732f6413c68..95b92fcac99 100644 --- a/packages/swingset-liveslots/package.json +++ b/packages/swingset-liveslots/package.json @@ -20,15 +20,15 @@ "@agoric/assert": "^0.6.0", "@agoric/internal": "^0.3.2", "@agoric/store": "^0.9.2", - "@endo/eventual-send": "^0.17.5", - "@endo/exo": "^0.2.5", - "@endo/far": "^0.2.21", - "@endo/init": "^0.5.59", - "@endo/marshal": "^0.8.8", - "@endo/nat": "^4.1.30", - "@endo/pass-style": "^0.1.6", - "@endo/patterns": "^0.2.5", - "@endo/promise-kit": "^0.2.59" + "@endo/eventual-send": "^1.0.1", + "@endo/exo": "^1.0.1", + "@endo/far": "^1.0.1", + "@endo/init": "^1.0.1", + "@endo/marshal": "^1.0.1", + "@endo/nat": "^5.0.1", + "@endo/pass-style": "^1.0.1", + "@endo/patterns": "^1.0.1", + "@endo/promise-kit": "^1.0.1" }, "devDependencies": { "ava": "^5.3.0", diff --git a/packages/swingset-runner/package.json b/packages/swingset-runner/package.json index 304eb4b9631..539677ea037 100644 --- a/packages/swingset-runner/package.json +++ b/packages/swingset-runner/package.json @@ -32,11 +32,11 @@ "@agoric/telemetry": "^0.6.2", "@agoric/vat-data": "^0.5.2", "@agoric/zoe": "^0.26.2", - "@endo/bundle-source": "^2.7.0", - "@endo/eventual-send": "^0.17.5", - "@endo/init": "^0.5.59", - "@endo/marshal": "^0.8.8", - "@endo/nat": "^4.1.30", + "@endo/bundle-source": "^3.0.1", + "@endo/eventual-send": "^1.0.1", + "@endo/init": "^1.0.1", + "@endo/marshal": "^1.0.1", + "@endo/nat": "^5.0.1", "expose-gc": "^1.0.0", "n-readlines": "^1.0.1", "yargs": "^16.1.0" diff --git a/packages/swingset-xsnap-supervisor/package.json b/packages/swingset-xsnap-supervisor/package.json index e6079c68005..52844c5d14c 100644 --- a/packages/swingset-xsnap-supervisor/package.json +++ b/packages/swingset-xsnap-supervisor/package.json @@ -25,10 +25,10 @@ "devDependencies": { "@agoric/assert": "^0.6.0", "@agoric/swingset-liveslots": "^0.10.2", - "@endo/bundle-source": "^2.7.0", - "@endo/import-bundle": "^0.4.1", - "@endo/init": "^0.5.59", - "@endo/marshal": "^0.8.8", + "@endo/bundle-source": "^3.0.1", + "@endo/import-bundle": "^1.0.1", + "@endo/init": "^1.0.1", + "@endo/marshal": "^1.0.1", "ava": "^5.3.0", "c8": "^7.13.0" }, diff --git a/packages/telemetry/package.json b/packages/telemetry/package.json index 84f7421c3ea..d3167cd771e 100644 --- a/packages/telemetry/package.json +++ b/packages/telemetry/package.json @@ -25,9 +25,9 @@ "@agoric/assert": "^0.6.0", "@agoric/internal": "^0.3.2", "@agoric/store": "^0.9.2", - "@endo/init": "^0.5.59", - "@endo/marshal": "^0.8.8", - "@endo/stream": "^0.3.28", + "@endo/init": "^1.0.1", + "@endo/marshal": "^1.0.1", + "@endo/stream": "^1.0.1", "@opentelemetry/api": "~1.3.0", "@opentelemetry/exporter-prometheus": "~0.35.0", "@opentelemetry/exporter-trace-otlp-http": "~0.35.0", @@ -41,8 +41,8 @@ "tmp": "^0.2.1" }, "devDependencies": { - "@endo/lockdown": "^0.1.31", - "@endo/ses-ava": "^0.2.43", + "@endo/lockdown": "^1.0.1", + "@endo/ses-ava": "^1.0.1", "ava": "^5.3.0", "c8": "^7.13.0", "tmp": "^0.2.1" diff --git a/packages/time/package.json b/packages/time/package.json index c44b6b2879d..f178de72213 100644 --- a/packages/time/package.json +++ b/packages/time/package.json @@ -32,12 +32,12 @@ "homepage": "https://github.com/Agoric/agoric-sdk#readme", "dependencies": { "@agoric/assert": "^0.6.0", - "@endo/nat": "^4.1.30", - "@endo/patterns": "^0.2.5" + "@endo/nat": "^5.0.1", + "@endo/patterns": "^1.0.1" }, "devDependencies": { - "@endo/far": "^0.2.21", - "@endo/init": "^0.5.59", + "@endo/far": "^1.0.1", + "@endo/init": "^1.0.1", "ava": "^5.3.0" }, "ava": { diff --git a/packages/vat-data/package.json b/packages/vat-data/package.json index b159e6c535f..790241a64e7 100644 --- a/packages/vat-data/package.json +++ b/packages/vat-data/package.json @@ -25,8 +25,8 @@ "@agoric/swingset-liveslots": "^0.10.2" }, "devDependencies": { - "@endo/init": "^0.5.59", - "@endo/ses-ava": "^0.2.43", + "@endo/init": "^1.0.1", + "@endo/ses-ava": "^1.0.1", "ava": "^5.3.0", "tsd": "^0.28.1" }, diff --git a/packages/vats/package.json b/packages/vats/package.json index 856e4d2af3f..7559949ca84 100644 --- a/packages/vats/package.json +++ b/packages/vats/package.json @@ -34,19 +34,19 @@ "@agoric/vat-data": "^0.5.2", "@agoric/zoe": "^0.26.2", "@agoric/zone": "^0.2.2", - "@endo/far": "^0.2.21", - "@endo/import-bundle": "^0.4.1", - "@endo/marshal": "^0.8.8", - "@endo/nat": "^4.1.30", - "@endo/patterns": "^0.2.5", - "@endo/promise-kit": "^0.2.59", + "@endo/far": "^1.0.1", + "@endo/import-bundle": "^1.0.1", + "@endo/marshal": "^1.0.1", + "@endo/nat": "^5.0.1", + "@endo/patterns": "^1.0.1", + "@endo/promise-kit": "^1.0.1", "import-meta-resolve": "^2.2.1", "jessie.js": "^0.3.2" }, "devDependencies": { "@agoric/swingset-liveslots": "^0.10.2", - "@endo/bundle-source": "^2.7.0", - "@endo/init": "^0.5.59", + "@endo/bundle-source": "^3.0.1", + "@endo/init": "^1.0.1", "ava": "^5.3.0", "c8": "^7.13.0" }, diff --git a/packages/wallet/api/package.json b/packages/wallet/api/package.json index dd26dd1f304..ef6bf4dc4d3 100644 --- a/packages/wallet/api/package.json +++ b/packages/wallet/api/package.json @@ -15,9 +15,9 @@ }, "devDependencies": { "@agoric/vats": "^0.15.1", - "@endo/bundle-source": "^2.7.0", - "@endo/far": "^0.2.21", - "@endo/init": "^0.5.59", + "@endo/bundle-source": "^3.0.1", + "@endo/far": "^1.0.1", + "@endo/init": "^1.0.1", "ava": "^5.3.0" }, "dependencies": { @@ -32,10 +32,10 @@ "@agoric/vat-data": "^0.5.2", "@agoric/zoe": "^0.26.2", "@agoric/zone": "^0.2.2", - "@endo/eventual-send": "^0.17.5", - "@endo/marshal": "^0.8.8", - "@endo/nat": "^4.1.30", - "@endo/promise-kit": "^0.2.59", + "@endo/eventual-send": "^1.0.1", + "@endo/marshal": "^1.0.1", + "@endo/nat": "^5.0.1", + "@endo/promise-kit": "^1.0.1", "import-meta-resolve": "^2.2.1" }, "keywords": [], diff --git a/packages/xsnap-lockdown/package.json b/packages/xsnap-lockdown/package.json index 64363050569..82fcd39759a 100644 --- a/packages/xsnap-lockdown/package.json +++ b/packages/xsnap-lockdown/package.json @@ -20,8 +20,8 @@ "test:xs": "exit 0" }, "devDependencies": { - "@endo/bundle-source": "^2.7.0", - "@endo/init": "^0.5.59", + "@endo/bundle-source": "^3.0.1", + "@endo/init": "^1.0.1", "ava": "^5.3.0", "c8": "^7.13.0", "rollup": "^2.58.0", diff --git a/packages/xsnap/package.json b/packages/xsnap/package.json index 7ddf446a626..1f40ca56231 100644 --- a/packages/xsnap/package.json +++ b/packages/xsnap/package.json @@ -30,18 +30,18 @@ "@agoric/assert": "^0.6.0", "@agoric/internal": "^0.3.2", "@agoric/xsnap-lockdown": "^0.14.0", - "@endo/bundle-source": "^2.7.0", - "@endo/eventual-send": "^0.17.5", - "@endo/init": "^0.5.59", - "@endo/netstring": "^0.3.29", - "@endo/promise-kit": "^0.2.59", - "@endo/stream": "^0.3.28", - "@endo/stream-node": "^0.2.29", + "@endo/bundle-source": "^3.0.1", + "@endo/eventual-send": "^1.0.1", + "@endo/init": "^1.0.1", + "@endo/netstring": "^1.0.1", + "@endo/promise-kit": "^1.0.1", + "@endo/stream": "^1.0.1", + "@endo/stream-node": "^1.0.1", "glob": "^7.1.6", "tmp": "^0.2.1" }, "devDependencies": { - "@endo/base64": "^0.2.34", + "@endo/base64": "^1.0.0", "@types/glob": "^8.1.0", "ava": "^5.3.0", "c8": "^7.13.0" diff --git a/packages/zoe/package.json b/packages/zoe/package.json index 343581b73ef..f9a488bf0f8 100644 --- a/packages/zoe/package.json +++ b/packages/zoe/package.json @@ -52,19 +52,19 @@ "@agoric/swingset-vat": "^0.32.2", "@agoric/time": "^0.3.2", "@agoric/vat-data": "^0.5.2", - "@endo/bundle-source": "^2.7.0", - "@endo/captp": "^3.1.4", - "@endo/eventual-send": "^0.17.5", - "@endo/far": "^0.2.21", - "@endo/import-bundle": "^0.4.1", - "@endo/marshal": "^0.8.8", - "@endo/nat": "^4.1.30", - "@endo/patterns": "^0.2.5", - "@endo/promise-kit": "^0.2.59", + "@endo/bundle-source": "^3.0.1", + "@endo/captp": "^4.0.1", + "@endo/eventual-send": "^1.0.1", + "@endo/far": "^1.0.1", + "@endo/import-bundle": "^1.0.1", + "@endo/marshal": "^1.0.1", + "@endo/nat": "^5.0.1", + "@endo/patterns": "^1.0.1", + "@endo/promise-kit": "^1.0.1", "yargs-parser": "^21.1.1" }, "devDependencies": { - "@endo/init": "^0.5.59", + "@endo/init": "^1.0.1", "@agoric/kmarshal": "^0.1.0", "ava": "^5.3.0", "c8": "^7.13.0", diff --git a/packages/zone/package.json b/packages/zone/package.json index 8d5d53bc4d1..6dcbbebff19 100644 --- a/packages/zone/package.json +++ b/packages/zone/package.json @@ -29,12 +29,12 @@ "dependencies": { "@agoric/base-zone": "^0.1.0", "@agoric/vat-data": "^0.5.2", - "@endo/far": "^0.2.21", - "@endo/pass-style": "^0.1.6" + "@endo/far": "^1.0.1", + "@endo/pass-style": "^1.0.1" }, "devDependencies": { "@agoric/swingset-liveslots": "^0.10.2", - "@endo/patterns": "^0.2.5", + "@endo/patterns": "^1.0.1", "ava": "^5.3.0" }, "publishConfig": { From 055f68e691453d39fc6e5b395b971dff4694f00b Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Wed, 20 Dec 2023 13:34:37 -0800 Subject: [PATCH 45/58] chore: Update yarn.lock --- yarn.lock | 458 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 306 insertions(+), 152 deletions(-) diff --git a/yarn.lock b/yarn.lock index cac53b9aa08..4caa3acbe1a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,7 +7,7 @@ resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== -"@agoric/babel-generator@^7.17.4", "@agoric/babel-generator@^7.17.6": +"@agoric/babel-generator@^7.17.6": version "7.17.6" resolved "https://registry.yarnpkg.com/@agoric/babel-generator/-/babel-generator-7.17.6.tgz#75ff4629468a481d670b4154bcfade11af6de674" integrity sha512-D2wnk5fGajxMN5SCRSaA/triQGEaEX2Du0EzrRqobuD4wRXjvtF1e7jC1PPOk/RC2bZ8/0fzp0CHOiB7YLwb5w== @@ -28,6 +28,14 @@ dependencies: "@babel/highlight" "^7.18.6" +"@babel/code-frame@^7.22.13", "@babel/code-frame@^7.23.5": + version "7.23.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.23.5.tgz#9009b69a8c602293476ad598ff53e4562e15c244" + integrity sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA== + dependencies: + "@babel/highlight" "^7.23.4" + chalk "^2.4.2" + "@babel/generator@^7.17.3": version "7.21.5" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.21.5.tgz#c0c0e5449504c7b7de8236d99338c3e2a340745f" @@ -38,11 +46,26 @@ "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" +"@babel/generator@^7.23.6": + version "7.23.6" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.6.tgz#9e1fca4811c77a10580d17d26b57b036133f3c2e" + integrity sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw== + dependencies: + "@babel/types" "^7.23.6" + "@jridgewell/gen-mapping" "^0.3.2" + "@jridgewell/trace-mapping" "^0.3.17" + jsesc "^2.5.1" + "@babel/helper-environment-visitor@^7.16.7": version "7.21.5" resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.21.5.tgz#c769afefd41d171836f7cb63e295bedf689d48ba" integrity sha512-IYl4gZ3ETsWocUWgsFZLM5i1BYx9SoemminVEXadgLBa9TdeorzgLKm8wWLA6J1N/kT3Kch8XIk1laNzYoHKvQ== +"@babel/helper-environment-visitor@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" + integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== + "@babel/helper-function-name@^7.16.7": version "7.21.0" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz#d552829b10ea9f120969304023cd0645fa00b1b4" @@ -51,6 +74,14 @@ "@babel/template" "^7.20.7" "@babel/types" "^7.21.0" +"@babel/helper-function-name@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" + integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== + dependencies: + "@babel/template" "^7.22.15" + "@babel/types" "^7.23.0" + "@babel/helper-hoist-variables@^7.16.7": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" @@ -58,6 +89,13 @@ dependencies: "@babel/types" "^7.18.6" +"@babel/helper-hoist-variables@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" + integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== + dependencies: + "@babel/types" "^7.22.5" + "@babel/helper-split-export-declaration@^7.16.7": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075" @@ -65,16 +103,33 @@ dependencies: "@babel/types" "^7.18.6" +"@babel/helper-split-export-declaration@^7.22.6": + version "7.22.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" + integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== + dependencies: + "@babel/types" "^7.22.5" + "@babel/helper-string-parser@^7.21.5": version "7.21.5" resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.21.5.tgz#2b3eea65443c6bdc31c22d037c65f6d323b6b2bd" integrity sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w== +"@babel/helper-string-parser@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" + integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== + "@babel/helper-validator-identifier@^7.19.1", "@babel/helper-validator-identifier@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193" integrity sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ== +"@babel/helper-validator-identifier@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" + integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== + "@babel/highlight@^7.18.6": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.5.tgz#aa6c05c5407a67ebce408162b7ede789b4d22031" @@ -84,11 +139,25 @@ chalk "^2.0.0" js-tokens "^4.0.0" +"@babel/highlight@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b" + integrity sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A== + dependencies: + "@babel/helper-validator-identifier" "^7.22.20" + chalk "^2.4.2" + js-tokens "^4.0.0" + "@babel/parser@^7.17.3", "@babel/parser@^7.20.7", "@babel/parser@^7.7.0": version "7.21.8" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.8.tgz#642af7d0333eab9c0ad70b14ac5e76dbde7bfdf8" integrity sha512-6zavDGdzG3gUqAdWvlLFfk+36RilI+Pwyuuh7HItyeScCWP3k6i8vKclAQ0bM/0y/Kz/xiwvxhMv9MgTJP5gmA== +"@babel/parser@^7.22.15", "@babel/parser@^7.23.6": + version "7.23.6" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.6.tgz#ba1c9e512bda72a47e285ae42aff9d2a635a9e3b" + integrity sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ== + "@babel/runtime@^7.20.7": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.5.tgz#8564dd588182ce0047d55d7a75e93921107b57ec" @@ -105,7 +174,32 @@ "@babel/parser" "^7.20.7" "@babel/types" "^7.20.7" -"@babel/traverse@^7.17.3", "@babel/traverse@^7.7.0": +"@babel/template@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" + integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== + dependencies: + "@babel/code-frame" "^7.22.13" + "@babel/parser" "^7.22.15" + "@babel/types" "^7.22.15" + +"@babel/traverse@^7.23.6": + version "7.23.6" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.6.tgz#b53526a2367a0dd6edc423637f3d2d0f2521abc5" + integrity sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ== + dependencies: + "@babel/code-frame" "^7.23.5" + "@babel/generator" "^7.23.6" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/parser" "^7.23.6" + "@babel/types" "^7.23.6" + debug "^4.3.1" + globals "^11.1.0" + +"@babel/traverse@^7.7.0": version "7.17.3" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.3.tgz#0ae0f15b27d9a92ba1f2263358ea7c4e7db47b57" integrity sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw== @@ -130,6 +224,15 @@ "@babel/helper-validator-identifier" "^7.19.1" to-fast-properties "^2.0.0" +"@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.6": + version "7.23.6" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.6.tgz#be33fdb151e1f5a56877d704492c240fc71c7ccd" + integrity sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg== + dependencies: + "@babel/helper-string-parser" "^7.23.4" + "@babel/helper-validator-identifier" "^7.22.20" + to-fast-properties "^2.0.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -370,97 +473,116 @@ resolved "https://registry.yarnpkg.com/@datadog/sketches-js/-/sketches-js-2.1.0.tgz#8c7e8028a5fc22ad102fa542b0a446c956830455" integrity sha512-smLocSfrt3s53H/XSVP3/1kP42oqvrkjUPtyaFd1F79ux24oE31BKt+q0c6lsa6hOYrFzsIwyc5GXAI5JmfOew== -"@endo/base64@^0.2.34", "@endo/base64@^0.2.35": - version "0.2.35" - resolved "https://registry.yarnpkg.com/@endo/base64/-/base64-0.2.35.tgz#7d18203d5807748388c935df7eb79c7672a0b64e" - integrity sha512-rsAicKvgNq/ar+9b3ElXRXglMiJcg1IErz3lx1HFYZUzfWp8r/Dibi3TEjYpSBmtOeYN9CeWH8CBluN0uFqdag== +"@endo/base64@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@endo/base64/-/base64-1.0.0.tgz#f44f0378fc960ab4e986b0452935f27d93726ca1" + integrity sha512-rd46CY2jk3oblrxpH7gC+xvnUIbCrN1geEb+IgKSx17WKcT0fPgrwFqnWnSzXCyJqIJ7xkeAUvEbilPQoZMxmg== -"@endo/bundle-source@^2.7.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@endo/bundle-source/-/bundle-source-2.8.0.tgz#56f25b3d9c74d3d0bede5c526647aaf02c0a8f94" - integrity sha512-nDiM3u/LKWq5xAnJ+zm35HC6kMKF3IG6Y5V0385slFHZVT8mXzRJ5ztEqRsVzvVeITfz3ZRFOaFer6v4V8Lkjg== - dependencies: - "@agoric/babel-generator" "^7.17.4" - "@babel/parser" "^7.17.3" - "@babel/traverse" "^7.17.3" - "@endo/base64" "^0.2.35" - "@endo/compartment-mapper" "^0.9.2" - "@endo/init" "^0.5.60" - "@endo/promise-kit" "^0.2.60" - "@endo/where" "^0.3.5" +"@endo/bundle-source@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@endo/bundle-source/-/bundle-source-3.0.1.tgz#416d3407aecbffcbbad442fcc75b9a5d69cde067" + integrity sha512-ff83avkRB+OHn2axJLu4JAM3EDp6KpMwBRM37u8ul6G9oeyf+Crmt1a7nvhREXXZtBiSNkFKrU8byi318LxYtQ== + dependencies: + "@endo/base64" "^1.0.0" + "@endo/compartment-mapper" "^1.0.1" + "@endo/evasive-transform" "^1.0.1" + "@endo/init" "^1.0.1" + "@endo/promise-kit" "^1.0.1" + "@endo/where" "^1.0.0" "@rollup/plugin-commonjs" "^19.0.0" "@rollup/plugin-node-resolve" "^13.0.0" acorn "^8.2.4" - jessie.js "^0.3.2" rollup "^2.79.1" - source-map "^0.7.3" -"@endo/captp@^3.1.4": - version "3.1.5" - resolved "https://registry.yarnpkg.com/@endo/captp/-/captp-3.1.5.tgz#4cf0eeedc4728e856bd3e71cfc42cba3ab02449c" - integrity sha512-uyhECyTQqZcxt31YzCQ+n2nKu1+YE1qCuH00FFmK2qKGdF92gkluTvmDHcgxJ6lsKl/QBkQcuch51GZqXDs+xQ== +"@endo/captp@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@endo/captp/-/captp-4.0.1.tgz#49274b7f59ef14fded61746f45a1c12484736f32" + integrity sha512-Hb5FaIOMJFJ+QAzcn0/2jPED+z6AQx0gmWGhDmg+M8ecjSrbe/8agV1sB+s80aytFrYGqRMS4T1vSdmUaiY5gQ== dependencies: - "@endo/eventual-send" "^0.17.6" - "@endo/marshal" "^0.8.9" - "@endo/nat" "^4.1.31" - "@endo/promise-kit" "^0.2.60" + "@endo/eventual-send" "^1.0.1" + "@endo/marshal" "^1.0.1" + "@endo/nat" "^5.0.1" + "@endo/promise-kit" "^1.0.1" -"@endo/check-bundle@^0.2.21": - version "0.2.22" - resolved "https://registry.yarnpkg.com/@endo/check-bundle/-/check-bundle-0.2.22.tgz#1a978e71401b61ce9e091ac6c6bfd037140263b8" - integrity sha512-xAIcx8PCnvpSRmaSqo0iA7AeIhHrx9er5fEoz/lnXxHNngYcGaPnzux5B57kLdcJs3lBNCIzaUuh4HRhCNpIJA== +"@endo/check-bundle@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@endo/check-bundle/-/check-bundle-1.0.1.tgz#52c38896ee8b28377ab6e1070e60cada17e4214f" + integrity sha512-NgzFpLL4qUMRCVPVVrDn5PnwhQHk+TddVSIwchCEVG/pzFJa4iJNj1BvRxhjD38NUGsLI4/LFWIvJBydlGLvoA== dependencies: - "@endo/base64" "^0.2.35" - "@endo/compartment-mapper" "^0.9.2" + "@endo/base64" "^1.0.0" + "@endo/compartment-mapper" "^1.0.1" -"@endo/cjs-module-analyzer@^0.2.35": - version "0.2.35" - resolved "https://registry.yarnpkg.com/@endo/cjs-module-analyzer/-/cjs-module-analyzer-0.2.35.tgz#0de39d2306bba5671e121efa091bf6cb9990f11e" - integrity sha512-Ldr1auybH9AzrR/WV6bzP4aLRpv8CCl98mv0IAui4uQmmFOPOGchshyBfpiDF5XMKM6wh7z0VgmvmydQ5/7AHQ== +"@endo/cjs-module-analyzer@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@endo/cjs-module-analyzer/-/cjs-module-analyzer-1.0.0.tgz#69c3c415442931db04871ed0dedbc6246b2b540c" + integrity sha512-1D+GpkV7NPkgKKd1k7G3uRTn481loFLJfTxmouXedKza2VnB8QeZTODm5pYBIbr4y0hqYBxZ1DxWbb86wAR6IA== -"@endo/compartment-mapper@^0.9.1", "@endo/compartment-mapper@^0.9.2": - version "0.9.2" - resolved "https://registry.yarnpkg.com/@endo/compartment-mapper/-/compartment-mapper-0.9.2.tgz#48bfa610179cc5521c745c7b2d1eb5fab52ed29a" - integrity sha512-zsAyTf87zBsE1yZ2CBzEGhcGZGGv5m93/CXZHQhut53o4DWwhuS/WTQ4cBoVFSGKWz63JbbA/7qa4fcOnv5dDw== +"@endo/compartment-mapper@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@endo/compartment-mapper/-/compartment-mapper-1.0.1.tgz#9241f09ed63827964d2000fdaf696412ec3d4d18" + integrity sha512-QpbyM9L2KiBm4MIQWkxfqNT17Vi9en+CXVJuFa0HIHfnCExug+oBZyvwfxXIsPBHKLMb37NYoaSLycrNcFzJYQ== dependencies: - "@endo/cjs-module-analyzer" "^0.2.35" - "@endo/static-module-record" "^0.8.2" - "@endo/zip" "^0.2.35" - ses "^0.18.8" + "@endo/cjs-module-analyzer" "^1.0.0" + "@endo/static-module-record" "^1.0.1" + "@endo/zip" "^1.0.0" + ses "^1.0.1" "@endo/env-options@^0.1.4": version "0.1.4" resolved "https://registry.yarnpkg.com/@endo/env-options/-/env-options-0.1.4.tgz#e516bc3864f00b154944e444fb8996a9a0c23a45" integrity sha512-Ol8ct0aW8VK1ZaqntnUJfrYT59P6Xn36XPbHzkqQhsYkpudKDn5ILYEwGmSO/Ff+XJjv/pReNI0lhOyyrDa9mg== -"@endo/eslint-plugin@^0.5.1": - version "0.5.2" - resolved "https://registry.yarnpkg.com/@endo/eslint-plugin/-/eslint-plugin-0.5.2.tgz#835d22e9ff17d9935f7f565e50a21ef07aa92ca2" - integrity sha512-WzQmzBXoGGm5vb2mX/Ho9dS5wSaajmeE2PnFqiBUwPQ5ml7B0T7/QwzV5MSAv1ClyzDt3t5j36ENWxeibb2C9Q== +"@endo/env-options@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@endo/env-options/-/env-options-1.0.1.tgz#a6ad1951f3303426cd15956aa7b95ea06cb34ad0" + integrity sha512-5hieu6ow9Kgf2wKKchE1xQEN7VlKVLL3O0eEjxN9d52XodHMbEFu0gGoFA6NeQJq9SHNrbgJhZDfMkPaHvoFxg== + +"@endo/eslint-plugin@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@endo/eslint-plugin/-/eslint-plugin-2.0.0.tgz#53ce930b758016c62e187cf45e3f69563cd1a480" + integrity sha512-IyF42cjjy/SxBILpAXigvzDTA7PviOU4OzMKx4GLCdis2V3977mJ14td0U7yej2MqeQXDoUYtpBvbFpXtQQSGA== dependencies: "@typescript-eslint/utils" "^6.6.0" requireindex "~1.1.0" tsutils "~3.21.0" typescript "~5.2.2" -"@endo/eventual-send@^0.17.5", "@endo/eventual-send@^0.17.6": +"@endo/evasive-transform@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@endo/evasive-transform/-/evasive-transform-1.0.1.tgz#4ce0e6ff58a8689c02f9ddb8d6be91c0b030df9c" + integrity sha512-MlXqLsMyBo+xBPKChEaq14sEraVM5eG8eRdkctSr+Cc+xFjcI6pr3IrG/lBLQgK8LbcmUjIFzmn64IUmtNYBBQ== + dependencies: + "@agoric/babel-generator" "^7.17.6" + "@babel/parser" "^7.23.6" + "@babel/traverse" "^7.23.6" + source-map "0.7.4" + +"@endo/eventual-send@^0.17.6": version "0.17.6" resolved "https://registry.yarnpkg.com/@endo/eventual-send/-/eventual-send-0.17.6.tgz#86719e4e3ff76991c49f6680309dc77dff65fe55" integrity sha512-73cKY2uiWdzMJn7i284NJyD3K0UKjpksBg/EA2GT8YJa0TgeBczFQIm81vC08itK5gHuDDH2vC5COSGR6hxKIg== dependencies: "@endo/env-options" "^0.1.4" -"@endo/exo@^0.2.5": - version "0.2.6" - resolved "https://registry.yarnpkg.com/@endo/exo/-/exo-0.2.6.tgz#09721063377981d4376b3cf8aa534dd0d49939dc" - integrity sha512-fk4EYdHRZectyLt0cn0aT8PIlb8BgE5ji6DD4AHJ9Q6TFrGr6RRV0aXs8xW9LAs7MIduz+j7vtpeURxugN8KvQ== +"@endo/eventual-send@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@endo/eventual-send/-/eventual-send-1.0.1.tgz#a75b7529c926f648ae9ce5e4037146c27974c5f9" + integrity sha512-PLyNBvGNqZOKGluurj6ZzpdbHOf/MLJjWnnt/YB6h7hyJq0w7arXwb56ha4ywILCsxQO12Cc+ananyQUddHLBA== dependencies: - "@endo/env-options" "^0.1.4" - "@endo/far" "^0.2.22" - "@endo/pass-style" "^0.1.7" - "@endo/patterns" "^0.2.6" + "@endo/env-options" "^1.0.1" + +"@endo/exo@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@endo/exo/-/exo-1.0.1.tgz#17a71221043d5b901c9ec20a56f8ca6f25c5def4" + integrity sha512-jLJGG/WGsdcYz5LVmh+Tu6uSrrYq3d2zfLQXcmepvE0MCTaVxQROTOE3s2G6QmZE2D5nKSJb/uHeSHVziPR0kw== + dependencies: + "@endo/env-options" "^1.0.1" + "@endo/eventual-send" "^1.0.1" + "@endo/far" "^1.0.1" + "@endo/pass-style" "^1.0.1" + "@endo/patterns" "^1.0.1" -"@endo/far@^0.2.21", "@endo/far@^0.2.22", "@endo/far@^0.2.3": +"@endo/far@^0.2.3": version "0.2.22" resolved "https://registry.yarnpkg.com/@endo/far/-/far-0.2.22.tgz#fda187289a903ee3f9d6dcc5664ee7fef1994b1f" integrity sha512-LFOicqyHslKOSk/H5EfGOcw347ftDSwYHARPasnrG4UJOEkcU1ZG5bN/BmfONtcidB776gWZKrV/tNl4WLIlyw== @@ -468,58 +590,67 @@ "@endo/eventual-send" "^0.17.6" "@endo/pass-style" "^0.1.7" -"@endo/import-bundle@^0.4.1": - version "0.4.2" - resolved "https://registry.yarnpkg.com/@endo/import-bundle/-/import-bundle-0.4.2.tgz#de047f83aa22a7a3d94b0bbef4bcc5dff8b369cf" - integrity sha512-SF08JSa6qO6NEueFVeKW0+w9sfjPvXrJ9L2XrgAHIvvLy9H4qLJxk92G2lfaZSL/dyvovhERhb+An1c0j3rdRw== +"@endo/far@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@endo/far/-/far-1.0.1.tgz#a709846f8f98b44c43cd1cdde3d4efc6b69ac22b" + integrity sha512-lem82jl2BU9YHbKhEYzJEKR+tRVthDXpAGF/WyXHCRYNkqN/kDuM2hMQTBflVeCxEw5e6MeZxiI8QReco3sTFA== dependencies: - "@endo/base64" "^0.2.35" - "@endo/compartment-mapper" "^0.9.2" - "@endo/where" "^0.3.5" - ses "^0.18.8" + "@endo/eventual-send" "^1.0.1" + "@endo/pass-style" "^1.0.1" -"@endo/init@^0.5.59", "@endo/init@^0.5.60": - version "0.5.60" - resolved "https://registry.yarnpkg.com/@endo/init/-/init-0.5.60.tgz#e78051b13cd4a04c72d5ec1d2a6011b7f987f7ff" - integrity sha512-AbAvs6Nk01fyJ+PaW0RzwemIWyomjzDf8ZEhVa3jCOhr8kBBsTnJdX0v7XkbZ/Y8NQxlrFaW0fPqlJK6aMWTlQ== +"@endo/import-bundle@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@endo/import-bundle/-/import-bundle-1.0.1.tgz#b3e9035f84f82461956d675b2243181c7f1becb0" + integrity sha512-NwkzAj3AcZiXVeiwrGLiDuqJ0UbxFwm3/SNWTY0joSX9Sj0Wq+okour2vCMvKu3dIoyG1ujGa29S6npWI7JtJA== dependencies: - "@endo/base64" "^0.2.35" - "@endo/eventual-send" "^0.17.6" - "@endo/lockdown" "^0.1.32" - "@endo/promise-kit" "^0.2.60" + "@endo/base64" "^1.0.0" + "@endo/compartment-mapper" "^1.0.1" + "@endo/where" "^1.0.0" + ses "^1.0.1" -"@endo/lockdown@^0.1.31", "@endo/lockdown@^0.1.32": - version "0.1.32" - resolved "https://registry.yarnpkg.com/@endo/lockdown/-/lockdown-0.1.32.tgz#2d13a9ca336d5dce243a3cf919c543b55973153c" - integrity sha512-AN696XS3robsopxVg7gc/6c9TXPGosGmKfcM0g9SNnD1rqgo1EakS4wf7f3AbICU9iJdo0e4V5JjzWPnjqoR0g== +"@endo/init@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@endo/init/-/init-1.0.1.tgz#e83d52f384089cdb3119d47cd778fe0d80e92a97" + integrity sha512-9JPCwiQU6wc5SC2jc10VLOV95FxqBUU+94SR2hghPDrJQQdQ6+Kic8d2DFzEH8vSIGpR9ibBTnAzFjmPfVuAxA== dependencies: - ses "^0.18.8" + "@endo/base64" "^1.0.0" + "@endo/eventual-send" "^1.0.1" + "@endo/lockdown" "^1.0.1" + "@endo/promise-kit" "^1.0.1" -"@endo/marshal@^0.8.8", "@endo/marshal@^0.8.9": - version "0.8.9" - resolved "https://registry.yarnpkg.com/@endo/marshal/-/marshal-0.8.9.tgz#f6fcaf23ecad828f6d086657f1d1590ea8ef3840" - integrity sha512-wzYlY5/JFzY/wAVxZ6h0BxlRaAS/9KKnhircKO/tGw5bZYHFvLeSeMCBZ4VCSZg5aNgDlhuvB0S6iCwS5MYqcg== +"@endo/lockdown@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@endo/lockdown/-/lockdown-1.0.1.tgz#65809eb308902a97538155e4165e2f6da2285152" + integrity sha512-k3ZGZ3umUdlquqPFdEl5UbLLrl4nCcFuSpzJRG1J2zbUJVfYMFYzzc25b9Sq/PDO6trrOzQKWMBMp3dg83+KvA== dependencies: - "@endo/eventual-send" "^0.17.6" - "@endo/nat" "^4.1.31" - "@endo/pass-style" "^0.1.7" - "@endo/promise-kit" "^0.2.60" + ses "^1.0.1" -"@endo/nat@^4.1.30", "@endo/nat@^4.1.31": - version "4.1.31" - resolved "https://registry.yarnpkg.com/@endo/nat/-/nat-4.1.31.tgz#ca738f472481a572f47749b41529b3261ebb4c1e" - integrity sha512-tz0PnEmzX9BAtKEawYndsx+XC6f+2CKErtrpbpOuX3uct5VNLdw6q6cArSYtnHbxRHR0YaHUdeG0W6okmup4bg== +"@endo/marshal@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@endo/marshal/-/marshal-1.0.1.tgz#5ed44fd7711aad71571a796d1945b66c7c222cd6" + integrity sha512-Yx0ErVKJmTsLrMUQF8RXu3Y0uYu778G9EA75uOBkzmeldlvEYJryKH9qOhMzKq2/ecoiiksZS/6wjCHOVCixxg== + dependencies: + "@endo/eventual-send" "^1.0.1" + "@endo/nat" "^5.0.1" + "@endo/pass-style" "^1.0.1" + "@endo/promise-kit" "^1.0.1" -"@endo/netstring@^0.3.29": - version "0.3.30" - resolved "https://registry.yarnpkg.com/@endo/netstring/-/netstring-0.3.30.tgz#ee0f29c4fc33674733833610129136435b56b044" - integrity sha512-Z3e2duj7Qumt+xm1RVQq/O74ORfM87WBXgBQyxIgTAxBT1o0qjR+BnPBWSyzWg4+JBtax0qgge8KiKpfoECa4g== +"@endo/nat@^5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@endo/nat/-/nat-5.0.1.tgz#ab21329764a32edbc492a51eb29443866ac26a39" + integrity sha512-L2ZY7om+mHS/a+DLCezanbIXUtLW//tnVPfbKa7m4UAgo+JsDRGF9WyyS8P77cYcP3aWVelbntiTt0rCd/grzQ== + +"@endo/netstring@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@endo/netstring/-/netstring-1.0.1.tgz#75fd20bc777b0676e528a777d77fcbd8789760b7" + integrity sha512-aH5JuAlFWNDVUkKv9GsBcdeeu6ueCpqtHDZ/rkr9LEa4LK0OyAMizXnfu+HGTyQcH+NiqIwX98wxf4qpdKWV3w== dependencies: - "@endo/init" "^0.5.60" - "@endo/stream" "^0.3.29" - ses "^0.18.8" + "@endo/init" "^1.0.1" + "@endo/promise-kit" "^1.0.1" + "@endo/stream" "^1.0.1" + ses "^1.0.1" -"@endo/pass-style@^0.1.6", "@endo/pass-style@^0.1.7": +"@endo/pass-style@^0.1.7": version "0.1.7" resolved "https://registry.yarnpkg.com/@endo/pass-style/-/pass-style-0.1.7.tgz#ea22568e8b86fb2d1a14a5fc042374cc0d8e310b" integrity sha512-dlB62Ptjcy/+iachy7qzAdgIwaU60rE+XLummLRpE2tDSJF2jSFJlVwa/QuGw1KKO7Rt4vog/51sKev3EbJZQg== @@ -527,67 +658,83 @@ "@endo/promise-kit" "^0.2.60" "@fast-check/ava" "^1.1.5" -"@endo/patterns@^0.2.5", "@endo/patterns@^0.2.6": - version "0.2.6" - resolved "https://registry.yarnpkg.com/@endo/patterns/-/patterns-0.2.6.tgz#abbbc3743ee313ffc6167d783d5fc78de74125fe" - integrity sha512-FbayXMv9sY4qP5vSaPhq9RSJmsTykImbCy0FN1YmZzaChGwOfSPOJw4898xVLDK5Xi6f+6zV02uXjuMTuZt6UA== +"@endo/pass-style@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@endo/pass-style/-/pass-style-1.0.1.tgz#2050c0754d6f0f8786f2e090712a82ad2c244011" + integrity sha512-oYu7A53eUcPGQ3aOJATMBQAUcn1eSwqsZVwnRP1InAKfgoOKrDY7zKM7j1xmbQWssmG6H7nJZaV6HiegFxm2cA== dependencies: - "@endo/eventual-send" "^0.17.6" - "@endo/marshal" "^0.8.9" - "@endo/promise-kit" "^0.2.60" + "@endo/eventual-send" "^1.0.1" + "@endo/promise-kit" "^1.0.1" + "@fast-check/ava" "^1.1.5" + +"@endo/patterns@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@endo/patterns/-/patterns-1.0.1.tgz#fdf9acae5dd1528c28a90fba30841b6958e4d595" + integrity sha512-0DsLqtwdyJMYTM7nNP5Y6xqNvBs5i2TLzzF477dXR9EHW4wZOnq0ZdsxaWu0YodYkfroopMimBNQ3qSJ39Gu6g== + dependencies: + "@endo/eventual-send" "^1.0.1" + "@endo/marshal" "^1.0.1" + "@endo/promise-kit" "^1.0.1" -"@endo/promise-kit@^0.2.59", "@endo/promise-kit@^0.2.60": +"@endo/promise-kit@^0.2.60": version "0.2.60" resolved "https://registry.yarnpkg.com/@endo/promise-kit/-/promise-kit-0.2.60.tgz#8012ada06970c7eaf965cd856563b34a1790e163" integrity sha512-6Zp9BqBbc3ywaG+iLRrQRmO/VLKrMnvsbgOKKPMpjEC3sUlksYA09uaH3GrKZgoGChF8m9bXK8eFW39z7wJNUw== dependencies: ses "^0.18.8" -"@endo/ses-ava@^0.2.43": - version "0.2.44" - resolved "https://registry.yarnpkg.com/@endo/ses-ava/-/ses-ava-0.2.44.tgz#b97b0d5a457b30b73c74b19091d67840984cf47e" - integrity sha512-Pp0os/ZN7r0L94eCxWFYhSWt+DIdIASIVlY4oYCwMLxLa28cuswCjRQvPKLINBpZezogCKKptEWJTyHhGWpVQw== +"@endo/promise-kit@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@endo/promise-kit/-/promise-kit-1.0.1.tgz#056c8cd59e52260fc4cea2a83422450333a04e26" + integrity sha512-JLhfkuQaERVvf+G+kXpDjyzyik3kxkX1FHbiDQfK2ge9Ltz7vRk/OD+yZma0UE2Rn91F2B/mvelxz1MxlYibwA== dependencies: - ses "^0.18.8" + ses "^1.0.1" -"@endo/static-module-record@^0.8.2": - version "0.8.2" - resolved "https://registry.yarnpkg.com/@endo/static-module-record/-/static-module-record-0.8.2.tgz#25f66d555d1a075e5258520405410fd01fc2d1f7" - integrity sha512-wHJLX/hU/MoSFvnFN9sZ/49DYPlbASHlVQrJszeKH3xIpBtl3SG4JdRswO6RQgLREQJD/HV/ZN5V8x2bCpMu4Q== +"@endo/ses-ava@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@endo/ses-ava/-/ses-ava-1.0.1.tgz#b29ce458ab5e84894a8febc604e3473a86c5fc13" + integrity sha512-+oH+q99bOscoPBgN/c4SBCl2Ei1HMSfAGT7BgMCIdg+Ak8Sh/vOhzOWyHzaTIaX4aEI129kjdgZcbDssYgZj9A== + dependencies: + ses "^1.0.1" + +"@endo/static-module-record@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@endo/static-module-record/-/static-module-record-1.0.1.tgz#fcb18cb840856ff55bd3b201bd412f8428532abb" + integrity sha512-5ZXGzzFVXBjT6z5OFsQvdYJC25iPPDFrjL8Wl4sLa9BXrbFBhbXo4olUe/wZ/iRBZMCQBDztqdX0S0G+WSGJlg== dependencies: "@agoric/babel-generator" "^7.17.6" - "@babel/parser" "^7.17.3" - "@babel/traverse" "^7.17.3" - "@babel/types" "^7.17.0" - ses "^0.18.8" + "@babel/parser" "^7.23.6" + "@babel/traverse" "^7.23.6" + "@babel/types" "^7.23.6" + ses "^1.0.1" -"@endo/stream-node@^0.2.29": - version "0.2.30" - resolved "https://registry.yarnpkg.com/@endo/stream-node/-/stream-node-0.2.30.tgz#4af1989976eaad385663cd2a3342072cf9dbea7c" - integrity sha512-KZZJ6MWeTxFYScuuIj5BwGVX6Y5F9+RzW8RhVZy7Najr/irgdGnF/oGk8QeUIHuVzTgL4HLJP+XATnHaLKOcGw== +"@endo/stream-node@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@endo/stream-node/-/stream-node-1.0.1.tgz#d28d89bfd0a476a006d531e13e41c0f989c7cf4e" + integrity sha512-SYnYqYtjJpKokyupBkzVhFAkJUQrvm9uVJTJQs2drj0zDc/bQuLUafjLcAURQZ82B7yFvXL/9QXjMNU+hWiTVQ== dependencies: - "@endo/init" "^0.5.60" - "@endo/stream" "^0.3.29" - ses "^0.18.8" + "@endo/init" "^1.0.1" + "@endo/stream" "^1.0.1" + ses "^1.0.1" -"@endo/stream@^0.3.28", "@endo/stream@^0.3.29": - version "0.3.29" - resolved "https://registry.yarnpkg.com/@endo/stream/-/stream-0.3.29.tgz#f49c24629429a3650ddd0e5e9fb90e36ef44ed0a" - integrity sha512-C850JqDGYsObE0fAC2uUw/IrN3kUpECddiARIGDpe/y3wnWu5fsau52FkGOKY4lno5kyAhfyvZ9MxhigYnXxEg== +"@endo/stream@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@endo/stream/-/stream-1.0.1.tgz#ee3248647a9372ed4d45e42c040eb6ce921393f9" + integrity sha512-Bx4Gbn2wtJXqQbMC6oDdxRaRUhXaxDTHnbIaBB2Op5Klm8j/ekAbQXTvwMBmb85UQ67raXQs1iypVRaFwQ1qJw== dependencies: - "@endo/eventual-send" "^0.17.6" - "@endo/promise-kit" "^0.2.60" - ses "^0.18.8" + "@endo/eventual-send" "^1.0.1" + "@endo/promise-kit" "^1.0.1" + ses "^1.0.1" -"@endo/where@^0.3.5": - version "0.3.5" - resolved "https://registry.yarnpkg.com/@endo/where/-/where-0.3.5.tgz#df7661ec38ab6a327ef050aa88b50555876c39ef" - integrity sha512-y9agS7UWpSY9YSAAYwtn6sAE7zfU2BmYGOUJpw859WcmRt5ufCRi2XAXDcvIugAUPTsSVPqJj6FO3uZNVRmXPw== +"@endo/where@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@endo/where/-/where-1.0.0.tgz#2f3c160623979fce6029a4a7582522ff78f8e5d8" + integrity sha512-l70ByG2Epf66X3dKET8KO9pQc8K4F9YVxvUkoLTGoSYDxvGjDjujNR20qudGGiNpIcjqcLkH3Havaqwv22Q2EA== -"@endo/zip@^0.2.34", "@endo/zip@^0.2.35": - version "0.2.35" - resolved "https://registry.yarnpkg.com/@endo/zip/-/zip-0.2.35.tgz#37a7f9266ca9c9167de5e42b55b0d9c979598d87" - integrity sha512-UM+mMZjBtJf33lXj38xXIEIe1B5wrgg/nT9CHrC8s+Pj/h63eMpQmcJzjL2vMKrvq3Tsj+TDzmQhtYcbrFACqQ== +"@endo/zip@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@endo/zip/-/zip-1.0.0.tgz#af721ae46c9480ee56110c9e88d6d34404b44a77" + integrity sha512-wsw1Jnia9nz9e/UBFSR4Dn5eb7wU6qrMR8HBZ3tQGzzDCtLea0q+b/Ae1H4d9EG1kqnOibKTJvTibX3yex57KA== "@es-joy/jsdoccomment@~0.39.4": version "0.39.4" @@ -3332,7 +3479,7 @@ cbor@^8.1.0: dependencies: nofilter "^3.1.0" -chalk@^2.0.0, chalk@^2.4.1: +chalk@^2.0.0, chalk@^2.4.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -3912,7 +4059,7 @@ debug@2.6.9: dependencies: ms "2.0.0" -debug@4, debug@^4.0.0, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: +debug@4, debug@^4.0.0, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -8752,6 +8899,13 @@ ses@^0.18.8: dependencies: "@endo/env-options" "^0.1.4" +ses@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ses/-/ses-1.0.1.tgz#ede4c688b150ffa4d368679d8c1f8ee57d9e4836" + integrity sha512-iuqGQ1dsktipGgmC/FLL2agq88WcarXxbFDKMEPVyRUxhAhReKpBIO63uDK4IvYYofFJ6FpfhNn/mVTNZpPOCg== + dependencies: + "@endo/env-options" "^1.0.1" + set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -8924,6 +9078,11 @@ source-map-support@^0.5.21: buffer-from "^1.0.0" source-map "^0.6.0" +source-map@0.7.4, source-map@^0.7.4: + version "0.7.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" + integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== + source-map@^0.5.0: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" @@ -8934,11 +9093,6 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -source-map@^0.7.3, source-map@^0.7.4: - version "0.7.4" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" - integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== - sourcemap-codec@^1.4.4: version "1.4.6" resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.6.tgz#e30a74f0402bad09807640d39e971090a08ce1e9" From 2b28332ec050dad05b50519bf4388b3cf779b9b5 Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Wed, 20 Dec 2023 13:38:28 -0800 Subject: [PATCH 46/58] chore: Deduplicate yarn.lock --- yarn.lock | 164 ++++++------------------------------------------------ 1 file changed, 17 insertions(+), 147 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4caa3acbe1a..6f59ebde83c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21,14 +21,7 @@ resolved "https://registry.yarnpkg.com/@agoric/wallet-ui/-/wallet-ui-0.1.3-solo.0.tgz#5f05c3dd2820d4f1efcbccbd2dc1292847ecbd2b" integrity sha512-NbhCrTH9u2af+6ituM99M8Mo10VOP1nQRTZoYEXW+esBwJId/7cRniMmAC7qmkbXs8POA31S8EQ5gAhkWq08WA== -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.16.7", "@babel/code-frame@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" - integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== - dependencies: - "@babel/highlight" "^7.18.6" - -"@babel/code-frame@^7.22.13", "@babel/code-frame@^7.23.5": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.16.7", "@babel/code-frame@^7.18.6", "@babel/code-frame@^7.22.13", "@babel/code-frame@^7.23.5": version "7.23.5" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.23.5.tgz#9009b69a8c602293476ad598ff53e4562e15c244" integrity sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA== @@ -36,17 +29,7 @@ "@babel/highlight" "^7.23.4" chalk "^2.4.2" -"@babel/generator@^7.17.3": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.21.5.tgz#c0c0e5449504c7b7de8236d99338c3e2a340745f" - integrity sha512-SrKK/sRv8GesIW1bDagf9cCG38IOMYZusoe1dfg0D8aiUe3Amvoj1QtjTPAWcfrZFvIwlleLb0gxzQidL9w14w== - dependencies: - "@babel/types" "^7.21.5" - "@jridgewell/gen-mapping" "^0.3.2" - "@jridgewell/trace-mapping" "^0.3.17" - jsesc "^2.5.1" - -"@babel/generator@^7.23.6": +"@babel/generator@^7.17.3", "@babel/generator@^7.23.6": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.6.tgz#9e1fca4811c77a10580d17d26b57b036133f3c2e" integrity sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw== @@ -56,25 +39,12 @@ "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" -"@babel/helper-environment-visitor@^7.16.7": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.21.5.tgz#c769afefd41d171836f7cb63e295bedf689d48ba" - integrity sha512-IYl4gZ3ETsWocUWgsFZLM5i1BYx9SoemminVEXadgLBa9TdeorzgLKm8wWLA6J1N/kT3Kch8XIk1laNzYoHKvQ== - -"@babel/helper-environment-visitor@^7.22.20": +"@babel/helper-environment-visitor@^7.16.7", "@babel/helper-environment-visitor@^7.22.20": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== -"@babel/helper-function-name@^7.16.7": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz#d552829b10ea9f120969304023cd0645fa00b1b4" - integrity sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg== - dependencies: - "@babel/template" "^7.20.7" - "@babel/types" "^7.21.0" - -"@babel/helper-function-name@^7.23.0": +"@babel/helper-function-name@^7.16.7", "@babel/helper-function-name@^7.23.0": version "7.23.0" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== @@ -82,64 +52,31 @@ "@babel/template" "^7.22.15" "@babel/types" "^7.23.0" -"@babel/helper-hoist-variables@^7.16.7": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" - integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-hoist-variables@^7.22.5": +"@babel/helper-hoist-variables@^7.16.7", "@babel/helper-hoist-variables@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== dependencies: "@babel/types" "^7.22.5" -"@babel/helper-split-export-declaration@^7.16.7": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075" - integrity sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-split-export-declaration@^7.22.6": +"@babel/helper-split-export-declaration@^7.16.7", "@babel/helper-split-export-declaration@^7.22.6": version "7.22.6" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== dependencies: "@babel/types" "^7.22.5" -"@babel/helper-string-parser@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.21.5.tgz#2b3eea65443c6bdc31c22d037c65f6d323b6b2bd" - integrity sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w== - -"@babel/helper-string-parser@^7.23.4": +"@babel/helper-string-parser@^7.21.5", "@babel/helper-string-parser@^7.23.4": version "7.23.4" resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== -"@babel/helper-validator-identifier@^7.19.1", "@babel/helper-validator-identifier@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193" - integrity sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ== - -"@babel/helper-validator-identifier@^7.22.20": +"@babel/helper-validator-identifier@^7.19.1", "@babel/helper-validator-identifier@^7.22.20", "@babel/helper-validator-identifier@^7.22.5": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== -"@babel/highlight@^7.18.6": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.5.tgz#aa6c05c5407a67ebce408162b7ede789b4d22031" - integrity sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw== - dependencies: - "@babel/helper-validator-identifier" "^7.22.5" - chalk "^2.0.0" - js-tokens "^4.0.0" - -"@babel/highlight@^7.23.4": +"@babel/highlight@^7.18.6", "@babel/highlight@^7.23.4": version "7.23.4" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b" integrity sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A== @@ -148,12 +85,7 @@ chalk "^2.4.2" js-tokens "^4.0.0" -"@babel/parser@^7.17.3", "@babel/parser@^7.20.7", "@babel/parser@^7.7.0": - version "7.21.8" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.8.tgz#642af7d0333eab9c0ad70b14ac5e76dbde7bfdf8" - integrity sha512-6zavDGdzG3gUqAdWvlLFfk+36RilI+Pwyuuh7HItyeScCWP3k6i8vKclAQ0bM/0y/Kz/xiwvxhMv9MgTJP5gmA== - -"@babel/parser@^7.22.15", "@babel/parser@^7.23.6": +"@babel/parser@^7.17.3", "@babel/parser@^7.20.7", "@babel/parser@^7.22.15", "@babel/parser@^7.23.6", "@babel/parser@^7.7.0": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.6.tgz#ba1c9e512bda72a47e285ae42aff9d2a635a9e3b" integrity sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ== @@ -165,16 +97,7 @@ dependencies: regenerator-runtime "^0.13.11" -"@babel/template@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8" - integrity sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw== - dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/parser" "^7.20.7" - "@babel/types" "^7.20.7" - -"@babel/template@^7.22.15": +"@babel/template@^7.20.7", "@babel/template@^7.22.15": version "7.22.15" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== @@ -183,7 +106,7 @@ "@babel/parser" "^7.22.15" "@babel/types" "^7.22.15" -"@babel/traverse@^7.23.6": +"@babel/traverse@^7.23.6", "@babel/traverse@^7.7.0": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.6.tgz#b53526a2367a0dd6edc423637f3d2d0f2521abc5" integrity sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ== @@ -199,32 +122,7 @@ debug "^4.3.1" globals "^11.1.0" -"@babel/traverse@^7.7.0": - version "7.17.3" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.3.tgz#0ae0f15b27d9a92ba1f2263358ea7c4e7db47b57" - integrity sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.17.3" - "@babel/helper-environment-visitor" "^7.16.7" - "@babel/helper-function-name" "^7.16.7" - "@babel/helper-hoist-variables" "^7.16.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/parser" "^7.17.3" - "@babel/types" "^7.17.0" - debug "^4.1.0" - globals "^11.1.0" - -"@babel/types@^7.17.0", "@babel/types@^7.18.6", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.21.5", "@babel/types@^7.7.0": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.21.5.tgz#18dfbd47c39d3904d5db3d3dc2cc80bedb60e5b6" - integrity sha512-m4AfNvVF2mVC/F7fDEdH2El3HzUg9It/XsCxZiOTTA3m3qYfcSVSbTfM6Q9xG+hYDniZssYhlXKKUMD5m8tF4Q== - dependencies: - "@babel/helper-string-parser" "^7.21.5" - "@babel/helper-validator-identifier" "^7.19.1" - to-fast-properties "^2.0.0" - -"@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.6": +"@babel/types@^7.17.0", "@babel/types@^7.18.6", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.21.5", "@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.6", "@babel/types@^7.7.0": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.6.tgz#be33fdb151e1f5a56877d704492c240fc71c7ccd" integrity sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg== @@ -2545,24 +2443,7 @@ resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== -"@typescript-eslint/eslint-plugin@^6.0.0": - version "6.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.0.tgz#ed2a38867190f8a688af85ad7c8a74670b8b3675" - integrity sha512-gUqtknHm0TDs1LhY12K2NA3Rmlmp88jK9Tx8vGZMfHeNMLE3GH2e9TRub+y+SOjuYgtOmok+wt1AyDPZqxbNag== - dependencies: - "@eslint-community/regexpp" "^4.5.1" - "@typescript-eslint/scope-manager" "6.7.0" - "@typescript-eslint/type-utils" "6.7.0" - "@typescript-eslint/utils" "6.7.0" - "@typescript-eslint/visitor-keys" "6.7.0" - debug "^4.3.4" - graphemer "^1.4.0" - ignore "^5.2.4" - natural-compare "^1.4.0" - semver "^7.5.4" - ts-api-utils "^1.0.1" - -"@typescript-eslint/eslint-plugin@^6.13.2": +"@typescript-eslint/eslint-plugin@^6.0.0", "@typescript-eslint/eslint-plugin@^6.13.2": version "6.13.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.13.2.tgz#2e03506c5362a65e43cb132c37c9ce2d3cb51470" integrity sha512-3+9OGAWHhk4O1LlcwLBONbdXsAhLjyCFogJY/cWy2lxdVJ2JrcTF2pTGMaLl2AE7U1l31n8Py4a8bx5DLf/0dQ== @@ -2579,18 +2460,7 @@ semver "^7.5.4" ts-api-utils "^1.0.1" -"@typescript-eslint/parser@^6.0.0": - version "6.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.7.0.tgz#332fe9c7ecf6783d3250b4c8a960bd4af0995807" - integrity sha512-jZKYwqNpNm5kzPVP5z1JXAuxjtl2uG+5NpaMocFPTNC2EdYIgbXIPImObOkhbONxtFTTdoZstLZefbaK+wXZng== - dependencies: - "@typescript-eslint/scope-manager" "6.7.0" - "@typescript-eslint/types" "6.7.0" - "@typescript-eslint/typescript-estree" "6.7.0" - "@typescript-eslint/visitor-keys" "6.7.0" - debug "^4.3.4" - -"@typescript-eslint/parser@^6.13.2": +"@typescript-eslint/parser@^6.0.0", "@typescript-eslint/parser@^6.13.2": version "6.13.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.13.2.tgz#390b79cc9a57a5f904d197a201cc4b6bc4f9afb9" integrity sha512-MUkcC+7Wt/QOGeVlM8aGGJZy1XV5YKjTpq9jK6r6/iLsGXhBVaGP5N0UYvFsu9BFlSpwY9kMretzdBH01rkRXg== @@ -2673,7 +2543,7 @@ semver "^7.5.4" ts-api-utils "^1.0.1" -"@typescript-eslint/utils@6.13.2": +"@typescript-eslint/utils@6.13.2", "@typescript-eslint/utils@^6.6.0": version "6.13.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.13.2.tgz#8eb89e53adc6d703a879b131e528807245486f89" integrity sha512-b9Ptq4eAZUym4idijCRzl61oPCwwREcfDI8xGk751Vhzig5fFZR9CyzDz4Sp/nxSLBYxUPyh4QdIDqWykFhNmQ== @@ -2686,7 +2556,7 @@ "@typescript-eslint/typescript-estree" "6.13.2" semver "^7.5.4" -"@typescript-eslint/utils@6.7.0", "@typescript-eslint/utils@^6.6.0": +"@typescript-eslint/utils@6.7.0": version "6.7.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.7.0.tgz#61b6f1f1b82ad529abfcee074d21764e880886fb" integrity sha512-MfCq3cM0vh2slSikQYqK2Gq52gvOhe57vD2RM3V4gQRZYX4rDPnKLu5p6cm89+LJiGlwEXU8hkYxhqqEC/V3qA== From b48ccf2d78c3fdbfd12878f681c27ba596e87f41 Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Wed, 20 Dec 2023 13:39:20 -0800 Subject: [PATCH 47/58] chore: Reupdate yarn.lock --- yarn.lock | 83 +++++++++---------------------------------------------- 1 file changed, 13 insertions(+), 70 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6f59ebde83c..824093215f8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21,7 +21,7 @@ resolved "https://registry.yarnpkg.com/@agoric/wallet-ui/-/wallet-ui-0.1.3-solo.0.tgz#5f05c3dd2820d4f1efcbccbd2dc1292847ecbd2b" integrity sha512-NbhCrTH9u2af+6ituM99M8Mo10VOP1nQRTZoYEXW+esBwJId/7cRniMmAC7qmkbXs8POA31S8EQ5gAhkWq08WA== -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.16.7", "@babel/code-frame@^7.18.6", "@babel/code-frame@^7.22.13", "@babel/code-frame@^7.23.5": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.22.13", "@babel/code-frame@^7.23.5": version "7.23.5" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.23.5.tgz#9009b69a8c602293476ad598ff53e4562e15c244" integrity sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA== @@ -29,7 +29,7 @@ "@babel/highlight" "^7.23.4" chalk "^2.4.2" -"@babel/generator@^7.17.3", "@babel/generator@^7.23.6": +"@babel/generator@^7.23.6": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.6.tgz#9e1fca4811c77a10580d17d26b57b036133f3c2e" integrity sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw== @@ -39,12 +39,12 @@ "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" -"@babel/helper-environment-visitor@^7.16.7", "@babel/helper-environment-visitor@^7.22.20": +"@babel/helper-environment-visitor@^7.22.20": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== -"@babel/helper-function-name@^7.16.7", "@babel/helper-function-name@^7.23.0": +"@babel/helper-function-name@^7.23.0": version "7.23.0" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== @@ -52,31 +52,31 @@ "@babel/template" "^7.22.15" "@babel/types" "^7.23.0" -"@babel/helper-hoist-variables@^7.16.7", "@babel/helper-hoist-variables@^7.22.5": +"@babel/helper-hoist-variables@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== dependencies: "@babel/types" "^7.22.5" -"@babel/helper-split-export-declaration@^7.16.7", "@babel/helper-split-export-declaration@^7.22.6": +"@babel/helper-split-export-declaration@^7.22.6": version "7.22.6" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== dependencies: "@babel/types" "^7.22.5" -"@babel/helper-string-parser@^7.21.5", "@babel/helper-string-parser@^7.23.4": +"@babel/helper-string-parser@^7.23.4": version "7.23.4" resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== -"@babel/helper-validator-identifier@^7.19.1", "@babel/helper-validator-identifier@^7.22.20", "@babel/helper-validator-identifier@^7.22.5": +"@babel/helper-validator-identifier@^7.22.20": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== -"@babel/highlight@^7.18.6", "@babel/highlight@^7.23.4": +"@babel/highlight@^7.23.4": version "7.23.4" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b" integrity sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A== @@ -85,7 +85,7 @@ chalk "^2.4.2" js-tokens "^4.0.0" -"@babel/parser@^7.17.3", "@babel/parser@^7.20.7", "@babel/parser@^7.22.15", "@babel/parser@^7.23.6", "@babel/parser@^7.7.0": +"@babel/parser@^7.22.15", "@babel/parser@^7.23.6", "@babel/parser@^7.7.0": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.6.tgz#ba1c9e512bda72a47e285ae42aff9d2a635a9e3b" integrity sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ== @@ -97,7 +97,7 @@ dependencies: regenerator-runtime "^0.13.11" -"@babel/template@^7.20.7", "@babel/template@^7.22.15": +"@babel/template@^7.22.15": version "7.22.15" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== @@ -122,7 +122,7 @@ debug "^4.3.1" globals "^11.1.0" -"@babel/types@^7.17.0", "@babel/types@^7.18.6", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.21.5", "@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.6", "@babel/types@^7.7.0": +"@babel/types@^7.17.0", "@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.6", "@babel/types@^7.7.0": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.6.tgz#be33fdb151e1f5a56877d704492c240fc71c7ccd" integrity sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg== @@ -2479,14 +2479,6 @@ "@typescript-eslint/types" "6.13.2" "@typescript-eslint/visitor-keys" "6.13.2" -"@typescript-eslint/scope-manager@6.7.0": - version "6.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.7.0.tgz#6b3c22187976e2bf5ed0dc0d9095f1f2cbd1d106" - integrity sha512-lAT1Uau20lQyjoLUQ5FUMSX/dS07qux9rYd5FGzKz/Kf8W8ccuvMyldb8hadHdK/qOI7aikvQWqulnEq2nCEYA== - dependencies: - "@typescript-eslint/types" "6.7.0" - "@typescript-eslint/visitor-keys" "6.7.0" - "@typescript-eslint/type-utils@6.13.2": version "6.13.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.13.2.tgz#ebec2da14a6bb7122e0fd31eea72a382c39c6102" @@ -2497,26 +2489,11 @@ debug "^4.3.4" ts-api-utils "^1.0.1" -"@typescript-eslint/type-utils@6.7.0": - version "6.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.7.0.tgz#21a013d4c7f96255f5e64ac59fb41301d1e052ba" - integrity sha512-f/QabJgDAlpSz3qduCyQT0Fw7hHpmhOzY/Rv6zO3yO+HVIdPfIWhrQoAyG+uZVtWAIS85zAyzgAFfyEr+MgBpg== - dependencies: - "@typescript-eslint/typescript-estree" "6.7.0" - "@typescript-eslint/utils" "6.7.0" - debug "^4.3.4" - ts-api-utils "^1.0.1" - "@typescript-eslint/types@6.13.2": version "6.13.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.13.2.tgz#c044aac24c2f6cefb8e921e397acad5417dd0ae6" integrity sha512-7sxbQ+EMRubQc3wTfTsycgYpSujyVbI1xw+3UMRUcrhSy+pN09y/lWzeKDbvhoqcRbHdc+APLs/PWYi/cisLPg== -"@typescript-eslint/types@6.7.0": - version "6.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.7.0.tgz#8de8ba9cafadc38e89003fe303e219c9250089ae" - integrity sha512-ihPfvOp7pOcN/ysoj0RpBPOx3HQTJTrIN8UZK+WFd3/iDeFHHqeyYxa4hQk4rMhsz9H9mXpR61IzwlBVGXtl9Q== - "@typescript-eslint/typescript-estree@6.13.2": version "6.13.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.13.2.tgz#ae556ee154c1acf025b48d37c3ef95a1d55da258" @@ -2530,19 +2507,6 @@ semver "^7.5.4" ts-api-utils "^1.0.1" -"@typescript-eslint/typescript-estree@6.7.0": - version "6.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.0.tgz#20ce2801733bd46f02cc0f141f5b63fbbf2afb63" - integrity sha512-dPvkXj3n6e9yd/0LfojNU8VMUGHWiLuBZvbM6V6QYD+2qxqInE7J+J/ieY2iGwR9ivf/R/haWGkIj04WVUeiSQ== - dependencies: - "@typescript-eslint/types" "6.7.0" - "@typescript-eslint/visitor-keys" "6.7.0" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - semver "^7.5.4" - ts-api-utils "^1.0.1" - "@typescript-eslint/utils@6.13.2", "@typescript-eslint/utils@^6.6.0": version "6.13.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.13.2.tgz#8eb89e53adc6d703a879b131e528807245486f89" @@ -2556,19 +2520,6 @@ "@typescript-eslint/typescript-estree" "6.13.2" semver "^7.5.4" -"@typescript-eslint/utils@6.7.0": - version "6.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.7.0.tgz#61b6f1f1b82ad529abfcee074d21764e880886fb" - integrity sha512-MfCq3cM0vh2slSikQYqK2Gq52gvOhe57vD2RM3V4gQRZYX4rDPnKLu5p6cm89+LJiGlwEXU8hkYxhqqEC/V3qA== - dependencies: - "@eslint-community/eslint-utils" "^4.4.0" - "@types/json-schema" "^7.0.12" - "@types/semver" "^7.5.0" - "@typescript-eslint/scope-manager" "6.7.0" - "@typescript-eslint/types" "6.7.0" - "@typescript-eslint/typescript-estree" "6.7.0" - semver "^7.5.4" - "@typescript-eslint/visitor-keys@6.13.2": version "6.13.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.13.2.tgz#e0a4a80cf842bb08e6127b903284166ac4a5594c" @@ -2577,14 +2528,6 @@ "@typescript-eslint/types" "6.13.2" eslint-visitor-keys "^3.4.1" -"@typescript-eslint/visitor-keys@6.7.0": - version "6.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.0.tgz#34140ac76dfb6316d17012e4469acf3366ad3f44" - integrity sha512-/C1RVgKFDmGMcVGeD8HjKv2bd72oI1KxQDeY8uc66gw9R0OK0eMq48cA+jv9/2Ag6cdrsUGySm1yzYmfz0hxwQ== - dependencies: - "@typescript-eslint/types" "6.7.0" - eslint-visitor-keys "^3.4.1" - "@yarnpkg/lockfile@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" @@ -3349,7 +3292,7 @@ cbor@^8.1.0: dependencies: nofilter "^3.1.0" -chalk@^2.0.0, chalk@^2.4.1, chalk@^2.4.2: +chalk@^2.4.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== From 552cdda7d6e376483334a5429fdf80b6711624ee Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Wed, 20 Dec 2023 13:40:14 -0800 Subject: [PATCH 48/58] chore: Bump xsnap meter type --- packages/xsnap/api.js | 2 +- packages/xsnap/test/test-xs-perf.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/xsnap/api.js b/packages/xsnap/api.js index 04ce1386053..94434428a5b 100644 --- a/packages/xsnap/api.js +++ b/packages/xsnap/api.js @@ -7,7 +7,7 @@ * Also, update golden master test/test-xs-perf.js to reflect new meter * version. */ -export const METER_TYPE = 'xs-meter-22'; +export const METER_TYPE = 'xs-meter-23'; export const ExitCode = { E_UNKNOWN_ERROR: -1, diff --git a/packages/xsnap/test/test-xs-perf.js b/packages/xsnap/test/test-xs-perf.js index faca9de7609..40188e7f77c 100644 --- a/packages/xsnap/test/test-xs-perf.js +++ b/packages/xsnap/test/test-xs-perf.js @@ -61,7 +61,7 @@ test('meter details', async t => { }, 'evaluate returns meter details', ); - t.is(meterType, 'xs-meter-22'); + t.is(meterType, 'xs-meter-23'); }); // test disabled until rewritten to tolerate fast CI hosts getting From 157e0e5d838f9f02bff3f565fb4ae05bb5bfec27 Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Wed, 20 Dec 2023 13:41:29 -0800 Subject: [PATCH 49/58] chore(swingset-vat): Update xsnap store test snapshots --- .../test/snapshots/test-xsnap-store.js.md | 8 ++++---- .../test/snapshots/test-xsnap-store.js.snap | Bin 504 -> 503 bytes 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/SwingSet/test/snapshots/test-xsnap-store.js.md b/packages/SwingSet/test/snapshots/test-xsnap-store.js.md index 93e1312c60e..d2df2fce6f7 100644 --- a/packages/SwingSet/test/snapshots/test-xsnap-store.js.md +++ b/packages/SwingSet/test/snapshots/test-xsnap-store.js.md @@ -20,8 +20,8 @@ Generated by [AVA](https://avajs.dev). { compressSeconds: 0, dbSaveSeconds: 0, - hash: 'f44205908c32d4013e8f72ecf61d14d6e4a3799c7684562b14542c3a172cb2da', - uncompressedSize: 780707, + hash: 'ca5dca976b5691999e936f3c6fbfb16e85c45b6fc15471106390b245ed8db5f9', + uncompressedSize: 781363, } > after use of harden() - sensitive to SES-shim, XS, and supervisor @@ -29,6 +29,6 @@ Generated by [AVA](https://avajs.dev). { compressSeconds: 0, dbSaveSeconds: 0, - hash: '0389ff81a632fe0e37e2319a1152e2799fe1c2e45fcacccedec38a772d92747e', - uncompressedSize: 780867, + hash: 'cd60cb92856ec37ee649f2b5fe234a2adf6e132bcbb143304bf0ceb965623388', + uncompressedSize: 781523, } diff --git a/packages/SwingSet/test/snapshots/test-xsnap-store.js.snap b/packages/SwingSet/test/snapshots/test-xsnap-store.js.snap index c376de1c8f2d0af25b5995f524de46b16c97dc3b..154757f44b8952eb0e321a61dfc1c4aa3b392bae 100644 GIT binary patch literal 503 zcmV9NP0 zVQ=@e_C*mLqNC#x$gA)OJOm97fi9<9kphJ>ZpI${H5&co9|60;eM(<$D97B<_3O)) zzvAuNmZ#pX({jj(+mU!T^dA}nprPPuedY^9l zQ@EEp_So7h`e$akv}t+wxIiL-O+|#>lXS|7x|RWr!kPj#jcBS+dnawMXbO~6kZP>= zN_ve=>Fy1mZTh=K$+z({?RJ>_{C+^4Me5eEk2%_I5Bu1_oK@agQ)^V(l*Sk`LI>e= zz<{NuMmeca2UjXtmt~=aDX@}?eB)6C^FT21=h+VI`rL+0FJAr+@n7`2LSj1v006ds_mBVp literal 504 zcmVD!!yyDl0AzsY$e4tpubu{~xN zHoMW zU(@P+MMDS6Q1>xV7?8Go_h}Y!SWt(X)^tsXjcxX>Z@11tgpXu8%ARDKB2UTTS?cFW zKIwbXucYVXXiAPgn9pb#fh{9-&Xq-c73oDe8-jsz==uvB-xmV6g@L8}POrZ9PqxEy< zSb~BQgeps`=2{kWZkQ}2w*r{r)^G<81oq?ivn{a8Gw>;DcVRSrAL)z+>_URLMjHFg zeirIxaY`?$Qwp7 Date: Wed, 20 Dec 2023 17:34:12 -0800 Subject: [PATCH 50/58] refactor(zoe): Remove accommodation for old interface guard error messages --- packages/zoe/test/unitTests/test-zoe.js | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/packages/zoe/test/unitTests/test-zoe.js b/packages/zoe/test/unitTests/test-zoe.js index 2ceaaf2fe1c..c2937823ea2 100644 --- a/packages/zoe/test/unitTests/test-zoe.js +++ b/packages/zoe/test/unitTests/test-zoe.js @@ -143,10 +143,7 @@ test(`E(zoe).getPublicFacet - no instance`, async t => { // @ts-expect-error deliberate invalid arguments for testing await t.throwsAsync(() => E(zoe).getPublicFacet(), { message: - // Golden test uses RegExp "Or" pattern to tolerate earlier versions of - // Endo. - // TODO: Remove first disjunct once no longer needed - /In "getPublicFacet" method of \(ZoeService\): (?:arg 0: .*"\[undefined\]" - Must be a remotable|Expected at least 1 arguments: \[\])/, + /In "getPublicFacet" method of \(ZoeService\): Expected at least 1 arguments: \[\]/, }); }); @@ -177,10 +174,7 @@ test(`zoe.getIssuers - no instance`, async t => { // @ts-expect-error invalid arguments for testing await t.throwsAsync(() => E(zoe).getIssuers(), { message: - // Golden test uses RegExp "Or" pattern to tolerate earlier versions of - // Endo. - // TODO: Remove first disjunct once no longer needed - /In "getIssuers" method of \(ZoeService\): (?:arg 0: .*"\[undefined\]" - Must be a remotable|Expected at least 1 arguments: \[\])/, + /In "getIssuers" method of \(ZoeService\): Expected at least 1 arguments: \[\]/, }); }); @@ -211,9 +205,7 @@ test(`zoe.getBrands - no instance`, async t => { // @ts-expect-error invalid arguments for testing await t.throwsAsync(() => E(zoe).getBrands(), { message: - // Or pattern of golden error tolerant across versions of endo. - // TODO: Remove first disjunct once no longer needed - /In "getBrands" method of \(ZoeService\): (?:arg 0: .*"\[undefined\]" - Must be a remotable|Expected at least 1 arguments: \[\])/, + /In "getBrands" method of \(ZoeService\): Expected at least 1 arguments: \[\]/, }); }); @@ -269,9 +261,7 @@ test(`zoe.getTerms - no instance`, async t => { // @ts-expect-error invalid arguments for testing await t.throwsAsync(() => E(zoe).getTerms(), { message: - // Or pattern of golden error tolerant across versions of endo. - // TODO: Remove first disjunct once no longer needed - /In "getTerms" method of \(ZoeService\): (?:arg 0: .*"\[undefined\]" - Must be a remotable|Expected at least 1 arguments: \[\])/, + /In "getTerms" method of \(ZoeService\): Expected at least 1 arguments: \[\]/, }); }); From d2914ff11b2c8e0c4c5825fbc8575576eaed68ad Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Tue, 12 Dec 2023 14:42:49 -0800 Subject: [PATCH 51/58] chore(types): import Far, Guarded, GuardedKit --- packages/internal/src/callback.js | 6 ++---- packages/vat-data/src/exo-utils.js | 30 ++++++++++++++++++------------ packages/zone/src/durable.js | 4 ---- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/packages/internal/src/callback.js b/packages/internal/src/callback.js index 20668739d79..e2ef9e1b806 100644 --- a/packages/internal/src/callback.js +++ b/packages/internal/src/callback.js @@ -14,8 +14,8 @@ const ownKeys = ); /** - * @template T - * @typedef {(...args: Parameters>) => Farable} MakeAttenuator + * @template {import('@endo/exo/src/exo-makers.js').Methods} T + * @typedef {(...args: Parameters>) => import('@endo/exo/src/exo-makers.js').Farable} MakeAttenuator */ /** @@ -28,8 +28,6 @@ const ownKeys = * @typedef {import('./types.js').SyncCallback} SyncCallback */ -/** @template T @typedef {import('@endo/eventual-send').RemotableBrand<{}, T> & T} Farable */ - /** * @param {unknown} key * @returns {key is PropertyKey} FIXME: should be just `PropertyKey` but TS diff --git a/packages/vat-data/src/exo-utils.js b/packages/vat-data/src/exo-utils.js index bde60c8f56a..96c6827950d 100644 --- a/packages/vat-data/src/exo-utils.js +++ b/packages/vat-data/src/exo-utils.js @@ -1,5 +1,5 @@ // @jessie-check - +/* eslint-disable @typescript-eslint/prefer-ts-expect-error -- for casting from deprecated types that aren't worth fixing */ import { initEmpty } from '@agoric/store'; import { provide, VatData as globalVatData } from './vat-data-bindings.js'; @@ -31,6 +31,7 @@ export const ignoreContext = harden(ignoreContext); // TODO: Find a good home for this function used by @agoric/vat-data and testing code +/** @param {import('@agoric/swingset-liveslots').VatData} VatData */ export const makeExoUtils = VatData => { const { defineKind, @@ -101,9 +102,11 @@ export const makeExoUtils = VatData => { * self: T, * state: ReturnType * }>} [options] - * @returns {(...args: Parameters) => (T & RemotableBrand<{}, T>)} + * @returns {(...args: Parameters) => import('@endo/exo/src/exo-makers.js').Guarded} */ const defineVirtualExoClass = (tag, interfaceGuard, init, methods, options) => + // eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error + // @ts-ignore cast defineKind(tag, init, methods, { ...options, thisfulMethods: true, @@ -118,14 +121,14 @@ export const makeExoUtils = VatData => { * @param {InterfaceGuardKit | undefined} interfaceGuardKit * @param {I} init * @param {T & ThisType<{ - * facets: T, + * facets: import('@endo/exo/src/exo-makers.js').GuardedKit, * state: ReturnType * }> } facets * @param {DefineKindOptions<{ * facets: T, * state: ReturnType * }>} [options] - * @returns {(...args: Parameters) => (T & RemotableBrand<{}, T>)} + * @returns {(...args: Parameters) => import('@endo/exo/src/exo-makers.js').GuardedKit} */ const defineVirtualExoClassKit = ( tag, @@ -134,6 +137,7 @@ export const makeExoUtils = VatData => { facets, options, ) => + // @ts-ignore cast defineKindMulti(tag, init, facets, { ...options, thisfulMethods: true, @@ -155,7 +159,7 @@ export const makeExoUtils = VatData => { * self: T, * state: ReturnType * }>} [options] - * @returns {(...args: Parameters) => (T & RemotableBrand<{}, T>)} + * @returns {(...args: Parameters) => import('@endo/exo/src/exo-makers.js').Guarded} */ const defineDurableExoClass = ( kindHandle, @@ -164,6 +168,7 @@ export const makeExoUtils = VatData => { methods, options, ) => + // @ts-ignore cast defineDurableKind(kindHandle, init, methods, { ...options, thisfulMethods: true, @@ -178,14 +183,14 @@ export const makeExoUtils = VatData => { * @param {InterfaceGuardKit | undefined} interfaceGuardKit * @param {I} init * @param {T & ThisType<{ - * facets: T, + * facets: import('@endo/exo/src/exo-makers.js').GuardedKit, * state: ReturnType * }> } facets * @param {DefineKindOptions<{ * facets: T, * state: ReturnType * }>} [options] - * @returns {(...args: Parameters) => (T & RemotableBrand<{}, T>)} + * @returns {(...args: Parameters) => import('@endo/exo/src/exo-makers.js').GuardedKit} */ const defineDurableExoClassKit = ( kindHandle, @@ -194,6 +199,7 @@ export const makeExoUtils = VatData => { facets, options, ) => + // @ts-ignore cast defineDurableKindMulti(kindHandle, init, facets, { ...options, thisfulMethods: true, @@ -216,7 +222,7 @@ export const makeExoUtils = VatData => { * self: T, * state: ReturnType * }>} [options] - * @returns {(...args: Parameters) => (T & RemotableBrand<{}, T>)} + * @returns {(...args: Parameters) => import('@endo/exo/src/exo-makers.js').Guarded} */ const prepareExoClass = ( baggage, @@ -243,14 +249,14 @@ export const makeExoUtils = VatData => { * @param {InterfaceGuardKit | undefined} interfaceGuardKit * @param {I} init * @param {T & ThisType<{ - * facets: T, + * facets: import('@endo/exo/src/exo-makers.js').GuardedKit, * state: ReturnType * }> } facets * @param {DefineKindOptions<{ * facets: T, * state: ReturnType * }>} [options] - * @returns {(...args: Parameters) => (T & RemotableBrand<{}, T>)} + * @returns {(...args: Parameters) => import('@endo/exo/src/exo-makers.js').GuardedKit} */ const prepareExoClassKit = ( baggage, @@ -276,7 +282,7 @@ export const makeExoUtils = VatData => { * @param {InterfaceGuard | undefined} interfaceGuard * @param {M} methods * @param {DefineKindOptions<{ self: M }>} [options] - * @returns {M & RemotableBrand<{}, M>} + * @returns {import('@endo/exo/src/exo-makers.js').Guarded} */ const prepareExo = ( baggage, @@ -305,7 +311,7 @@ export const makeExoUtils = VatData => { * @param {string} kindName * @param {M} methods * @param {DefineKindOptions<{ self: M }>} [options] - * @returns {M & RemotableBrand<{}, M>} + * @returns {import('@endo/exo/src/exo-makers.js').Guarded} */ const prepareSingleton = (baggage, kindName, methods, options = undefined) => prepareExo(baggage, kindName, undefined, methods, options); diff --git a/packages/zone/src/durable.js b/packages/zone/src/durable.js index a8460f43935..22cfe4b733a 100644 --- a/packages/zone/src/durable.js +++ b/packages/zone/src/durable.js @@ -89,10 +89,6 @@ export const makeDurableZone = (baggage, baseLabel = 'durableZone') => { /** @type {import('.').Zone['exoClass']} */ const exoClass = (...args) => prepareExoClass(baggage, ...args); /** @type {import('.').Zone['exoClassKit']} */ - // @ts-ignore This type check regressed inexplicably with the release - // following after @endo/exo@0.2.6. - // The lint error does not occur in local lint, but does in integration with - // @agoric/vats, so can not be suppressed with ts-expect-error. const exoClassKit = (...args) => prepareExoClassKit(baggage, ...args); /** @type {import('.').Zone['exo']} */ const exo = (...args) => prepareExo(baggage, ...args); From 41aeba3d65f3bfff574889abb47fe821414d7ee8 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 21 Dec 2023 14:40:19 -0500 Subject: [PATCH 52/58] chore(types): deprecate provideKindHandle Used only for the defineKind* methods, which are already deprecated --- packages/vat-data/src/exo-utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/vat-data/src/exo-utils.js b/packages/vat-data/src/exo-utils.js index 96c6827950d..f175f05fe21 100644 --- a/packages/vat-data/src/exo-utils.js +++ b/packages/vat-data/src/exo-utils.js @@ -42,6 +42,7 @@ export const makeExoUtils = VatData => { } = VatData; /** + * @deprecated Use Exos/ExoClasses instead of Kinds * @param {Baggage} baggage * @param {string} kindName * @returns {DurableKindHandle} @@ -325,8 +326,8 @@ export const makeExoUtils = VatData => { prepareExoClass, prepareExoClassKit, prepareExo, - prepareSingleton, + prepareSingleton, provideKindHandle, prepareKind, prepareKindMulti, From 990a79deaeaf956ea0076dba1c19305677ec8124 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Tue, 12 Dec 2023 14:59:25 -0800 Subject: [PATCH 53/58] feat(guard): tighten roundsManager --- .../inter-protocol/src/price/roundsManager.js | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/packages/inter-protocol/src/price/roundsManager.js b/packages/inter-protocol/src/price/roundsManager.js index 8d80b8017ef..32e58536b3b 100644 --- a/packages/inter-protocol/src/price/roundsManager.js +++ b/packages/inter-protocol/src/price/roundsManager.js @@ -1,7 +1,7 @@ import { Fail, q } from '@agoric/assert'; import { AmountMath } from '@agoric/ertp'; import { makeTracer } from '@agoric/internal'; -import { TimeMath } from '@agoric/time'; +import { TimeMath, TimestampShape } from '@agoric/time'; import { M, makeScalarBigMapStore, prepareExoClassKit } from '@agoric/vat-data'; import { calculateMedian, @@ -98,21 +98,25 @@ export const prepareRoundsManagerKit = baggage => 'RoundsManager', { helper: UnguardedHelperI, - contract: M.interface( - 'contract', - { - authenticateQuote: M.call().rest(M.any()).returns(M.any()), - makeCreateQuote: M.call().rest(M.any()).returns(M.any()), - eligibleForSpecificRound: M.call().rest(M.any()).returns(M.boolean()), - getRoundData: M.call().rest(M.any()).returns(M.promise()), - getRoundStatus: M.call().rest(M.any()).returns(M.record()), - oracleRoundStateSuggestRound: M.call() - .rest(M.any()) - .returns(M.record()), - }, - // TODO(6571) stop sloppy - { sloppy: true }, - ), + contract: M.interface('contract', { + authenticateQuote: M.call([M.record()]).returns(M.any()), + makeCreateQuote: M.call() + .optional({ + overrideValueOut: M.number(), + timestamp: TimestampShape, + }) + .returns(M.any()), + eligibleForSpecificRound: M.call( + M.any(), + M.bigint(), + TimestampShape, + ).returns(M.boolean()), + getRoundData: M.call(M.any()).returns(M.promise()), + getRoundStatus: M.call(M.bigint()).returns(M.record()), + oracleRoundStateSuggestRound: M.call(M.any(), TimestampShape).returns( + M.record(), + ), + }), oracle: M.interface('oracle', { handlePush: M.call(M.record(), M.record()).returns(M.promise()), }), From a0d8229524d8a940c56d28309f67881557bc1ad3 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Sun, 24 Dec 2023 01:46:03 -0500 Subject: [PATCH 54/58] chore(golang): Clarify error messages (#8677) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- golang/cosmos/x/swingset/client/cli/tx.go | 2 +- golang/cosmos/x/swingset/keeper/querier.go | 2 +- golang/cosmos/x/swingset/types/types.go | 31 +++++++++++----------- golang/cosmos/x/vbank/keeper/querier.go | 2 +- golang/cosmos/x/vstorage/keeper/querier.go | 2 +- 5 files changed, 19 insertions(+), 20 deletions(-) diff --git a/golang/cosmos/x/swingset/client/cli/tx.go b/golang/cosmos/x/swingset/client/cli/tx.go index 365dcd2139f..af44a3d4dd4 100644 --- a/golang/cosmos/x/swingset/client/cli/tx.go +++ b/golang/cosmos/x/swingset/client/cli/tx.go @@ -229,7 +229,7 @@ func NewCmdSubmitCoreEvalProposal() *cobra.Command { Specify at least one pair of permit.json and code.js files`, RunE: func(cmd *cobra.Command, args []string) error { if len(args)%2 != 0 { - return fmt.Errorf("must specify an even number of permit.json and code.js files") + return fmt.Errorf("must specify paired permit.json and code.js files") } clientCtx, err := client.GetClientTxContext(cmd) diff --git a/golang/cosmos/x/swingset/keeper/querier.go b/golang/cosmos/x/swingset/keeper/querier.go index 005bcf57895..32fc1e622f6 100644 --- a/golang/cosmos/x/swingset/keeper/querier.go +++ b/golang/cosmos/x/swingset/keeper/querier.go @@ -44,7 +44,7 @@ func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier case LegacyQueryKeys: return legacyQueryKeys(ctx, strings.Join(path[1:], "/"), req, keeper, legacyQuerierCdc) default: - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "unknown swingset query endpoint") + return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "unknown swingset query path") } } } diff --git a/golang/cosmos/x/swingset/types/types.go b/golang/cosmos/x/swingset/types/types.go index 1a8ddfc7b42..b22defd0303 100644 --- a/golang/cosmos/x/swingset/types/types.go +++ b/golang/cosmos/x/swingset/types/types.go @@ -3,6 +3,7 @@ package types import ( "encoding/json" "errors" + "fmt" vstoragetypes "github.com/Agoric/agoric-sdk/golang/cosmos/x/vstorage/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -25,18 +26,16 @@ func NewEgress(nickname string, peer sdk.AccAddress, powerFlags []string) *Egres } } -// FIXME: Should have @endo/nat +// Nat is analogous to @endo/nat +// https://github.com/endojs/endo/blob/master/packages/nat func Nat(num float64) (uint64, error) { - if num < 0 { - return 0, errors.New("Not a natural") - } - - nat := uint64(num) - if float64(nat) != num { - return 0, errors.New("Not a precise integer") + if 0 <= num && num < (1<<53) { + nat := uint64(num) + if float64(nat) == num { + return nat, nil + } } - - return nat, nil + return 0, errors.New("Not a Nat") } type Messages struct { @@ -60,11 +59,11 @@ func UnmarshalMessagesJSON(jsonString string) (ret *Messages, err error) { ackFloat, ok := packet[1].(float64) if !ok { - return nil, errors.New("Ack is not an integer") + return nil, errors.New("Ack is not a number") } ret.Ack, err = Nat(ackFloat) if err != nil { - return nil, err + return nil, errors.New("Ack is not a Nat") } msgs, ok := packet[0].([]interface{}) @@ -77,21 +76,21 @@ func UnmarshalMessagesJSON(jsonString string) (ret *Messages, err error) { for i, rawMsg := range msgs { arrMsg, ok := rawMsg.([]interface{}) if !ok || len(arrMsg) != 2 { - return nil, errors.New("Message is not a pair") + return nil, fmt.Errorf("Messages[%d] is not a pair", i) } numFloat, ok := arrMsg[0].(float64) if !ok { - return nil, errors.New("Message Num is not an integer") + return nil, fmt.Errorf("Messages[%d] Num is not a number", i) } ret.Nums[i], err = Nat(numFloat) if err != nil { - return nil, errors.New("Message num is not a Nat") + return nil, fmt.Errorf("Messages[%d] Num is not a Nat", i) } ret.Messages[i], ok = arrMsg[1].(string) if !ok { - return nil, errors.New("Message is not a string") + return nil, fmt.Errorf("Messages[%d] body is not a string", i) } } diff --git a/golang/cosmos/x/vbank/keeper/querier.go b/golang/cosmos/x/vbank/keeper/querier.go index 8b0735c7cf1..b69b9d7bcb1 100644 --- a/golang/cosmos/x/vbank/keeper/querier.go +++ b/golang/cosmos/x/vbank/keeper/querier.go @@ -23,7 +23,7 @@ func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { return queryState(ctx, path[1:], req, k, legacyQuerierCdc) default: - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unknown query path: %s", path[0]) + return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unknown vbank query path") } } } diff --git a/golang/cosmos/x/vstorage/keeper/querier.go b/golang/cosmos/x/vstorage/keeper/querier.go index 9da34af3214..f9180fabc54 100644 --- a/golang/cosmos/x/vstorage/keeper/querier.go +++ b/golang/cosmos/x/vstorage/keeper/querier.go @@ -51,7 +51,7 @@ func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier } return queryChildren(ctx, entryPath, req, keeper, legacyQuerierCdc) default: - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "unknown vstorage query endpoint") + return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "unknown vstorage query path") } } } From cbb83187f173a0be51a5a83b9e64958e5f7fe8d2 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Sat, 30 Dec 2023 09:42:52 -0500 Subject: [PATCH 55/58] chore(types): drop superfluous types-ambient --- .../inter-protocol/test/smartWallet/test-psm-integration.js | 1 - packages/smart-wallet/test/supports.js | 1 - packages/smart-wallet/test/test-startWalletFactory.js | 2 -- packages/smart-wallet/test/test-walletFactory.js | 2 -- packages/vats/src/bridge.js | 1 - 5 files changed, 7 deletions(-) diff --git a/packages/inter-protocol/test/smartWallet/test-psm-integration.js b/packages/inter-protocol/test/smartWallet/test-psm-integration.js index 1b0f0bddb80..7037d537da8 100644 --- a/packages/inter-protocol/test/smartWallet/test-psm-integration.js +++ b/packages/inter-protocol/test/smartWallet/test-psm-integration.js @@ -1,7 +1,6 @@ import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js'; import { AmountMath, makeIssuerKit } from '@agoric/ertp'; -import '@agoric/vats/src/core/types-ambient.js'; import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js'; import { E } from '@endo/far'; import { NonNullish } from '@agoric/assert'; diff --git a/packages/smart-wallet/test/supports.js b/packages/smart-wallet/test/supports.js index 2d1546880f4..867dfa5860f 100644 --- a/packages/smart-wallet/test/supports.js +++ b/packages/smart-wallet/test/supports.js @@ -11,7 +11,6 @@ import { makeBoard, } from '@agoric/vats/src/core/basic-behaviors.js'; import { setupClientManager } from '@agoric/vats/src/core/chain-behaviors.js'; -import '@agoric/vats/src/core/types-ambient.js'; import { buildRootObject as boardRoot } from '@agoric/vats/src/vat-board.js'; import { buildRootObject as mintsRoot } from '@agoric/vats/src/vat-mints.js'; import { makeFakeBankKit } from '@agoric/vats/tools/bank-utils.js'; diff --git a/packages/smart-wallet/test/test-startWalletFactory.js b/packages/smart-wallet/test/test-startWalletFactory.js index 1327dadf2ff..03fb0b73814 100644 --- a/packages/smart-wallet/test/test-startWalletFactory.js +++ b/packages/smart-wallet/test/test-startWalletFactory.js @@ -6,8 +6,6 @@ import { E } from '@endo/far'; import path from 'path'; import { makeMockTestSpace } from './supports.js'; -import '@agoric/vats/src/core/types-ambient.js'; - /** @type {import('ava').TestFn>>} */ const test = anyTest; diff --git a/packages/smart-wallet/test/test-walletFactory.js b/packages/smart-wallet/test/test-walletFactory.js index 7ad379d81ad..ac81330b115 100644 --- a/packages/smart-wallet/test/test-walletFactory.js +++ b/packages/smart-wallet/test/test-walletFactory.js @@ -11,8 +11,6 @@ import { topicPath, } from './supports.js'; -import '@agoric/vats/src/core/types-ambient.js'; - /** @type {import('ava').TestFn>>} */ const test = anyTest; diff --git a/packages/vats/src/bridge.js b/packages/vats/src/bridge.js index 9de5e59cf09..6cf236e6c7d 100644 --- a/packages/vats/src/bridge.js +++ b/packages/vats/src/bridge.js @@ -1,7 +1,6 @@ import { M } from '@agoric/store'; import '@agoric/store/exported.js'; import { E } from '@endo/far'; -import './core/types-ambient.js'; const { Fail, details: X } = assert; From e366fab72c7c4417ebb1df9e3f3d2a514dd5a5fe Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Sat, 30 Dec 2023 09:47:14 -0500 Subject: [PATCH 56/58] chore(types): refresh coverage threshold --- packages/ERTP/package.json | 2 +- packages/SwingSet/package.json | 2 +- packages/agoric-cli/package.json | 2 +- packages/boot/package.json | 2 +- packages/builders/package.json | 2 +- packages/casting/package.json | 2 +- packages/cosmic-swingset/package.json | 2 +- packages/deploy-script-support/package.json | 2 +- packages/deployment/package.json | 2 +- packages/governance/package.json | 2 +- packages/inter-protocol/package.json | 2 +- packages/internal/package.json | 2 +- packages/pegasus/package.json | 2 +- packages/smart-wallet/package.json | 2 +- packages/solo/package.json | 2 +- packages/swing-store/package.json | 2 +- packages/swingset-liveslots/package.json | 2 +- packages/vat-data/package.json | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/ERTP/package.json b/packages/ERTP/package.json index 301dfb70ad2..bb62821c182 100644 --- a/packages/ERTP/package.json +++ b/packages/ERTP/package.json @@ -84,6 +84,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 90.37 + "atLeast": 90.6 } } diff --git a/packages/SwingSet/package.json b/packages/SwingSet/package.json index a54b1fb7191..0b9c5008460 100644 --- a/packages/SwingSet/package.json +++ b/packages/SwingSet/package.json @@ -100,6 +100,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 75.26 + "atLeast": 75.36 } } diff --git a/packages/agoric-cli/package.json b/packages/agoric-cli/package.json index 07051578283..c4b289b7da6 100644 --- a/packages/agoric-cli/package.json +++ b/packages/agoric-cli/package.json @@ -96,6 +96,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 77.53 + "atLeast": 77.42 } } diff --git a/packages/boot/package.json b/packages/boot/package.json index 04057d845e7..efa7fefd568 100644 --- a/packages/boot/package.json +++ b/packages/boot/package.json @@ -84,6 +84,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 85.68 + "atLeast": 88.05 } } diff --git a/packages/builders/package.json b/packages/builders/package.json index 8c125767897..5b603d062f2 100644 --- a/packages/builders/package.json +++ b/packages/builders/package.json @@ -80,6 +80,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 67.19 + "atLeast": 67.05 } } diff --git a/packages/casting/package.json b/packages/casting/package.json index 49b4d639518..f496ebed07b 100644 --- a/packages/casting/package.json +++ b/packages/casting/package.json @@ -60,6 +60,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 88.12 + "atLeast": 88.07 } } diff --git a/packages/cosmic-swingset/package.json b/packages/cosmic-swingset/package.json index ae8f557f1d5..bf6ccc99e4e 100644 --- a/packages/cosmic-swingset/package.json +++ b/packages/cosmic-swingset/package.json @@ -67,6 +67,6 @@ "timeout": "20m" }, "typeCoverage": { - "atLeast": 79.4 + "atLeast": 79.32 } } diff --git a/packages/deploy-script-support/package.json b/packages/deploy-script-support/package.json index 5cb257d78d4..a7982099ad1 100644 --- a/packages/deploy-script-support/package.json +++ b/packages/deploy-script-support/package.json @@ -73,6 +73,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 79.84 + "atLeast": 80.06 } } diff --git a/packages/deployment/package.json b/packages/deployment/package.json index abd4f5eaebd..9f259308226 100644 --- a/packages/deployment/package.json +++ b/packages/deployment/package.json @@ -37,6 +37,6 @@ "readline-transform": "^1.0.0" }, "typeCoverage": { - "atLeast": 61.49 + "atLeast": 60.14 } } diff --git a/packages/governance/package.json b/packages/governance/package.json index f45e3d6bd57..9283fa6ccc4 100644 --- a/packages/governance/package.json +++ b/packages/governance/package.json @@ -76,6 +76,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 83.56 + "atLeast": 82.81 } } diff --git a/packages/inter-protocol/package.json b/packages/inter-protocol/package.json index 722259a384c..a9fb3a4d3cf 100644 --- a/packages/inter-protocol/package.json +++ b/packages/inter-protocol/package.json @@ -83,6 +83,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 93.45 + "atLeast": 93.49 } } diff --git a/packages/internal/package.json b/packages/internal/package.json index 96cfe7c9344..0e22ee5b77a 100755 --- a/packages/internal/package.json +++ b/packages/internal/package.json @@ -50,6 +50,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 92.26 + "atLeast": 92.28 } } diff --git a/packages/pegasus/package.json b/packages/pegasus/package.json index 04dd7bcf4b1..2c029d38929 100644 --- a/packages/pegasus/package.json +++ b/packages/pegasus/package.json @@ -68,6 +68,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 90.04 + "atLeast": 89.97 } } diff --git a/packages/smart-wallet/package.json b/packages/smart-wallet/package.json index 35a30427ac9..8dd64017617 100644 --- a/packages/smart-wallet/package.json +++ b/packages/smart-wallet/package.json @@ -67,6 +67,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 86.97 + "atLeast": 86.91 } } diff --git a/packages/solo/package.json b/packages/solo/package.json index 549cdb0222d..d4fbe1c7aa1 100644 --- a/packages/solo/package.json +++ b/packages/solo/package.json @@ -78,6 +78,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 68.59 + "atLeast": 68.72 } } diff --git a/packages/swing-store/package.json b/packages/swing-store/package.json index 62b8a415c22..0a574595406 100644 --- a/packages/swing-store/package.json +++ b/packages/swing-store/package.json @@ -49,6 +49,6 @@ "timeout": "2m" }, "typeCoverage": { - "atLeast": 75.52 + "atLeast": 76.1 } } diff --git a/packages/swingset-liveslots/package.json b/packages/swingset-liveslots/package.json index 95b92fcac99..38b1f39fe66 100644 --- a/packages/swingset-liveslots/package.json +++ b/packages/swingset-liveslots/package.json @@ -65,6 +65,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 71.48 + "atLeast": 75.1 } } diff --git a/packages/vat-data/package.json b/packages/vat-data/package.json index 790241a64e7..1c034656f19 100644 --- a/packages/vat-data/package.json +++ b/packages/vat-data/package.json @@ -45,6 +45,6 @@ "node": ">=14.15.0" }, "typeCoverage": { - "atLeast": 98.23 + "atLeast": 99.19 } } From 260ad50e8706ba3688f4a5564dfbe65c30c8c7a7 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Sat, 30 Dec 2023 09:55:09 -0500 Subject: [PATCH 57/58] chore(types): remove store-types declaration It caused `import { M } from '@agoric/store'` to be `any`, which cascades. E.g. `makeScalarMapStore` in this commit. --- packages/base-zone/src/heap.js | 1 - packages/base-zone/src/store-types.d.ts | 3 --- packages/governance/test/swingsetTests/utils.js | 2 ++ packages/inter-protocol/test/auction/test-auctionContract.js | 3 ++- 4 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 packages/base-zone/src/store-types.d.ts diff --git a/packages/base-zone/src/heap.js b/packages/base-zone/src/heap.js index f968fa0be4f..839cd2abaf1 100644 --- a/packages/base-zone/src/heap.js +++ b/packages/base-zone/src/heap.js @@ -1,6 +1,5 @@ // @ts-check // @jessie-check -/// import { Far } from '@endo/far'; import { makeExo, defineExoClass, defineExoClassKit } from '@endo/exo'; diff --git a/packages/base-zone/src/store-types.d.ts b/packages/base-zone/src/store-types.d.ts deleted file mode 100644 index 91176037635..00000000000 --- a/packages/base-zone/src/store-types.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Prevent the compiler from complaining about the @agoric/store type not being -// defined if `"noImplicitAny": true` is set in tsconfig.json. -declare module '@agoric/store'; diff --git a/packages/governance/test/swingsetTests/utils.js b/packages/governance/test/swingsetTests/utils.js index 1a931af99d1..7929ab8ff61 100644 --- a/packages/governance/test/swingsetTests/utils.js +++ b/packages/governance/test/swingsetTests/utils.js @@ -7,6 +7,8 @@ const nullMarshaller = makeMarshal( ); export const remoteNullMarshaller = makeExo('nullMarshaller', undefined, { + serialize: val => nullMarshaller.toCapData(val), + unserialize: slot => nullMarshaller.fromCapData(slot), toCapData: val => nullMarshaller.toCapData(val), fromCapData: slot => nullMarshaller.fromCapData(slot), }); diff --git a/packages/inter-protocol/test/auction/test-auctionContract.js b/packages/inter-protocol/test/auction/test-auctionContract.js index 188d44f6426..b624307a9be 100644 --- a/packages/inter-protocol/test/auction/test-auctionContract.js +++ b/packages/inter-protocol/test/auction/test-auctionContract.js @@ -9,7 +9,7 @@ import { subscribeEach } from '@agoric/notifier'; import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js'; import { buildManualTimer } from '@agoric/swingset-vat/tools/manual-timer.js'; import { TimeMath } from '@agoric/time'; -import { makeScalarMapStore } from '@agoric/vat-data/src/index.js'; +import { makeScalarMapStore } from '@agoric/vat-data'; import { makeRatio, makeRatioFromAmounts, @@ -126,6 +126,7 @@ export const setupServices = async (t, params = defaultParams) => { void E(reserveCF).addIssuer(collateral.issuer, 'Collateral'); + /** @type {import('@agoric/swingset-liveslots').Baggage} */ const paBaggage = makeScalarMapStore(); const { priceAuthority, adminFacet: registry } = providePriceAuthorityRegistry(paBaggage); From 40591bccb64c69842646a530af72f25828e710b4 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Sat, 30 Dec 2023 10:03:08 -0500 Subject: [PATCH 58/58] chore(types): refresh coverage threshold Note the increase after restoring the `@agoric/store` type. 'smart-wallet' went from 87 to 94% coverage. --- packages/agoric-cli/package.json | 2 +- packages/base-zone/package.json | 2 +- packages/casting/package.json | 2 +- packages/governance/package.json | 2 +- packages/inter-protocol/package.json | 2 +- packages/smart-wallet/package.json | 2 +- packages/zoe/package.json | 2 +- packages/zone/package.json | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/agoric-cli/package.json b/packages/agoric-cli/package.json index c4b289b7da6..3e6ea307759 100644 --- a/packages/agoric-cli/package.json +++ b/packages/agoric-cli/package.json @@ -96,6 +96,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 77.42 + "atLeast": 77.5 } } diff --git a/packages/base-zone/package.json b/packages/base-zone/package.json index 58238e29e43..ef8d1588ea0 100644 --- a/packages/base-zone/package.json +++ b/packages/base-zone/package.json @@ -53,6 +53,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 86.48 + "atLeast": 88.7 } } diff --git a/packages/casting/package.json b/packages/casting/package.json index f496ebed07b..3718ea3997c 100644 --- a/packages/casting/package.json +++ b/packages/casting/package.json @@ -60,6 +60,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 88.07 + "atLeast": 89.5 } } diff --git a/packages/governance/package.json b/packages/governance/package.json index 9283fa6ccc4..12205f0931f 100644 --- a/packages/governance/package.json +++ b/packages/governance/package.json @@ -76,6 +76,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 82.81 + "atLeast": 89.27 } } diff --git a/packages/inter-protocol/package.json b/packages/inter-protocol/package.json index a9fb3a4d3cf..7d16e526258 100644 --- a/packages/inter-protocol/package.json +++ b/packages/inter-protocol/package.json @@ -83,6 +83,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 93.49 + "atLeast": 95.83 } } diff --git a/packages/smart-wallet/package.json b/packages/smart-wallet/package.json index 8dd64017617..ddf9ae13c39 100644 --- a/packages/smart-wallet/package.json +++ b/packages/smart-wallet/package.json @@ -67,6 +67,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 86.91 + "atLeast": 94.07 } } diff --git a/packages/zoe/package.json b/packages/zoe/package.json index f9a488bf0f8..67704b31e10 100644 --- a/packages/zoe/package.json +++ b/packages/zoe/package.json @@ -135,6 +135,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 81.5 + "atLeast": 84.82 } } diff --git a/packages/zone/package.json b/packages/zone/package.json index 6dcbbebff19..0c0b00a1b39 100644 --- a/packages/zone/package.json +++ b/packages/zone/package.json @@ -54,6 +54,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 96.33 + "atLeast": 96.68 } }