-
Notifications
You must be signed in to change notification settings - Fork 100
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
add(tests): Add snapshot tests for sprout database formats #7057
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #7057 +/- ##
==========================================
- Coverage 77.52% 77.46% -0.07%
==========================================
Files 310 310
Lines 41694 41767 +73
==========================================
+ Hits 32325 32353 +28
- Misses 9369 9414 +45 |
Failed by container issue. Restarting all jobs |
It first failed at the create instance stage:
https://github.com/ZcashFoundation/zebra/actions/runs/5353701092/jobs/9711197294?pr=7057#step:11:91 |
1c5ffc0
to
f0abd7c
Compare
@Mergifyio update |
✅ Branch has been successfully updated |
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.
This looks and works very good, it will be needed to test the ECC dependency upgrades of #7053
Motivation
We're changing our database note commitment tree format code in PR #7053, but we don't have good coverage for sprout trees. (We have snapshots for the raw data, but not converting it into Zebra's data structures.)
Reference
RocksDB Iterator Mode:
https://docs.rs/rocksdb/latest/rocksdb/enum.IteratorMode.html
Snapshot redactions:
https://insta.rs/docs/redactions/#sorted-redactions
Complex Code or Requirements
Using database iterators like this has caused hangs before, but so far these methods are only used in tests.
Solution
Empty Note Commitment Tree snapshot tests:
Sprout Note Commitment Tree manual snapshot tests:
Tree Root tests:
Related Fixes:
Review
@oxarbitrage might find this handy for testing PR #7053.
Reviewer Checklist
Follow Up Work
We still don't have some snapshot tests for the entire database, or for some shielded data. (We only use 10 blocks, but the first Sprout transaction is after 100+ blocks.)
We can add them as we change the database format.