[Storehouse] Verify entries on same-height Registers.Store - #8624
[Storehouse] Verify entries on same-height Registers.Store#8624zhangchiqing wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthrough
ChangesRegister integrity verification
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
| stored, err := s.Get(entry.Key, height) | ||
| if err != nil { | ||
| return fmt.Errorf("cannot verify stored register %v at height %d: %w", entry.Key, height, err) | ||
| } |
There was a problem hiding this comment.
Get documents storage.ErrNotFound as an expected error, but here it means a detected divergence, so it must not stay detectable on Store's return. Handle ErrNotFound as a divergence error and wrap other errors with irrecoverable.NewExceptionf:
stored, err := s.Get(entry.Key, height)
if errors.Is(err, storage.ErrNotFound) {
return fmt.Errorf("register %v was not stored at height %d", entry.Key, height)
}
if err != nil {
return irrecoverable.NewExceptionf("cannot verify stored register %v at height %d: %w", entry.Key, height, err)
}
Improving error handling in Registers.Store
Summary by CodeRabbit