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

Add tx_loc_by_transparent_addr_loc index to the finalized state #3951

Closed
6 tasks
Tracked by #3134
teor2345 opened this issue Mar 24, 2022 · 0 comments · Fixed by #4038
Closed
6 tasks
Tracked by #3134

Add tx_loc_by_transparent_addr_loc index to the finalized state #3951

teor2345 opened this issue Mar 24, 2022 · 0 comments · Fixed by #4038
Assignees
Labels
A-state Area: State / database changes C-enhancement Category: This is an improvement lightwalletd any work associated with lightwalletd

Comments

@teor2345
Copy link
Contributor

teor2345 commented Mar 24, 2022

Motivation

We want to answer transparent address RPCs quickly, so we need new indexes in the finalized state.

Designs

tx_loc_by_transparent_addr_loc stores transaction locations by address. This list includes transactions containing spent UTXOs.

It also includes the TransactionLocation of transaction for the AddressLocation. (This duplicate data is small, and helps simplify the code.)

Types

TransactionLocation: the height and transaction index of a transaction. Used instead of the hash, to make indexes smaller.
OutputLocation: the height, transaction index, and output index of a transparent output. Used instead of the outpoint, to make indexes smaller.
AddressLocation: the first OutputLocation used by a transparent::Address. Always has the same value for each address, even if the first output is spent.

https://github.com/ZcashFoundation/zebra/blob/main/book/src/dev/rfcs/0005-state-updates.md#rocksdb-data-structures

Tasks

Implementation:

  • Add the new column family to the finalized state
  • Query the finalized index in the ReadRequest for ReadState, if it has already been implemented in:
  • Increment the database version

Testing:

  • Update raw data snapshot tests
  • Add struct data snapshot tests

CI:

  • If you added new Rust module files, make sure the paths in the regenerate state job are up to date
@teor2345 teor2345 added C-enhancement Category: This is an improvement S-needs-triage Status: A bug report needs triage A-state Area: State / database changes lightwalletd any work associated with lightwalletd labels Mar 24, 2022
@conradoplg conradoplg changed the title Add tx_by_transparent_addr_loc index to the finalized state Add tx_loc_by_transparent_addr_loc index to the finalized state Apr 1, 2022
@mergify mergify bot closed this as completed in #4038 Apr 13, 2022
@mpguerra mpguerra removed the S-needs-triage Status: A bug report needs triage label Sep 28, 2022
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 a pull request may close this issue.

3 participants