-
Notifications
You must be signed in to change notification settings - Fork 256
Remove orphaned blobs on started after incomplete block finalization #2988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2988 +/- ##
==========================================
+ Coverage 63.10% 63.26% +0.15%
==========================================
Files 353 353
Lines 17049 17085 +36
==========================================
+ Hits 10759 10809 +50
+ Misses 5447 5424 -23
- Partials 843 852 +9
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR addresses the issue of orphaned blob sidecars that can remain on disk when block finalization fails after blob sidecars have been persisted. The solution involves detecting and cleaning up these orphaned blobs during node startup.
Key Changes:
- Implements
PruneOrphanedBlobsmethod in blockchain service to detect and remove orphaned blob sidecars atlastBlockHeight + 1 - Adds
DeleteByIndexmethod to the storage layer that removes entries without modifying the lower bound index (unlikePrune) - Integrates orphaned blob cleanup into CometBFT service initialization to run automatically on node startup
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
beacon/blockchain/service.go |
Implements PruneOrphanedBlobs method with orphaned blob detection and cleanup logic |
beacon/blockchain/interfaces.go |
Adds PruneOrphanedBlobs method to BlockchainI interface |
consensus/cometbft/service/service.go |
Calls PruneOrphanedBlobs during service initialization after loading the last block height |
da/store/store.go |
Implements DeleteBlobSidecars method that delegates to IndexDB.DeleteByIndex |
da/store/interfaces.go |
Adds DeleteByIndex method to IndexDB interface |
storage/filedb/range_db.go |
Implements DeleteByIndex method that removes entries at a specific index without updating lowerBoundIndex |
storage/filedb/range_db_test.go |
Adds comprehensive test verifying DeleteByIndex doesn't affect the lower bound index invariant |
testing/simulated/testnode.go |
Exposes Blockchain service in TestNode for test access |
testing/simulated/orphaned_blobs_test.go |
Adds integration test simulating orphaned blob creation and cleanup on node restart |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR fixes potential orphaned blob sidecars on disk from incomplete block finalization.
If
FinalizeBlockfails afterFinalizeSidecarshas persisted blob sidecars to disk, we may leave behind orphaned blobs at slotlastBlockHeight + 1. These orphaned blobs:This PR addresses this so that on node startup (during CometBFT service initialization), check for and remove any orphaned blob sidecars at slot
lastBlockHeight + 1.