From ec1c7e1a1f2f7c751fd6012b624dc476903ecb2d Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Tue, 17 Aug 2021 21:44:55 -0700 Subject: [PATCH] fix(swingset): record cranks and crankhash/activityhash in slog refs #3720 --- packages/SwingSet/src/kernel/kernel.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/SwingSet/src/kernel/kernel.js b/packages/SwingSet/src/kernel/kernel.js index 46a08a29f35..61c255e30fd 100644 --- a/packages/SwingSet/src/kernel/kernel.js +++ b/packages/SwingSet/src/kernel/kernel.js @@ -743,6 +743,7 @@ export default function buildKernel( console.error(`We're currently already running at`, processQueueRunning); assert.fail(X`Kernel reentrancy is forbidden`); } + kernelSlog.write({ type: 'crank-start', message }); /** @type { PolicyInput } */ let policyInput = ['none']; try { @@ -800,7 +801,14 @@ export default function buildKernel( } kernelKeeper.processRefcounts(); kernelKeeper.saveStats(); - kernelKeeper.commitCrank(); + const { crankhash, activityhash } = kernelKeeper.commitCrank(); + const crankNum = kernelKeeper.getCrankNumber(); + kernelSlog.write({ + type: 'crank-finish', + crankNum, + crankhash, + activityhash, + }); kernelKeeper.incrementCrankNumber(); } finally { processQueueRunning = undefined;