-
Notifications
You must be signed in to change notification settings - Fork 354
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
Improve docs in terms of persistence with Wallet
#1542
Comments
Thank you! Preferably, this wouldn't only be reflected in docs, but also in the API, e.g, either allowing us to get notified when persistence needs to happen or by returning a corresponding Also, please add guidance how to deal with persistence failures. Do we need to abort the current operation? Can we retry? Until when? Are there circumstances under which we need to panic as continuing without persistence would be considered highly unsafe? |
Isn't this up to the caller to decide? We just need to inform the caller which methods would reveal a new address/spk (since if we don't persist immediately, it will result in address reuse). Everything else, can be delayed (with no catastrophic consequences) if changes are not persisted.
The persistence backend is responsible for returning errors which are informative and hopefully it can be dealt with.
Unsafe in what regard? The database is left corrupted? The database data is left in an inconsistent state? -> There are all persistence-backend-specific right? Determining whether data not being persisted would lead to something disastrous, isn't this dependent on the application? |
I mean yes, I mostly agree with all three of these points, but the API docs should still highlight what the consequences of address reuse (or, FWIW, any other edge cases arising from BDK's state not being immediately/correctly persisted) might be. Yes, it's application-specific, but it still would be important to make the API as safe as possible and the docs as accommodating to users with different knowledge levels as possible (without becoming overly verbose, of course). |
Describe the enhancement
PersistWith<CustomDb>
forWallet
..persist
onWallet
.cc. @tnull
The text was updated successfully, but these errors were encountered: