-
Notifications
You must be signed in to change notification settings - Fork 784
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
Prevent sync lookups from reverting to awaiting block #6443
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dapplion
force-pushed
the
sync-lookup-no-revert-state
branch
from
October 8, 2024 10:21
68a4cc3
to
f6c1027
Compare
jimmygchen
reviewed
Oct 9, 2024
beacon_node/network/src/sync/block_lookups/single_block_lookup.rs
Outdated
Show resolved
Hide resolved
jimmygchen
reviewed
Oct 9, 2024
jimmygchen
approved these changes
Oct 9, 2024
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 looks great to me! I think moving the logic up to SingleBlockLookup
is a lot cleaner, and avoids the possibility of the scenario you described.
jimmygchen
added
ready-for-merge
This PR is ready to merge.
and removed
ready-for-review
The code is ready for review
labels
Oct 9, 2024
@mergify queue |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at a0a62ea |
5 tasks
chong-he
pushed a commit
to chong-he/lighthouse
that referenced
this pull request
Nov 26, 2024
* Prevent sync lookups from reverting to awaiting block * Remove stale comment
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Sync lookups have an "oracle" into the
da_checker
state. Blob or custody column requests are only progressed when the block is already downloaded. This allows deterministic requests after we are sure the block has data.However, the current implementation has an interesting flaw. If the "oracle" is buggy, the sync lookup can consider that:
This sequence of states should never happen but the type models allow it to happen.
Proposed Changes
Instead, we can model
SingleBlockLookup
such that once the block is seen, it can never be unseen. This new enum:and moving the "oracle" logic from the network context to the lookup logic achieve this effect.
I'm leaving the PR in draft for those familiar with the topic to thumbs up this design. The overall goal is to reduce the chance of lookups getting stuck if we change the da_checker logic.