Repository navigation
fix(rootmulti): stop snapshot restore when node is rejected by SC importer - #4412
Conversation
PR SummaryHigh Risk Overview
Tests cover wrong-version flatkv snapshots end-to-end, partial SS import on mid-stream rejection, and importer version/empty-key behavior. Reviewed by Cursor Bugbot for commit 7255e97. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
There was a problem hiding this comment.
This change makes Importer.AddNode return an error. FlatKV now rejects non-leaf nodes, nodes without a key and nodes at the wrong version instead of skipping them, and snapshot restore stops on the first rejection so a rejected leaf never reaches the state store. Nothing blocks: the error path is wired through the composite and memiavl importers, the restore loop and the seidb tool, a failed import aborts and leaves the SS version unset, and tests cover it. I kept codex's one finding as a suggestion, because Close still returns the failure; no reading contributed anything else.
Non-blocking
1 finding on the changed lines, as inline comments.
seidroid review · decision approve · session 6145f229298746e986d8f5c2902d16c1 · turn resp_claude_e91be63b935713d88768a27f5f7988f9 · item bbe66940e7065ddbb2c04149420aafe2
Findings: 0 blocking | 1 non-blocking | 1 posted inline
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4412 +/- ##
==========================================
- Coverage 55.70% 55.69% -0.02%
==========================================
Files 2179 2179
Lines 169070 169090 +20
==========================================
- Hits 94174 94167 -7
- Misses 74891 74918 +27
Partials 5 5
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Snapshot restore now exit early when the SC (State Commitment) importer cannot import a node, instead of continuing without it. Previously the FlatKV importer skipped such nodes silently, while the restore still passed them on to the SS (State Store).
Importer.AddNodenow returns an error. KVImporter rejects non-leaf nodes, nodes without a key, and nodes at a version other than the import height, instead of skipping them.rootmulti.Store.restorestops on that error, and forwards a leaf to the state store only after SC accepts it.