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

7. feat(db): Add a transparent address transaction index #4038

Merged
merged 3 commits into from
Apr 13, 2022

Conversation

conradoplg
Copy link
Collaborator

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 represent Addresses) to TransactionLocations, 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

  • Code implements Specs and Designs
  • Tests for Expected Behaviour
  • Tests for Errors

Follow Up Work

@conradoplg conradoplg requested a review from a team as a code owner April 4, 2022 23:32
@conradoplg conradoplg requested review from jvff and removed request for a team April 4, 2022 23:32
@teor2345 teor2345 mentioned this pull request Apr 5, 2022
4 tasks
Copy link
Contributor

@teor2345 teor2345 left a 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:

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.)

@teor2345 teor2345 removed the request for review from jvff April 5, 2022 05:22
@conradoplg
Copy link
Collaborator Author

Started full sync test to check performance

@teor2345 teor2345 added C-enhancement Category: This is an improvement P-High 🔥 A-state Area: State / database changes lightwalletd any work associated with lightwalletd labels Apr 5, 2022
teor2345
teor2345 previously approved these changes Apr 5, 2022
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@conradoplg conradoplg requested a review from a team as a code owner April 11, 2022 00:40
@conradoplg conradoplg requested review from upbqdn and removed request for a team April 11, 2022 00:40
@teor2345 teor2345 force-pushed the db-tx-loc-by-taddr-loc branch from bcd8d0b to 5a4ba1a Compare April 11, 2022 00:41
@teor2345
Copy link
Contributor

I rebased this PR after rebasing the rest of the PR series.

@teor2345
Copy link
Contributor

The macOS tests failed due to a temporary port conflict:

Message: Opening Zcash network protocol listener 127.0.0.1:58891 failed: Os { code: 48, kind: AddrInUse, message: "Address already in use" }. Hint: Check if another zebrad or zcashd process is running. Try changing the network listen_addr in the Zebra config.

https://github.com/ZcashFoundation/zebra/runs/5999791680?check_suite_focus=true#step:13:1927

I'll re-run that job.

Base automatically changed from db-utxo-by-addr to main April 13, 2022 04:06
@teor2345 teor2345 force-pushed the db-tx-loc-by-taddr-loc branch from b8cdc92 to 1059362 Compare April 13, 2022 05:03
@teor2345
Copy link
Contributor

Error: No such container: klt-regenerate-disk-4038-merge-9969dc2-bfnh

https://github.com/ZcashFoundation/zebra/runs/6007481272?check_suite_focus=true#step:10:115

This is a known issue, I'll retry that check.

Copy link
Contributor

@oxarbitrage oxarbitrage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-approving

mergify bot added a commit that referenced this pull request Apr 13, 2022
@teor2345
Copy link
Contributor

This is still failing, I'm going to temporarily turn off that check to get this PR to merge.
(It has passed before on this PR.)

I opened a ticket here:
#4114

@mergify mergify bot merged commit 53a4299 into main Apr 13, 2022
@mergify mergify bot deleted the db-tx-loc-by-taddr-loc branch April 13, 2022 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-state Area: State / database changes C-enhancement Category: This is an improvement lightwalletd any work associated with lightwalletd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tx_loc_by_transparent_addr_loc index to the finalized state
4 participants