-
Notifications
You must be signed in to change notification settings - Fork 390
Persist spks derived from KeychainTxOutIndex
#1963
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
Persist spks derived from KeychainTxOutIndex
#1963
Conversation
7afd8b6
to
c279c99
Compare
c279c99
to
d299dae
Compare
Thanks to @ValuedMammal for the suggestions
90b6813
to
76875e7
Compare
* When merging changesets, assert that spk of a given descriptor id & derivation index does not get changed. * When reading spk from cache, check the spk by deriving it.
fb838d9
to
d761265
Compare
This incentivies constructing `KeychainTxOutIndex` from a changeset before inserting descriptors (to make use of the spk cache).
9d97b29
to
4bc8cc0
Compare
Also added staging changes to `ChangeSet::spk_cache`. This way, we can avoid returning `ChangeSet`s for `apply_changeset` and `insert_descriptor`. * `KeychainTxOutIndex::new` now takes in an additional `use_spk_cache` parameter. * Fixed `reveal_to_target` method to actually return `None` if the keychain does not exist.
4bc8cc0
to
bbbc054
Compare
* `new` is now intended to construct a fresh indexed-tx-graph * `from_changeset` is added for constructing indexed-tx-graph from a previously persisted changeset * added `reindex` for calling after indexer mutations that require it * reintroduce `Default` impl
bbbc054
to
3126cd2
Compare
8fef7c7
to
603f133
Compare
Do not reference last revealed table, in case none are revealed. Correct SQL column name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 62767f0
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 62767f0
tested with bdk-cli
with cache enabled and sqlite schema updated and new table is being populated.
Replaces #1960
Fixes #1964
Description
Users with large wallet and/or complex descriptors may experience slow startup of
KeychainTxOutIndex
. This PR addresses this problem by providing the option to persist derived spks so that they no longer need to be re-derived on startup.The
IndexedTxGraph
API has been changed for better ergonomics.Compared to #1960, this is a more longterm solution that does not depend on multi-threading logic.
Changelog notice
Checklists
All Submissions:
cargo +nightly fmt
andcargo clippy
before committingNew Features: