Skip to content

Commit

Permalink
docs: document the unnecessary TODO (#280)
Browse files Browse the repository at this point in the history
<!--
Please read and fill out this form before submitting your PR.

Please make sure you have reviewed our contributors guide before
submitting your
first PR.
-->

## Overview

<!-- 
Please provide an explanation of the PR, including the appropriate
context,
background, goal, and rationale. If there is an issue with this
information,
please provide a tl;dr and link the issue. 
-->

## Checklist

<!-- 
Please complete the checklist to ensure that the PR is ready to be
reviewed.

IMPORTANT:
PRs should be left in Draft until the below checklist is completed.
-->

- [ ] New and updated code has appropriate documentation
- [ ] New and updated code has new and/or updated testing
- [ ] Required CI checks are passing
- [ ] Visual proof for any user facing features like CLI or
documentation updates
- [ ] Linked issues closed with keywords


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Documentation**
- Improved comments for clarity on special cases within the tree
handling logic.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
rach-id authored Jan 23, 2024
1 parent 86cbb51 commit 165b42a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/tree/namespace/NamespaceMerkleTree.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ library NamespaceMerkleTree {
return false;
}
// Handle case where proof is empty: i.e, only one leaf exists, so verify hash(data) is root
// TODO handle case where inner node is actually the root of a tree with more than one node
if (proof.sideNodes.length == 0) {
if (proof.numLeaves == 1) {
return namespaceNodeEquals(root, node);
Expand All @@ -74,6 +73,10 @@ library NamespaceMerkleTree {
}
}

// The case where inner node is actually the root of a tree with more than one node is not relevant
// to our use case, since the only case where an inner node is the root of the tree is when the tree
// has only one inner node. So, there is no need to handle that case.

uint256 height = startingHeight;
uint256 stableEnd = proof.key;

Expand Down

0 comments on commit 165b42a

Please sign in to comment.