Request a block's unknown parent by root on gossip arrival#17057
Merged
Conversation
55c86c9 to
19b1887
Compare
satushh
previously approved these changes
Jul 1, 2026
potuz
requested changes
Jul 1, 2026
| } | ||
| s.pendingQueueLock.Unlock() | ||
| err := errors.Errorf("unknown parent for block with slot %d and parent root %#x", blk.Block().Slot(), blk.Block().ParentRoot()) | ||
| parentRoot := blk.Block().ParentRoot() |
Contributor
There was a problem hiding this comment.
you can use this parentRoot above instead of calling blk.Block().ParentRoot() twice. in Line 195
| s.pendingQueueLock.Unlock() | ||
| err := errors.Errorf("unknown parent for block with slot %d and parent root %#x", blk.Block().Slot(), blk.Block().ParentRoot()) | ||
| parentRoot := blk.Block().ParentRoot() | ||
| go func() { |
Contributor
There was a problem hiding this comment.
This should be called only if the block is not being synced. In fact for a call with a single root, a new helper would be good that takes a single root as argument, checks if the block is not currently being synced and dispatches a call in the background to call it if it's not.
Collaborator
Author
There was a problem hiding this comment.
sendBatchRootRequest filters roots that's being synced.
// Filter out roots that are already seen in pending blocks or being synced.
roots = s.filterOutPendingAndSynced(roots)
// Nothing to do, exit early.
if len(roots) == 0 {
return nil
}When a gossiped block is queued because its parent is unknown, request the parent by root immediately rather than waiting for the periodic pending blocks queue tick. This mirrors the blob and payload envelope gossip paths which already do the same.
bd9ae13 to
85f758e
Compare
potuz
previously approved these changes
Jul 1, 2026
potuz
approved these changes
Jul 1, 2026
This file contains hidden or 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
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.
When a gossiped block arrives with an unknown parent, request the parent by root immediately instead of waiting up to a third of a slot for the pending blocks queue to process it. This matches the on demand by root requests already used for blob sidecars and execution payload envelopes.