Skip to content
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

Feature/Dont download existing block #7665

Merged
merged 20 commits into from
Oct 31, 2024

Conversation

asdacap
Copy link
Contributor

@asdacap asdacap commented Oct 28, 2024

  • Based on Refactor/Separate block store and Bad block store #7659
  • With era import and portal, blocks may arbitrarily get downloaded during fast blocks. This mean not just from genesis, but any portion of the history and portal will randomly pick which block to store based on a configured radius.
  • This is a problem as fast blocks does not need to download them anymore if it is already in database.
  • This PR adds a check in old bodies and old receipts so that it does not re-download existing block.
  • Unfortunately because of how rocksdb works checking if a block exist still require fetching it from database. So it is not fast and not parallelizing it does not speed it up much. The complicated code in this PR attempts to make it fast.
  • With blocks imported via era from genesis to block 20900000, the whole old blocks+old receipts take about 15 minute with the checking for existing blocks portion taking about 10 minute. When attaching era directory directly, the checking phase take about 2 minute. Not instant, but at least it does not consume 2GBps of bandwith.
  • OptimizeFilterForHits option is disabled for bodies and receipts to reduce overhead on checking if a block is available or not. This use up some disk space to store the last level bloom.

Types of changes

What types of changes does your code introduce?

  • New feature (a non-breaking change that adds functionality)
  • Optimization

Testing

Requires testing

  • Yes

If yes, did you write tests?

  • Yes

Notes on testing

  • Era imported blocks.
  • Mainet fast sync

@LukaszRozmej LukaszRozmej changed the base branch from master to refactor/separate-block-store October 28, 2024 09:23
Base automatically changed from refactor/separate-block-store to master October 28, 2024 09:31
@asdacap asdacap marked this pull request as ready for review October 28, 2024 16:06
@asdacap asdacap requested a review from rubo as a code owner October 28, 2024 16:06
@asdacap asdacap mentioned this pull request Oct 30, 2024
5 tasks
@asdacap asdacap merged commit 0fdb10a into master Oct 31, 2024
75 checks passed
@asdacap asdacap deleted the feature/dont-download-existing-block branch October 31, 2024 23:09
@kamilchodola kamilchodola restored the feature/dont-download-existing-block branch November 4, 2024 13:45
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.

2 participants