-
Notifications
You must be signed in to change notification settings - Fork 786
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
Fix custodial peer assumption on lookup custody requests #6815
Conversation
4278402
to
4ab0678
Compare
Squashed commit of the following: commit 4ab0678 Author: dapplion <35266934+dapplion@users.noreply.github.com> Date: Fri Jan 17 12:09:35 2025 +0700 Fix custodial peer assumption on lookup custody requests
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.
Nice solution, logic is pretty clean 👍
@mergify queue |
🛑 The pull request has been removed from the queue
|
@mergify dequeue |
This pull request has been removed from the queue for the following reason: Pull request #6815 has been dequeued by a You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
✅ The pull request has been removed from the queue
|
@mergify queue |
🛑 The pull request has been removed from the queue
|
@mergify requeue |
✅ This pull request will be re-embarked automaticallyThe followup |
🛑 The pull request has been removed from the queue
|
This pull request has been removed from the queue for the following reason: The merge conditions cannot be satisfied due to failing checks: You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
@mergify requeue |
✅ This pull request will be re-embarked automaticallyThe followup |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at 7a0388e |
Issue Addressed
Current unstable assumes that all peers to which we request columns by root, MUST have the columns in custody
lighthouse/beacon_node/network/src/sync/network_context/custody.rs
Lines 286 to 289 in 06329ec
This statement is incorrect, as we pick a random peer from the global set of peers. The result, is a lot of downscore events like
for innocent peers.
Proposed Changes
Provide the custody request with an up-to-date list of peers that claim to have imported the lookup block. If peers give us that signal we can expect and enforce that they MUST have the columns in custody. If we don't have any such peers, we draw from the global set, but don't enforce then to have the columns in custody.
Since we need share state between the custody request and the overall lookup request I introduced a Mutex. I don't see another way around it if we want the custody request to have the most up-to-date view of the peer set. With @michaelsproul we discussed using an immutable HashSet and clone it, but that would result in the custody request having a quickly stale view. Only when the overall custody request fails (after 3 retries) the peer set would update.
Consider the following sequence of events, if we don't use a Mutex:
During a significant duration the custody request has a stale view, rendering this feature not that useful.