Closed jackzhhuang closed 3 months ago
This update enhances the block store functionality by introducing methods for bulk deletion of absent blocks in the AbsentDagBlockStoreWriter
trait and SyncDagStore
. Additionally, it integrates logic to clear stale data during fork events, ensuring data integrity and improving synchronization processes. These changes contribute to a more efficient management of synchronization states and a more robust data handling system.
Files | Change Summary |
---|---|
sync/src/store/sync_absent_ancestor.rs |
Added delete_all_absent_block method in AbsentDagBlockStoreWriter trait and its implementation in SyncAbsentBlockStore . Enhances bulk deletion capabilities. |
sync/src/store/sync_dag_store.rs |
Introduced delete_all_dag_sync_block method in SyncDagStore for clearing absent blocks. |
sync/src/tasks/inner_sync_task.rs |
Added a call to clear the DAG synchronization store during fork events for data integrity. |
sync/src/store/tests.rs |
Enhanced tests to validate deletion functionality and ensure correct state of the sync_dag_store post-deletion. |
sequenceDiagram
participant User
participant InnerSyncTask
participant SyncDagStore
participant AbsentDagBlockStoreWriter
User->>InnerSyncTask: Detect fork
InnerSyncTask->>SyncDagStore: delete_all_dag_sync_block()
SyncDagStore->>AbsentDagBlockStoreWriter: delete_all_absent_block()
AbsentDagBlockStoreWriter-->>SyncDagStore: Confirmation of deletion
SyncDagStore-->>InnerSyncTask: Confirmation of sync store cleared
InnerSyncTask-->>User: Sync state updated
🐇 In the quiet of the night,
Blocks vanish from my sight,
With a hop and a skip,
We clear the old script,
Data fresh, oh what a delight!
Let's sync with all our might! 🌙
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
…he blue fork
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: N/A
What is the new behavior?
-
-
Other information
Summary by CodeRabbit
New Features
SyncDagStore
to clear all absent blocks, improving data integrity.Tests
sync_dag_store
, confirming the functionality of the new deletion methods.