Skip to content
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

insert cached child at the front of a chain of parent lookups #4780

Merged

Conversation

realbigsean
Copy link
Member

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.

// parent blocks are ordered from highest slot to lowest, so we need to process in

@realbigsean realbigsean added bug Something isn't working ready-for-review The code is ready for review low-hanging-fruit Easy to resolve, get it before someone else does! deneb labels Sep 25, 2023
Copy link
Member

@pawanjay176 pawanjay176 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch.
We could consider using a VecDeque to avoid O(n) inserts in Vec though.

@realbigsean
Copy link
Member Author

good idea!

@realbigsean realbigsean added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Sep 29, 2023
@realbigsean realbigsean merged commit 67aeb6b into sigp:deneb-free-blobs Sep 29, 2023
@realbigsean realbigsean deleted the fix-non-linear-parent-rootss branch November 21, 2023 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working deneb low-hanging-fruit Easy to resolve, get it before someone else does! ready-for-merge This PR is ready to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants