CockroachDB design doc talks about a balanced binary tree when describing accounting aggregate:
If upon receiving the message, the parent range also does not include the key prefix, it in turn forwards it to its parent or left child in the balanced binary tree which is maintained to describe the range hierarchy.
How is the balanced binary tree constructed? What invariants does the balanced binary tree maintain? I browsed the code base and but failed to find the relevant code.