Add utxo_by_transparent_addr_loc index to the finalized state #3953
Labels
A-state
Area: State / database changes
C-enhancement
Category: This is an improvement
lightwalletd
any work associated with lightwalletd
Motivation
We want to answer transparent address RPCs quickly, so we need new indexes in the finalized state.
Designs
utxo_by_transparent_addr_loc
stores unspent transparent output locations by address. UTXO locations are appended by each block.This list includes the
AddressLocation
, if it has not been spent.When a block write deletes a UTXO from
utxo_by_out_loc
, that UTXO location should be deleted fromutxo_by_transparent_addr_loc
. TheOutputLocations
are in order, so the deleted UTXO can be removed efficiently. This is an index optimisation, which does not affect query results. It also simplifies the lookup code.Types
AddressLocation
: the firstOutputLocation
used by atransparent::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:
Testing:
CI:
The text was updated successfully, but these errors were encountered: