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

Automatic removal of orphan nodes #2

Closed
wants to merge 15 commits into from

Conversation

roysc
Copy link
Collaborator

@roysc roysc commented Jun 17, 2021

Tree nodes (and value mappings) orphaned during updates and deletions are now removed when configured with AutoRemoveOrphans.

Completes work from celestiaorg#24 :

  • implement the actual removing of orphans
  • more extensive testing (update/delete operations, tree with multiple entries)

Implements vulcanize/cosmos-sdk#4.

tzdybal and others added 6 commits March 16, 2021 21:04
Using variadic arguments is very non-intrusive way to introduce options.
This is very generic, and will allow to implement other options in the
future.
sha256(testKey)  = 0001...
sha256(testKey2) = 1000...
sha256(foo)      = 0010...
no case produces nil sideNodes; nothing modifies the stored hashes
@tac0turtle
Copy link

hey, want to open this PR against upstream? This way we can get feedback from the celestia team.

@roysc
Copy link
Collaborator Author

roysc commented Jun 18, 2021

@marbar3778 yes, I planned to after a review on our side, but I will just go ahead.

Upstream PR: celestiaorg#37

@tac0turtle
Copy link

I planned to after a review on our side, but I will just go ahead.

oh sorry for jumping the gun. I was talking with the celestia team and it came up.

Store values in a separate mapstore indexed by (hash(value)+key);
allows pruning values

Simplify pruning loops slightly as well
@i-norden i-norden closed this Jul 22, 2021
@roysc roysc deleted the tzdybal/remove_orhpans branch April 11, 2022 10:05
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.

4 participants