Closed jackzhhuang closed 1 month ago
The changes in this pull request focus on the BlockCollector
and BlockSyncTask
structures within the sync/src/tasks/block_sync_task.rs
file. The find_absent_ancestor
method's return type has been changed from Result<u64>
to Result<()>
, simplifying its functionality. Additionally, the ensure_dag_parent_blocks_exist
method's logic has been modified to remove the count check for absent ancestors. The fetch_blocks
method has been updated to prevent redundant network calls by retaining block IDs already present in the local store.
File Path | Change Summary |
---|---|
sync/src/tasks/block_sync_task.rs | - Updated find_absent_ancestor method return type from Result<u64> to Result<()> . |
- Removed count variable in find_absent_ancestor and simplified its implementation. |
|
- Modified ensure_dag_parent_blocks_exist to directly call find_absent_ancestor without count check. |
|
- Updated fetch_blocks to retain block IDs from local store to avoid unnecessary network requests. |
block_sync_task.rs
file, specifically addressing how blocks are added to the waiting list, which relates to the changes made in the find_absent_ancestor
and fetch_blocks
methods in the main PR.🐇 In the code where blocks align,
A simpler path we now define.
Absent counts have hopped away,
Efficiency leads the way!
With each fetch, we save a call,
Syncing blocks, we stand tall!
🌟
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?
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
Bug Fixes