Skip to content

[Storehouse] Verify entries on same-height Registers.Store - #8624

Merged
zhangchiqing merged 2 commits into
masterfrom
leo/security-audit-k3-same-height-store-verify
Sep 24, 2026
Merged

zhangchiqing merged 2 commits into
masterfrom
leo/security-audit-k3-same-height-store-verify

Conversation

@zhangchiqing

@zhangchiqing zhangchiqing commented Jul 27, 2026 •

Copy link
Copy Markdown
Member

Improving error handling in Registers.Store

Summary by CodeRabbit

  • Bug Fixes
    • Added integrity checks when saving register data at an existing height.
    • Conflicting values or unexpected registers now return an error instead of being silently accepted.
    • Preserved previously stored values when a conflicting update is rejected.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 35ffc4e7-3363-478c-bd77-4dad5821082f

📥 Commits

Reviewing files that changed from the base of the PR and between 1fdc565 and b66702f.

📒 Files selected for processing (2)
  • storage/pebble/registers.go
  • storage/pebble/registers_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • storage/pebble/registers_test.go
  • storage/pebble/registers.go

📝 Walkthrough

Walkthrough

Registers.Store now validates repeated stores at the latest height against persisted register values. It returns errors for mismatched or missing entries. Tests cover conflicting values, additional registers, and preservation of the original value.

Changes

Register integrity verification

Layer / File(s) Summary
Same-height store verification
storage/pebble/registers.go, storage/pebble/registers_test.go
Store verifies entries at the latest height with byte comparisons. It rejects conflicting or absent registers and classifies other retrieval failures as irrecoverable. Tests confirm that stored values remain unchanged after validation fails.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change to verify entries in same-height Registers.Store calls.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch leo/security-audit-k3-same-height-store-verify

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@codecov-commenter

codecov-commenter commented Jul 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
storage/pebble/registers.go 81.81% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@zhangchiqing
zhangchiqing marked this pull request as ready for review July 27, 2026 13:34
@zhangchiqing
zhangchiqing requested a review from a team as a code owner July 27, 2026 13:34
Comment thread storage/pebble/registers.go
@zhangchiqing
zhangchiqing added this pull request to the merge queue Sep 24, 2026
Merged via the queue into master with commit 7c53e3a Sep 24, 2026
62 checks passed
@zhangchiqing
zhangchiqing deleted the leo/security-audit-k3-same-height-store-verify branch September 24, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants