-
Notifications
You must be signed in to change notification settings - Fork 110
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
change(state): Stop re-downloading blocks that are in non-finalized side chains #6335
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6335 +/- ##
==========================================
+ Coverage 77.71% 77.83% +0.12%
==========================================
Files 304 304
Lines 39583 39614 +31
==========================================
+ Hits 30761 30835 +74
+ Misses 8822 8779 -43 |
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.
05ccefe
to
26cc3da
Compare
Sure! |
Can we have an update here once you both have a catch up? :) |
- adds finalized block hashes to sent_blocks - replaces Depth call with Contains in sync, inbound, and block verifier
Co-authored-by: teor <[email protected]>
Co-authored-by: teor <[email protected]>
…ponding that a block is in the queue
Co-authored-by: teor <[email protected]>
5c2b1ee
to
2c15632
Compare
@teor2345 it only checks the chains now, I'll open a follow-up PR for checking the queues. |
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.
Thanks, this looks like a worthwhile change, and it's low risk.
We'll try merging this PR (which is low risk because it only checks for blocks that have been validated and committed), the follow-up PR that checks the queues is riskier and less important, so we'll try that too if it works well without any further changes but will close it otherwise. |
Motivation
The sync task, inbound downloader, and the block verifier need to check if a block hash is present in the state to avoid redundant work and unnecessary errors. They currently call the state service with
Depth
requests, but this only checks if a block hash has been committed to the best chain, and returnsNone
when the block is in a side chain or queued for validation.This PR adds a
Contains
request to the state for checking if a block hash is present in any chain and uses it from sync, inbound and the block verifier instead ofDepth
.Closes #862.
Solution
Contains
request to the state service that responds with anOption<BlockLocation>
Contains
request from sync, inbound, and block verifier to check if the block hash is in any chainReview
Anyone can review.
Reviewer Checklist