Conversation
09a1be3 to
08ce249
Compare
calbera
approved these changes
Apr 21, 2026
reecepbcups
approved these changes
Apr 21, 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.
Each peer advertises a
(base, height)range inStatusResponsedeclaring the contiguous blocks it can serve.baseis the oldest block it still has (moves up if the peer prunes),heightis the newest. A malicious peer can advertise something likebase=100_000_000, height=100_000_100to poisonmaxPeerHeightwith a value no peer can serve, which can deadlock blocksync. The attack window opens on any validator restart, not just on genesis sync.This is a minimal fix while we wait for the upstream patch.
Changes:
updateMaxPeerHeightnow excludes peers whosebase > pool.heightfrom themaxPeerHeightcomputation.Tests:
TestBlockPoolIgnoresPeersWithInflatedBase: verifies a peer withbase > pool.heightdoes not raisemaxPeerHeight.TestBlockPoolTimeout: forced uniformbase=startso all peers contribute tomaxPeerHeight. The staggered bases frommakePeerscombined with the new gating would otherwise starve the request pipeline since this test never advancespool.height.