datasync/downloader: bind staking info recovery to the requested peer - #1051
Open
hyunsooda wants to merge 1 commit into
Open
datasync/downloader: bind staking info recovery to the requested peer#1051hyunsooda wants to merge 1 commit into
hyunsooda wants to merge 1 commit into
Conversation
Recovery accepted a StakingInfoMsg from any connected peer, applied the batch entry by entry, and walked past the end of the pending list when the reply held more entries than were requested. Accept only the peer the recovery was started with, validate the batch against the pending list before writing any of it, and never block the p2p reader on the send. Confidence: high Scope-risk: narrow Not-tested: the non-blocking send, which needs a stalled consumer to observe Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
da1suk8
approved these changes
Sep 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.
Proposed changes
Staking info recovery accepted a
StakingInfoMsgfrom any connected peer, not just the one it was started with, and applied the reply entry by entry — so a reply holding more entries than were requested walked past the end of the pending list and panicked the recovery goroutine. Accept only the selected peer, validate the whole batch against the pending list before writing any of it, and keep the channel send from blocking the p2p reader.Types of changes
Checklist
I have read the CLA Document and I hereby sign the CLAin first time contribute after having read CLA$ make test)Related issues
Further comments