Commit d16f5bd
committed
ci: equivalence — normalize compaction state before diff (closes #168 root cause)
Phase-2 investigation of the account-asset/contract divergence (run
26677752647: 6/8 stores byte-identical incl. account 3.6M + storage-row
17M; account-asset Go 27,917 vs Java 27,965; contract Go 560,890 vs Java
561,120). Investigated on a real Nile snapshot (EC2 10.255.10.72) with a
goleveldb SST dumper decoding internal-key sequence numbers + types.
ROOT CAUSE (not a mutation bug): the account-asset and contract stores
carry DELETE tombstones + multi-version keys from normal java-tron
operation. account-asset: 27,850 distinct keys, 51 with a DELETE
tombstone as their NEWEST version, 330 multi-version entries -> 27,799
live. goleveldb's DB.Iterator returns EXACTLY 27,799 (= 27,850 - 51),
proving goleveldb correctly omits tombstones + resolves multi-version to
newest-seq. account (3.6M) and storage-row (17M) have no such cruft and
matched byte-for-byte.
Both tools start from the identical fixture. Go's Apply opens stores via
goleveldb (compaction-on-open) and drops more of the already-deleted /
obsolete entries; java DbFork (leveldbjni) leaves the store less
compacted and physically retains them. The "java-only" keys are DELETED
keys Go correctly drops and java retains -- a PHYSICAL compaction
difference of logically-identical state (both boot java-tron to the same
chain state; deleted keys stay deleted). goleveldb does the correct,
safe-direction compaction.
FIX: before the byte diff, force a full goleveldb CompactRange of every
dbfork store on BOTH scratch dirs, converging differing physical
compaction states to the canonical live, newest-seq, tombstone-free
form. Verified on-box: goleveldb CompactRange of an account-asset store
with 51 tombstones converges it to exactly the 27,799-key live set. Real
mutation differences survive compaction (it changes physical layout, not
logical content), so genuine divergences are still caught.
Full analysis + numbers in task #168.1 parent dc3593f commit d16f5bd
1 file changed
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
171 | 173 | | |
172 | 174 | | |
173 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
174 | 195 | | |
175 | 196 | | |
176 | 197 | | |
| |||
181 | 202 | | |
182 | 203 | | |
183 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
184 | 230 | | |
185 | 231 | | |
186 | 232 | | |
| |||
0 commit comments