-
Notifications
You must be signed in to change notification settings - Fork 773
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
Stuck lookup v6 #6658
Stuck lookup v6 #6658
Conversation
376ebf6
to
193c7f8
Compare
Squashed commit of the following: commit 193c7f8 Author: dapplion <[email protected]> Date: Thu Dec 5 09:32:57 2024 +0800 Fix stuck lookups if no peers on v6
Squashed commit of the following: commit 193c7f8 Author: dapplion <[email protected]> Date: Thu Dec 5 09:32:57 2024 +0800 Fix stuck lookups if no peers on v6
Squashed commit of the following: commit 9d82a1d Merge: 193c7f8 4946343 Author: Michael Sproul <[email protected]> Date: Fri Dec 13 11:48:03 2024 +1100 Merge branch 'release-v6.0.1' into stuck-lookup-v6 commit 193c7f8 Author: dapplion <[email protected]> Date: Thu Dec 5 09:32:57 2024 +0800 Fix stuck lookups if no peers on v6
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.
Makes sense to me, and testing has shown that this greatly reduces the frequency of stuck lookups.
@mergify queue |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at 775fa67 |
// If components are waiting for the block request to complete, here we should | ||
// check if the`block_request_state.state.is_awaiting_event(). However we already | ||
// checked that above, so `WaitingForBlock => false` is equivalent. | ||
ComponentRequests::WaitingForBlock => false, |
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.
I think this makes sense.
I wonder if this would drop any lookups that are awaiting processing?
State::AwaitingProcess { .. } => false, |
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.
This is unlikely an issue - if we do need the block, external events should somehow keep this lookup in place, a single disconnected peer should not affect this.
Issue Addressed
PR
Introduced a regression on the lookup pruning logic. If a lookup loses all peers before the block request downloads the block, it will get stuck. This is a relatively frequent occurrence. This bug will result in occasional warn logs on the user's terminals.
Example case events
drop_lookups_without_peers
runs on lookup Ahas_no_peers
returns trueis_awaiting_event
returns true <- so it doesn't get prunedis_awaiting_event
checks:awaiting_parent.is_some()
returns falseself.block_request_state.state.is_awaiting_event()
returns false (block awaiting download)component_requests
isWaitingForBlock
, so it returns true <- the bug is herelighthouse/beacon_node/network/src/sync/block_lookups/single_block_lookup.rs
Lines 174 to 177 in 193c7f8
Proposed Changes
Fix
is_awaiting_event
logic.