starknet_patricia: assert unmodified-subtree binary child is present in the skeleton#14614
Conversation
PR SummaryLow Risk Overview The assert message is generalized from “Leaf index” to “Index” because both node kinds use the same path. Reviewed by Cursor Bugbot for commit 1e5c797. Bugbot is set up for automated code reviews on this repo. Configure here. |
nimrod-starkware
left a comment
There was a problem hiding this comment.
@nimrod-starkware made 1 comment.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on yoavGrs).
crates/starknet_patricia/src/patricia_merkle_tree/updated_skeleton_tree/create_tree_helper.rs line 259 at r1 (raw file):
"Leaf index {index:?} doesn't appear in the skeleton." ); return;
Suggestion:
TempSkeletonNode::Original(OriginalSkeletonNode::UnmodifiedSubTree(_)) | TempSkeletonNode::Leaf
assert!(
self.skeleton_tree.contains_key(&index),
"Index {index:?} doesn't appear in the skeleton."
);
return;
}d9b2493 to
9d0aed4
Compare
yoavGrs
left a comment
There was a problem hiding this comment.
@yoavGrs made 1 comment.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on nimrod-starkware).
crates/starknet_patricia/src/patricia_merkle_tree/updated_skeleton_tree/create_tree_helper.rs line 259 at r1 (raw file):
"Leaf index {index:?} doesn't appear in the skeleton." ); return;
Done.
9d0aed4 to
e077fca
Compare
2e27bf5 to
aa3a0d3
Compare
e077fca to
066e368
Compare
066e368 to
f55877e
Compare
aa3a0d3 to
ea03ddc
Compare
…in the skeleton Mirror the leaf sanity-check in finalize_binary_child: an unmodified subtree child must already be finalized in the skeleton (from finalize_bottom_layer). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
f55877e to
1e5c797
Compare
nimrod-starkware
left a comment
There was a problem hiding this comment.
@nimrod-starkware reviewed 1 file and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on yoavGrs).
|
Security scan complete — no issues detected. Generated by Claude Code |

Mirror the leaf sanity-check in finalize_binary_child: an unmodified subtree child
must already be finalized in the skeleton (from finalize_bottom_layer).
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com