insert cached child at the front of a chain of parent lookups #4780
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
I induced some parent lookups on devnet 8 and I observed this log on almost every response:
Sep 25 19:41:18.582 DEBG Invalid block received outcome: NonLinearParentRoots, msg: peer sent invalid block
I'm pretty sure this is happening because we append the "cached child" block (the block that triggers the chain of parent requests) to the end of the chain of blocks here: https://github.com/sigp/lighthouse/blob/deneb-free-blobs/beacon_node/network/src/sync/block_lookups/mod.rs#L1196
This comment seems to suggest blocks here should be ordered from highest slot to lowest slot (assuming "highest" and "lowest" here refer to slot). The fact that blocks are reversed here, and later used in order of ascending slot in
filter_chain_segment
also backs this up.lighthouse/beacon_node/network/src/network_beacon_processor/sync_methods.rs
Line 403 in 42b34db