Skip to content

datasync/downloader: bind staking info recovery to the requested peer - #1051

Open
hyunsooda wants to merge 1 commit into
kaiachain:devfrom
hyunsooda:fix/bind-staking-info-recovery
Open

datasync/downloader: bind staking info recovery to the requested peer#1051
hyunsooda wants to merge 1 commit into
kaiachain:devfrom
hyunsooda:fix/bind-staking-info-recovery

Conversation

@hyunsooda

@hyunsooda hyunsooda commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Proposed changes

Staking info recovery accepted a StakingInfoMsg from 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

  • 🐛 Bug fix
  • ✨ Non-hardfork changes (node upgrade not required)
  • 💥 Hardfork / consensus-breaking changes
  • 🧪 Test improvements
  • 🧰 CI / build tool
  • ♻️ Chore / Refactor / Non-functional changes

Checklist

  • 📖 I have read the CONTRIBUTING GUIDELINES doc
  • 📝 I have signed in the PR comment I have read the CLA Document and I hereby sign the CLA in first time contribute after having read CLA
  • 🟢 Lint and unit tests pass locally with my changes ($ make test)

Related issues

Further comments

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>
@hyunsooda hyunsooda self-assigned this Aug 26, 2026
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.

2 participants