-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
backendTopics: Encoding, Arithmetic constraints, Verification, LayoutingTopics: Encoding, Arithmetic constraints, Verification, LayoutingbugSomething isn't workingSomething isn't working
Description
When the tree is empty new_siblings.len() is 0. This triggers an underflow in the code:
| F::from_canonical_u64((new_siblings.len() - 1) as u64), |
The self.divergence_level is not used in this situation so the value assigned there doesn't matter, but I think we should fix the underflow condition, which is checked by rust in debug mode and panics.
A solution could be to do a conditional assignment of 0 if new_siblings.len() == 0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
backendTopics: Encoding, Arithmetic constraints, Verification, LayoutingTopics: Encoding, Arithmetic constraints, Verification, LayoutingbugSomething isn't workingSomething isn't working