Skip to content

Commit df8359e

Browse files
committed
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.
1 parent e79e43c commit df8359e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/SwingSet/src/kernel/state/kernelKeeper.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const enableKernelGC = true;
7070

7171
// exclude from consensus
7272
// local.snapshot.$id = [vatID, ...]
73+
// local.kernelStats // JSON(various kernel stats)
7374

7475
// d$NN.o.nextID = $NN
7576
// d$NN.c.$kernelSlot = $deviceSlot = o-$NN/d+$NN/d-$NN
@@ -208,11 +209,14 @@ export default function makeKernelKeeper(hostStorage, kernelSlog) {
208209
}
209210

210211
function saveStats() {
211-
kvStore.set('kernelStats', JSON.stringify(kernelStats));
212+
kvStore.set('local.kernelStats', JSON.stringify(kernelStats));
212213
}
213214

214215
function loadStats() {
215-
kernelStats = { ...kernelStats, ...JSON.parse(getRequired('kernelStats')) };
216+
kernelStats = {
217+
...kernelStats,
218+
...JSON.parse(getRequired('local.kernelStats')),
219+
};
216220
}
217221

218222
function getStats() {

0 commit comments

Comments
 (0)