-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Sumtree]: Implement prefix sum algorithm #83
Conversation
@@ -562,12 +562,12 @@ impl TreeNode { | |||
/// have been performed. It checks the balance factor of the current node and performs rotations | |||
/// as necessary to bring the tree back into balance. | |||
pub fn rebalance(&mut self, storage: &mut dyn Storage) -> ContractResult<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: all the changes in node.rs
and test_node.rs
are driveby cleanup from tree debugging w @crnbarr93
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Comments were extremely useful in following the implementation. Two small nit changes otherwise no problems.
Closes: #76
What is the purpose of the change
This PR implements the prefix sum algorithm as defined by our spec. Specifically, it implements the function
get_prefix_sum
which gives the sum of all leaves up until the passed in ETAS value.Testing and Verifying
[WIP] The intended testing strategy here is:
Testing strategy:
test_node_deletion_valid
setupHopefully we can do a follow up PR to fuzz generate test cases here