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

Fix pending block/blob zero peer edge case #13625

Merged
merged 2 commits into from
Feb 17, 2024

Conversation

kasey
Copy link
Contributor

@kasey kasey commented Feb 15, 2024

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

There appears to be an edge case where the pending block queue can send a block to ReceiveBlock without requesting blobs first. The pending block broadcast code tries to fetch any necessary blobs before calling ReceiveBlock and broadcasting, but will silently skip the blob fetch if there are no connected peers. I believe this could cause a deadlock when coupled with a Resync. I no longer think there's a deadlock, but it does generally cause the syncing process to get messy and gets the pending block wedged in da check for at least 3 slots before Resync can do its job.

This PR also removes blob fetching from the step where the batch of pending blocks is retrieved, deferring that work until broadcast time. This is to simplify the flow, whereas today we could have blobs requested in multiple places with unclear timing consquences due to asyncrony in adding fetched blocks to the queue before blobs are retrieved, and pending queue task spawning new goroutines on a timer. It also allows the blob request to be balanced to a different peer and prevents requesting excess amounts of blobs when processing the batch of multiple blocks.

Which issues(s) does this PR fix?

unclear if this will fix the issue so I won't mark it as fixed for now.

@kasey kasey requested a review from a team as a code owner February 15, 2024 19:25
@kasey kasey requested review from terencechain, rkapka, james-prysm, prestonvanloon and potuz and removed request for rkapka and james-prysm February 15, 2024 19:25
@kasey kasey force-pushed the dont-broadcast-without-blobs branch 5 times, most recently from effb0bf to b77952b Compare February 16, 2024 22:15
@kasey kasey force-pushed the dont-broadcast-without-blobs branch from b77952b to d2d1763 Compare February 16, 2024 22:20
@kasey kasey enabled auto-merge February 16, 2024 22:33
@kasey kasey added this pull request to the merge queue Feb 16, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Feb 17, 2024
@terencechain terencechain added this pull request to the merge queue Feb 17, 2024
Merged via the queue into develop with commit 04dd60d Feb 17, 2024
17 checks passed
@terencechain terencechain deleted the dont-broadcast-without-blobs branch February 17, 2024 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants