-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
This check should already handle duplicate or out-of-order keys within a particular node:
Lines 105 to 106 in 421a274
| if this_key <= prev_key: | |
| raise ValueError("invalid MST key sort order") |
But if there was a tree like this:
(. "b", h=1 .)
/ \
(. "a", h=0 .) (. "a", h=0 .)
I'm not sure if my NodeWalker class would actually catch it. Need to enforce key ordering when traversing down subtrees, likely here: (in addition to the key height checks)
atmst/src/atmst/mst/node_walker.py
Lines 131 to 134 in 421a274
| if not self.trusted: # if we "trust" the source we can elide this check | |
| # the "None" case occurs for empty intermediate nodes | |
| if subtree_node.maybe_height is not None and subtree_node.maybe_height != self.height - 1: | |
| raise ValueError(f"inconsistent subtree height ({subtree_node.maybe_height}, expected {self.height - 1})") |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels