-
Notifications
You must be signed in to change notification settings - Fork 119
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
7. feat(db): Add a transparent address transaction index #4038
Conversation
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.
Looks great!
I think we might need to index transactions that sent or received value from an address, because that's what zcashd
does. Can you double-check that for me?
Here is the address index code I found:
- indexing spent: https://github.com/zcash/zcash/blob/c76b756a688bfa0a4396a45355814cdc9f9a47e3/src/main.cpp#L3173-L3183
- indexing received: https://github.com/zcash/zcash/blob/c76b756a688bfa0a4396a45355814cdc9f9a47e3/src/main.cpp#L3228-L3237
- index type: https://github.com/zcash/zcash/blob/49ffee3f20b972dc3aa75e422c67523251cf088b/src/addressindex.h#L91-L98
- RPC query: https://github.com/zcash/zcash/blob/46190bca236757df4979ff6a6e3d2d2d0a2fa8ce/src/rpc/misc.cpp#L1091-L1102
There is a spending
field in each index entry, but I couldn't find any code that did a spending
filter on the query.
(We can do a video review if that would be helpful.)
zebra-state/src/service/finalized_state/zebra_db/transparent.rs
Outdated
Show resolved
Hide resolved
Started full sync test to check performance |
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.
Looks great, thanks!
06334b7
to
1597efc
Compare
bcd8d0b
to
5a4ba1a
Compare
I rebased this PR after rebasing the rest of the PR series. |
1597efc
to
978f5b0
Compare
5a4ba1a
to
084aae4
Compare
978f5b0
to
2ab94c0
Compare
084aae4
to
b8cdc92
Compare
The macOS tests failed due to a temporary port conflict:
https://github.com/ZcashFoundation/zebra/runs/5999791680?check_suite_focus=true#step:13:1927 I'll re-run that job. |
Co-authored-by: teor <teor@riseup.net>
b8cdc92
to
1059362
Compare
https://github.com/ZcashFoundation/zebra/runs/6007481272?check_suite_focus=true#step:10:115 This is a known issue, I'll retry that check. |
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.
re-approving
This is still failing, I'm going to temporarily turn off that check to get this PR to merge. I opened a ticket here: |
Motivation
Per #3951 we need to index transactions by their destination addresses.
Specifications
Designs
Solution
Create a new column family to map
AddressLocation
(how we representAddress
es) toTransactionLocation
s, using RocksDB keys. (It's how we do 1-to-many mappings, for efficiency)Closes #3951
Review
Based on #3999
I still want to test this more, but I think it's OK for review.
@teor2345 will probably be able to review this quickly, but anyone could do it.
Reviewer Checklist
Follow Up Work