-
Notifications
You must be signed in to change notification settings - Fork 8
fix(governance): flatten nested AVL tree for voting info storage #1122
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
base: main
Are you sure you want to change the base?
Conversation
not met Change to process as `StatusRejected` based on `IsPassed()` after voting ends
- Modified `NewProposalTextData()` and `NewProposalExecutionData()` in `proposal_data.gno` to create non-applicable fields as `nil`. - Added explicit error handling in the validation logic of `proposal_data.gno` for cases where `communityPoolSpend`/`execution` is `nil`, and modified `ParameterChangesInfos()` to return an empty result when nil. - Updated `CommunityPoolSpendTokenPath()` in `proposal.gno` to safely return an empty string when `communityPoolSpend` is `nil`.
Replace nested AVL tree structure with single tree using composite keys (`proposalID:voter`). - Eliminate write amplication on vote updates - Removes need to pre-create empty trees for each proposal - Simplifies `Get`/`Set` operations to single-item access | Operation | Before (Nested Tree) | After (Composite Key) | |-----------|----------------------|-----------------------| | Vote Storage | O(log P) + O(log V) + full subtree serialization | O(log N) single entry only | | Vote Lookup | O(log P) + O(log V) two traversals | O(log N) single traversal | | Per-Proposal Full Iteration | O(V) only votes for that proposal | O(N) full iteration + prefix filter | - P = number of proposals, V = votes per proposal, N = total votes
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|



Description
Replace nested AVL tree structure with single tree using composite keys (
proposalID:voter).Get/Setoperations to single-item access