Skip to content
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

upgrade(swap): Upgrade bdk library #180

Draft
wants to merge 32 commits into
base: master
Choose a base branch
from
Draft

Conversation

Einliterflasche
Copy link

This closes #98.

The new dependencies are part of the bdk upgrade and
include the improved wallet code.
They, too, depend on sqlite3.
However, they use a newer version than we currently use via sqlx.
This necessitated the sqlx upgrade.
This entailed trivial changes (use Pool directly instead of pool.acquire()).
We might have to fix the CI as well, I kept getting compile
errors from the macro until I ran swap/sqlx_dev_setup.sh.
@Einliterflasche Einliterflasche self-assigned this Nov 16, 2024
@Einliterflasche
Copy link
Author

Einliterflasche commented Nov 16, 2024

Oh boy. It looks like we'll have to upgrade bitcoin as well, since [email protected] uses [email protected] but we use [email protected]. I did that and instantly received ~500 compile errors. This upgrade is not at all trivial.

@binarybaron
Copy link

binarybaron commented Nov 16, 2024

Oh boy. It looks like we'll have to upgrade bitcoin as well, since [email protected] uses [email protected] but we use [email protected]. I did that and instantly received ~500 compile errors. This upgrade is not at all trivial.

That's a bummer but I'd assume it's mostly a few API changes that propogate through the codebase. The Bitcoin protocol hasn't changed.

@Einliterflasche
Copy link
Author

Probably. The changelog isn't very clear on that, sadly.

@binarybaron
Copy link

We also have to consider that this upgrade could be a breaking network upgrade if the serde serialization structures have changed.

@binarybaron
Copy link

I haven't looked too much what you are doing here but fyi you do not really need to do any backwards compatability stuff. Our descriptor is derived from our seed.pem which does not change, and we can just re-scan our wallet at first startup.

@Einliterflasche
Copy link
Author

The docs recommended that we get the revelation indices of the wallet to speed up the migration, so that's why I kept some of the old wallet code around

@Einliterflasche
Copy link
Author

I fixed almost all compile errors now. Only left are Wallet::new and Client::new and how their used, some wallet testing code, as well as migrating to the new wallet when needed.

@Einliterflasche
Copy link
Author

This is getting close to completion. The GUI successfully starts and migrates from the old wallet. There are some runtime errors regarding amount precision that we still need to fix.

@Einliterflasche
Copy link
Author

Einliterflasche commented Dec 4, 2024

According to a BDK dev we don't even need to do a full scan when migrating from the old wallet. Since we know the derivation indices a normal sync is sufficient.

@binarybaron
Copy link

According to a BDK dev we don't even need to do a full scan when first creating the new wallet. Since we now the derivation indices a normal sync is sufficient.

We still need to do a full scan if we are restoring the wallet from our seed but NOT migrating from the older bdk wallet. For example, if one deleted the wallet while keeping the seed.pem.

@Einliterflasche
Copy link
Author

We have a dependency conflict again, I submitted a PR to bdk to hopefully bump their dependency on rusqlite.

@Einliterflasche
Copy link
Author

I linked to my fork of bdk for now, we will have to change that before we can merge this PR. Hopefully the bdk devs accept my patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade bdk library
2 participants