Skip to content

fix(state): correct dequeue_children by_height index handling#10604

Open
syszery wants to merge 1 commit into
ZcashFoundation:mainfrom
syszery:fix/queued-children-by-height
Open

fix(state): correct dequeue_children by_height index handling#10604
syszery wants to merge 1 commit into
ZcashFoundation:mainfrom
syszery:fix/queued-children-by-height

Conversation

@syszery
Copy link
Copy Markdown
Contributor

@syszery syszery commented May 20, 2026

Motivation

Fixes incorrect behavior in QueuedBlocks::dequeue_children where removing queued children incorrectly removed entire by_height buckets instead of only the matching block hash.

Closes #10597

Solution

Update dequeue_children to remove only the specific block hash from the by_height index, and only remove the height entry when no hashes remain.

Tests

Added a regression test that constructs a forked chain scenario where two queued blocks exist at the same height but belong to different parents. The test fails on the previous implementation and passes after the fix.

AI Disclosure

  • No AI tools were used in this PR
  • AI tools were used: assisted in drafting the test and initial fix structure

PR Checklist

  • The PR title follows conventional commits format: type(scope): description
  • The PR follows the contribution guidelines.
  • This change was discussed in an issue or with the team beforehand.
  • The solution is tested.
  • The documentation and changelogs are up to date.

@syszery syszery marked this pull request as ready for review May 20, 2026 12:13
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@natalieesk
Copy link
Copy Markdown
Contributor

Thank you for this PR. We will take a look shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dequeue_children() removes entire by_height bucket instead of individual hash, losing same-height fork siblings

2 participants