Fix the storage of anchors in the state #2563
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
#2407 added note commitment trees and anchors to the state. However I got the storage wrong: we should store the root as a key with an empty value (to make it work as a set) instead of using the height as the key and the root as the value.
This fixes that.
Specifications
N/A
Designs
https://github.com/ZcashFoundation/zebra/blob/main/book/src/dev/rfcs/0005-state-updates.md#rocksdb-data-structures
Solution
Use the correct key/value
Review
Anyone can review this.
This is blocking regenerating the cached state, which in turn is blocking testing other state work.
After this is accepted we can regenerate the cached state.
Reviewer Checklist
Follow Up Work
N/A
This change is