-
Notifications
You must be signed in to change notification settings - Fork 749
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
Add peers to parent lookups #5858
Conversation
let awaiting_parent = lookup.awaiting_parent(); | ||
// After adding new peers a lookup may be able to make progress. | ||
let result = lookup.continue_requests(cx); |
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.
It's not clear to me why we try to progress to the lookup here, before we progress the parent. Wouldn't it make more sense to do it in reverse? Also this action feels quite out of place in this function although I'm not sure what's a better place for this.
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.
After #5839 lookups may have zero peers. I agree it won't be a common case that the ancestor lookup in a parent chain ends up with zero peers, pauses and then needs continuation from the code of this PR. I would be okay with dropping this new continue_requests
statement, it's really an optimization and not strictly required
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.
Just a minor question & comment above.
I did a round of quick testing locally to trigger parent lookups and it works fine 👍
Squashed commit of the following: commit 08505cb Author: dapplion <35266934+dapplion@users.noreply.github.com> Date: Wed May 29 01:53:40 2024 +0300 lint commit 7ad3be6 Author: dapplion <35266934+dapplion@users.noreply.github.com> Date: Wed May 29 00:58:03 2024 +0300 Add test commit 52c8034 Author: dapplion <35266934+dapplion@users.noreply.github.com> Date: Wed May 29 00:19:13 2024 +0300 Add peers to parent lookups
@mergify queue |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at 17dc978 |
Issue Addressed
Previous PR
Dropped the following feature: If a peers claims to have imported a block, we assume that it must have imported all its parents and will be considered to fetch data from any parent lookup
Having this feature is important to ensure that parent lookups don't "thin-out". Also, malicious peers can strategically send unknown data first to create lookups with a single peer.
Proposed Changes
Add peers that claim to have imported a block to all lookups that are an ancestor of that block
Closes #5708