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

wallet: bdk-beta.6 migration #330

Draft
wants to merge 6 commits into
base: macros/wallet-bdk
Choose a base branch
from

Conversation

mialso
Copy link

@mialso mialso commented Dec 21, 2024

Description:

  • wallet: use latest bdk, recent beta.6 version bdk_wallet

TODO:

  • wallet: persistence
  • check_transaction: enable rbf usage
  • error handling
  • tests

bdk_chain = { version = "0.17" }
bdk_esplora = { version = "0.16", features = ["blocking"] }
bdk_file_store = { version = "0.14" }
bdk_wallet = { version = "1.0.0-beta.6", features = ["keys-bip39"] }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you choose this version? and not working with the alpha.11?

looks like that this version https://github.com/bitcoindevkit/bdk/blob/v1.0.0-beta.6/crates/bitcoind_rpc/Cargo.toml#L19 is not compatible with lampo

Copy link
Author

@mialso mialso Dec 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my first attempt to go with alpha.11 failed, due to cargo update error

$ cargo update
error: no matching package named `bdk_persist` found
location searched: registry `crates-io`
required by package `bdk v1.0.0-alpha.11`
    ... which satisfies dependency `bdk = "^1.0.0-alpha.11"` of package `lampo-core-wallet v0.1.0 (/home/mialso/projects/clones/lampo.rs/lampo-core-wallet)`
    ... which satisfies path dependency `lampo-core-wallet` of package `lampod-cli v0.1.0 (/home/mialso/projects/clones/lampo.rs/lampod-cli)`

thus I decided to go with latest beta.6

)
.network(network)
// .create_wallet(&mut db)?;
.create_wallet_no_persist()?;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you removing the persistence of the wallet?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a simplification step, to pass compiler and move forward (I put persistence is a TODO)
since bdk_wallet has PersistedWallet special type opposed to just Wallet, need to reflect those typings and do proper sync implementation

@@ -177,11 +199,11 @@ impl WalletManager for BDKWalletManager {
let txs = wallet
.list_unspent()
.map(|tx| Utxo {
txid: tx.outpoint.txid.to_hex(),
txid: format!("{:x}", tx.outpoint.txid),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
txid: format!("{:x}", tx.outpoint.txid),
txid: format!("{:x}", tx.outpoint.txid),

You are returning a debug string here, and it is wrong because the txid is used by others to lookup the transaction status, but in this way you are breaking every user

graph: update_graph,
chain: Some(chain_update),
};
let client = bdk_esplora::esplora_client::Builder::new(esplora_url).build_blocking();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point of using bdk alpha and beta was to use the bitcoin core backend

In the issue #317 there is the following assertion

Keep in mind that Lampo currently uses Bitcoin Core (or similar tools) to fetch information from the network.

@vincenzopalazzo
Copy link
Owner

As discussed in person, I think this PR is blocked by the

I will try to work and finish the 292 this week!

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.

2 participants