Remove farmer piece getter deduplication #3133
Merged
+29
−168
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The feature was introduced as part of #2565 and later refactored in #2793 to de-duplicate in-flight piece requests.
While it helped at the time, with growing network size (meaning larger selection of pieces) and Snap sync (meaning little to no overlap between node sync, piece cache sync and plotting) its assumptions no longer hold and it just adds a bunch of complexity for very little benefit. As such I think we should remove it.
Moreover, with #3132 and other upcoming PRs many simple cases like plotting right after genesis where out of 1000 unique pieces there are just 256 unique pieces will be internally de-duplicated (see 29b86e3#diff-765c2c9791b623384f826fa8f02a4e4c4c78735e85b42a3533537cb58d3df116R278-R289).
First commit is the actual change, second simply inlines the function which only has a trivial call from a single place.
Code contributor checklist: