Skip to content

fix: FindChildByHash not selecting RHS of inner tree#762

Merged
mpolitzer merged 1 commit intonext/2.0from
fix/builder-lhs-find-child
Mar 17, 2026
Merged

fix: FindChildByHash not selecting RHS of inner tree#762
mpolitzer merged 1 commit intonext/2.0from
fix/builder-lhs-find-child

Conversation

@mpolitzer
Copy link

No description provided.

@mpolitzer mpolitzer added this to the 2.0.0 milestone Mar 17, 2026
@mpolitzer mpolitzer requested a review from vfusco March 17, 2026 02:44
@mpolitzer mpolitzer self-assigned this Mar 17, 2026
@mpolitzer mpolitzer added the bug Something isn't working label Mar 17, 2026
@mpolitzer mpolitzer force-pushed the fix/builder-lhs-find-child branch 3 times, most recently from d713a55 to 164d0c9 Compare March 17, 2026 05:07
vfusco
vfusco previously approved these changes Mar 17, 2026
@github-project-automation github-project-automation bot moved this from Todo to Waiting Merge in Rollups SDK Mar 17, 2026
@vfusco vfusco requested review from Copilot and renatomaia March 17, 2026 21:15
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes Merkle tree lookup logic so FindChildByHash correctly traverses the RHS branch (and can match the current node), and adds regression tests to prevent the issue from recurring.

Changes:

  • Update Tree.FindChildByHash to return *Tree, match on the current node’s RootHash, and recurse into inner.RHS (instead of incorrectly using inner.LHS twice).
  • Add TestFindChildByHash covering simple, deeper (RHS) traversal, and not-found cases.
  • Introduce an additional digest constant used by the new tests.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
internal/merkle/builder.go Fixes FindChildByHash traversal/return behavior so lookups can succeed in RHS subtrees and at the current node.
internal/merkle/builder_test.go Adds regression tests verifying correct lookup behavior across tree shapes and missing hashes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@mpolitzer mpolitzer force-pushed the fix/builder-lhs-find-child branch from e0438c3 to 37bf04f Compare March 17, 2026 21:38
@mpolitzer mpolitzer merged commit 37bf04f into next/2.0 Mar 17, 2026
8 checks passed
@mpolitzer mpolitzer deleted the fix/builder-lhs-find-child branch March 17, 2026 22:44
@github-project-automation github-project-automation bot moved this from Waiting Merge to Done in Rollups SDK Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants