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.
Issue Addressed
Looking at holesky nodes for
Lookup maybe stuck
logs, found the following state:This state is problematic because the block request has 0 peers and the blob request has 1 peer. The peer sets of all request should be identical, and the cause if this return early here
lighthouse/beacon_node/network/src/sync/block_lookups/single_block_lookup.rs
Lines 254 to 257 in b5de925
The tests did not caught the bug, because the covered test case always returned RPCError for all active requests. In the case a lookup only sends a block request (not a blob request) and the peer disconnects, the lookup may get stuck.
Proposed Changes
Duplicating the list of peers (= peers that claim to have imported the set of block components) between block and blob requests in not necessary. This PR hoists the peer set out of the request state into the lookup struct; indirectly fixing the return early bug.
Also add test to cover the case a lookup loses all peers but does not receive a RPCError.