Re-use existing raw database code for the scanner, without splitting the state yet #8001
Labels
A-blockchain-scanner
Area: Blockchain scanner of shielded transactions
A-state
Area: State / database changes
C-enhancement
Category: This is an improvement
Motivation
For a new database, we can re-use the existing state database code, and pass it a different state path and column family names.
We can use the existing binary serialization formats. Database lookups are fast. Concurrent writing just works.
Rough Design
Here's a rough sketch of the minimum necessary code changes:
db_path
,db_version
, andcolumn_family_list
arguments toZebraDb::new()
db_path
isstate
forzebra-state
, and could beprivate-scan
forzebra-scan
. The other arguments are existing constants.ZebraDb
fromzebra-state
Rejected Alternatives
If we re-used the existing state database, we could add a new column family name, and we don't need to change the state path. But the results are harder to delete, because they are mixed with publicly available cached data. This is a security issue.
Related Work
Originally posted by @teor2345 in #7975 (reply in thread)
The text was updated successfully, but these errors were encountered: