Don't punish the block peer when the envelope response is empty and is a different peeer#16779
Merged
Merged
Conversation
potuz
approved these changes
May 13, 2026
Contributor
potuz
left a comment
There was a problem hiding this comment.
Thanks for catching my bug. We need to check if there's another consistency check though that will carry the same error, that is if the chains are not consistent but with some payloads, we need to make sure that we're not wrapping the error as here and penalizing the blocks provider unfairly.
pull Bot
pushed a commit
to Hawthorne001/prysm
that referenced
this pull request
May 13, 2026
…ffchainLabs#16785) Follow-up to OffchainLabs#16779. Same anti-pattern lived in the non-empty envelope branch of `validatePayloadBlockConsistency`: - When an envelope doesn't match a block, the old code set `r.err = errors.Wrap(prysmsync.ErrInvalidFetchedData, ...)`. - The inline downscore is correctly gated on `r.blocksFrom == r.payloadsFrom`, but `ErrInvalidFetchedData` propagates up to `blocks_queue.go:347-349` which unconditionally fires `q.downscorePeer(response.blocksFrom, "invalidBlocks")`, penalizing the block peer for a bad envelope served by a different peer
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.
In
validatePayloadBlockConsistency, when the envelope response is empty ANDcheckAllBlocksBuildOnEmptyfails (i.e., the block bids show a payload was revealed somewhere in the range), the old code:r.err = errors.Wrap(prysmsync.ErrInvalidFetchedData, …)→ batch dropped by the FSM.blocks_queue.go:347-349then unconditionally firedq.downscorePeer(response.blocksFrom, "invalidBlocks")against the block peer — even when a different peer was the one that returned the empty enveloperesponse.
if r.blocksFrom == r.payloadsFrom { f.downscorePeer(...) }separately downscored the same peer.Changes in this pr
r.err = …assignment in this branch. Without it, the queue-levelinvalidBlocksdownscore (which keys onErrInvalidFetchedData) no longer fires, and the batch passes through to processing.invalidBlocks