From df8359eca80e28736d294a558ed6c5e3b8b14127 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Tue, 10 Aug 2021 15:58:21 -0700 Subject: [PATCH] fix(swingset): move "kernelStats" into local/non-hashed DB space The kernelstats are merely incidentally deterministic: unlike c-lists and run-queues and object/promise state, stats aren't the primary thing we want to compare across replicas in a consensus machine. And we might want to add more in the future without causing a compatibility break. So this changes the DB key from `kernelStats` to `local.kernelStats`, which will exclude them from the #3442 kernel activity hash. --- packages/SwingSet/src/kernel/state/kernelKeeper.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/SwingSet/src/kernel/state/kernelKeeper.js b/packages/SwingSet/src/kernel/state/kernelKeeper.js index 8b6c1d5b131..723b4cfa943 100644 --- a/packages/SwingSet/src/kernel/state/kernelKeeper.js +++ b/packages/SwingSet/src/kernel/state/kernelKeeper.js @@ -70,6 +70,7 @@ const enableKernelGC = true; // exclude from consensus // local.snapshot.$id = [vatID, ...] +// local.kernelStats // JSON(various kernel stats) // d$NN.o.nextID = $NN // d$NN.c.$kernelSlot = $deviceSlot = o-$NN/d+$NN/d-$NN @@ -208,11 +209,14 @@ export default function makeKernelKeeper(hostStorage, kernelSlog) { } function saveStats() { - kvStore.set('kernelStats', JSON.stringify(kernelStats)); + kvStore.set('local.kernelStats', JSON.stringify(kernelStats)); } function loadStats() { - kernelStats = { ...kernelStats, ...JSON.parse(getRequired('kernelStats')) }; + kernelStats = { + ...kernelStats, + ...JSON.parse(getRequired('local.kernelStats')), + }; } function getStats() {