Commit c312317
committed
fix(boot): identity-match run re-adoption, not length-only (Test-#11 class)
At boot, when state.activeRunNumber wasn't restored from snapshot, the working
set (results.json) was adopted onto a candidate saved run `cand` whenever
candData.length === results.length — LENGTH ONLY. Two different full audits of
the same ~1052-node chain have identical length, so an interrupted/unsaved
working set aliased a saved run's number and a later save overwrote that saved
run (the "Test #11" corruption).
Fix: require an order-independent content match too — an address|timestamp|mbps
key over all rows (each result carries a unique-per-run timestamp). Err STRICT:
when the key differs, mint a fresh number (getNextRunNumber, always > max, never
collides/overwrites) instead of adopting `cand`. A false-negative is harmless
(cosmetic new number); only the old false-positive caused data loss.
Adversarially reviewed: timestamps survive the JSON save/load round-trip and
genuinely differ between audits; legit restart-after-complete still reuses the
right number (saveResults writes identical data to both files); composes
correctly with the reserved-number saveCurrentRun fix. Test suite green
(188/31/45/35).1 parent d947f8c commit c312317
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1133 | 1133 | | |
1134 | 1134 | | |
1135 | 1135 | | |
1136 | | - | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
1137 | 1146 | | |
1138 | 1147 | | |
1139 | 1148 | | |
| |||
0 commit comments