diff --git a/golang/cosmos/x/swingset/keeper/snapshotter.go b/golang/cosmos/x/swingset/keeper/snapshotter.go index 4c06f0b516d..4e52275d811 100644 --- a/golang/cosmos/x/swingset/keeper/snapshotter.go +++ b/golang/cosmos/x/swingset/keeper/snapshotter.go @@ -331,7 +331,7 @@ func (snapshotter *SwingsetSnapshotter) SnapshotExtension(height uint64, payload snapshotter.activeSnapshot.retrieved = true - snapshotter.activeSnapshot.logger.Info("fully retrieved snapshot from", "exportDir", exportDir) + snapshotter.activeSnapshot.logger.Info("retrieved snapshot", "exportDir", exportDir) return nil } @@ -460,5 +460,7 @@ func (snapshotter *SwingsetSnapshotter) RestoreExtension(height uint64, format u return err } + snapshotter.logger.Info("restored snapshot", "exportDir", exportDir, "height", height) + return nil } diff --git a/packages/cosmic-swingset/src/chain-main.js b/packages/cosmic-swingset/src/chain-main.js index 55e913e457a..82934e39048 100644 --- a/packages/cosmic-swingset/src/chain-main.js +++ b/packages/cosmic-swingset/src/chain-main.js @@ -485,9 +485,13 @@ export default async function main(progname, args, { env, homedir, agcc }) { if (typeof exportDir !== 'string') { throw Fail`Invalid exportDir argument ${q(exportDir)}`; } + console.info( + 'Restoring SwingSet state from snapshot at block height', + blockHeight, + ); return performStateSyncImport( { exportDir, stateDir: stateDBDir, blockHeight }, - { fs: { ...fs, ...fsPromises }, pathResolve }, + { fs: { ...fs, ...fsPromises }, pathResolve, log: null }, ); } case 'initiate': { @@ -534,6 +538,10 @@ export default async function main(progname, args, { env, homedir, agcc }) { ); }); + console.info( + 'Initiating SwingSet state snapshot at block height', + blockHeight, + ); exportData.exporter = spawnSwingStoreExport( { stateDir: stateDBDir, diff --git a/packages/cosmic-swingset/src/export-kernel-db.js b/packages/cosmic-swingset/src/export-kernel-db.js index b43957b7ab9..f2874ba8eeb 100755 --- a/packages/cosmic-swingset/src/export-kernel-db.js +++ b/packages/cosmic-swingset/src/export-kernel-db.js @@ -79,7 +79,7 @@ const checkExportMode = mode => { * @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 {(...args: any[]) => void} [powers.log] + * @param {null | ((...args: any[]) => void)} [powers.log] * @returns {StateSyncExporter} */ export const initiateSwingStoreExport = ( @@ -274,7 +274,7 @@ export const main = async ( { fs, pathResolve, - log: verbose ? console.log : undefined, + log: verbose ? console.log : null, }, ); diff --git a/packages/cosmic-swingset/src/import-kernel-db.js b/packages/cosmic-swingset/src/import-kernel-db.js index fb76cf119e7..553e6222b05 100755 --- a/packages/cosmic-swingset/src/import-kernel-db.js +++ b/packages/cosmic-swingset/src/import-kernel-db.js @@ -31,7 +31,7 @@ import { makeProcessValue } from './helpers/process-value.js'; * @param {Pick & Pick} powers.fs * @param {import('path')['resolve']} powers.pathResolve * @param {typeof import('@agoric/swing-store')['importSwingStore']} [powers.importSwingStore] - * @param {(...args: any[]) => void} [powers.log] + * @param {null | ((...args: any[]) => void)} [powers.log] * @returns {Promise} */ export const performStateSyncImport = async ( @@ -40,7 +40,7 @@ export const performStateSyncImport = async ( fs: { createReadStream, readFile }, pathResolve, importSwingStore: importDB = importSwingStore, - log, + log = console.log, }, ) => { /** @param {string} allegedRelativeFilename */