Module sapling

Source
Expand description

Sapling-specific database reading and writing.

The sapling scanner database has the following format:

nameReading & Writing Key/Values
SAPLING_TX_IDSSaplingTxIdsCf & WriteSaplingTxIdsBatch

And types: SaplingScannedResult: same as transaction::Hash, but with bytes in display order. None is stored as a zero-length array of bytes.

SaplingScannedDatabaseIndex = SaplingScanningKey | TransactionLocation TransactionLocation = Height | TransactionIndex

This format allows us to efficiently find all the results for each key, and the latest height for each key.

If there are no results for a height, we store None as the result for the coinbase transaction. This allows is to scan each key from the next height after we restart. We also use this mechanism to store key birthday heights, by storing the height before the birthday as the “last scanned” block.

Constants§

SAPLING_TX_IDS
The name of the sapling transaction IDs result column family.

Traits§

DeleteSaplingKeys 🔒
Utility trait for deleting sapling keys in a WriteSaplingTxIdsBatch.
InsertSaplingHeight 🔒
Utility trait for inserting sapling heights into a WriteSaplingTxIdsBatch.

Type Aliases§

SaplingTxIdsCf
The type for reading sapling transaction IDs results from the database.
WriteSaplingTxIdsBatch
The type for writing sapling transaction IDs results from the database.