Skip to content
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

fix: sum tree parent costs #238

Merged
merged 12 commits into from
Jan 30, 2023
Merged

fix: sum tree parent costs #238

merged 12 commits into from
Jan 30, 2023

Conversation

QuantumExplorer
Copy link
Collaborator

Issue being fixed or feature implemented

There were two issues being fixed in this PR.

The first is that sum items have variable cost. This is particularly a problem when updating the balance of an identity as we do not want added or removed bytes which would cause a headache for estimated costs. Now Sum Items always have the same cost (9 bytes). We chose 9 bytes because it represents the size of a i64::Max which is larger than the amount of credits possible in the system.

The second is that a sum tree was calculating if it was in a sum tree itself based on whether it was a sum item (it always was). This was leading to a nasty issue where GroveDb would be reporting that bytes were being removed from the system on update.

What was done?

How Has This Been Tested?

Breaking Changes

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@QuantumExplorer QuantumExplorer merged commit 4542b77 into develop Jan 30, 2023
@QuantumExplorer QuantumExplorer deleted the fix/SumTreeRootCosts branch January 30, 2023 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants