-
Notifications
You must be signed in to change notification settings - Fork 423
feat: add one-liner wallet sync API with ElectrumSync #2094
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
|
The PR is ready for review. |
|
Where exactly is the "small, focused helper abstraction"? You changed nothing of relevance in the There is a whole lot of unrelated changes - I'm assuming this is an attempt at making thing run/compile on windows? This does not belong in this PR - feel free to create a new PR for these changes. |
|
Fixed it. |
|
@ShigrafS the "one liner helper" is currently an example and not part of the library. |
|
@evanlinjin I was thinking this fits right within the scope of the issue with respect to the last PR. |
|
This PR doesn't add a 1-liner API to the bdk_electrum crate, nor does it make sense to add one IMO. I think the core issue is that we kept #1974 open when it should not be. Worse, we added a My suggestion is to either:
|
Closes #1974
Description
This PR introduces a small, focused helper abstraction to reduce the boilerplate required to synchronize a wallet index with an Electrum server, addressing the usability concerns raised in #1974.
The main addition is the
ElectrumSynchelper andSyncOptions, which wrap existingSyncRequestandFullScanRequestflows into a single, ergonomic call while preserving the existingBdkElectrumClientcache and behavior.Concretely, this PR:
ElectrumSync, a lightweight helper for performing Electrum syncs using a sharedBdkElectrumClientSyncOptionsto configure fast sync vs full scan, stop gap, batch size, and prevout fetchingbdk_electrumfor reuseThe helper is intentionally minimal and builds directly on top of existing BDK primitives without introducing a new builder API or altering wallet abstractions.
Notes to the reviewers
This PR is informed by the feedback and architectural concerns raised in #2059.
In particular:
BdkElectrumClientand its cache across sync calls, avoiding the performance regressions discussed previously.The goal of this PR is to provide a convenience layer that demonstrates a simplified sync flow while remaining close to existing abstractions.
Feedback on whether this belongs as a public helper or should instead live purely as an example is very welcome.
Changelog notice
ElectrumSyncandSyncOptionshelpers to simplify Electrum wallet synchronizationChecklists
All Submissions:
New Features:
Bugfixes: