Skip to content

Conversation

@notmandatory
Copy link
Member

@notmandatory notmandatory commented May 29, 2025

Description

  • Updated dependencies:

    • bdk_wallet to 2.0.0
    • bdk_bitcoind_rpc to 0.20.0
    • bdk_electrum to 0.23.0
    • bdk_esplora to 0.22.0
    • bdk_kyoto to 0.11.0
  • Renamed BuilderError to KyotoBuilderError

  • Added KyotoUpdateError

Notes to the reviewers

There are still some unrelated warnings in the test code that should be fixed in a followup PR.

Changelog notice

  • Updated project to use bdk_wallet 2.0 and related supporting chain client versions.

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

@notmandatory notmandatory self-assigned this May 29, 2025
@notmandatory notmandatory removed this from BDK-CLI May 29, 2025
@notmandatory notmandatory moved this to In Progress in BDK-CLI May 29, 2025
@notmandatory notmandatory added this to the CLI 1.1.0 milestone May 29, 2025
@notmandatory notmandatory added the enhancement New feature or request label May 29, 2025
@notmandatory
Copy link
Member Author

@rustaceanrob let me know when you get an updated bdk_kyoto and I'll test it out here too.

@rustaceanrob
Copy link
Contributor

0.11.0 is out on crates.io with the updated wallet

bdk_bitcoind_rpc to 0.20.0
bdk_electrum to 0.23.0
bdk_esplora to 0.22.0
bdk_kyoto to 0.11.0

Renamed BuilderError to KyotoBuilderError
Added KyotoUpdateError
@coveralls
Copy link

Pull Request Test Coverage Report for Build 15478212221

Details

  • 0 of 17 (0.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.04%) to 2.665%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/utils.rs 0 1 0.0%
src/handlers.rs 0 16 0.0%
Totals Coverage Status
Change from base Build 15422078682: -0.04%
Covered Lines: 25
Relevant Lines: 938

💛 - Coveralls

@notmandatory notmandatory marked this pull request as ready for review June 5, 2025 22:09
@notmandatory
Copy link
Member Author

I still need to do some manual testing for the Kyoto update before we merge this.

@notmandatory
Copy link
Member Author

notmandatory commented Jun 6, 2025

@rustaceanrob I got the below error when testing cbf sync, do you think it's related to this update or something else?

  1. bdk-cli config
export NETWORK=testnet4
export EXT_DESCRIPTOR='wpkh(tprv8ZgxMBicQKsPdMzWj9KHvoExKJDqfZFuT5D8o9XVZ3wfyUcnPNPJKncq5df8kpDWnMxoKbGrpS44VawHG17ZSwTkdhEtVRzSYXd14vDYXKw/0/*)'
export INT_DESCRIPTOR='wpkh(tprv8ZgxMBicQKsPdMzWj9KHvoExKJDqfZFuT5D8o9XVZ3wfyUcnPNPJKncq5df8kpDWnMxoKbGrpS44VawHG17ZSwTkdhEtVRzSYXd14vDYXKw/1/*)'
export CLIENT_TYPE=cbf
export DATABASE_TYPE=sqlite
  1. initial sync works

  2. all syncs after I sent (currently unconfirmed) new payment to wallet address

RUST_LOG=debug cargo run --features cbf,sqlite,repl --no-default-features -- wallet sync
[2025-06-06T15:55:04Z DEBUG bdk_cli] network: Testnet4
[2025-06-06T15:55:04Z DEBUG bdk_cli::handlers] Sqlite database opened successfully
2025-06-06T15:55:04.455842Z  INFO bdk_cli::utils: Kyoto node is running
2025-06-06T15:55:04.456030Z  INFO bdk_cli::utils: Starting node
2025-06-06T15:55:04.456041Z  INFO bdk_cli::utils: Configured connection requirement: 2 peers
2025-06-06T15:55:04.456045Z  INFO bdk_cli::utils: Attempting to load headers from the database
2025-06-06T15:55:04.462090Z  INFO bdk_cli::utils: Unexpected invalid proof of work when importing a block header. expected 419812630, got: 486604799
[2025-06-06T15:55:04Z ERROR bdk_cli] BDK-Kyoto update error: the node halted execution.

I get the same error if I remove my data directory (rm -rf ~/.bdk-bitcoin) and then re-sync. Initial sync works, but subsequent syncs fail in the same way and don't show my pending unconfirmed tx.
https://mempool.space/testnet4/tx/ea3c1b2b65dd50963d9dc39b3760e66a69ef137861723c625d113474ab5f03aa

@rustaceanrob
Copy link
Contributor

Looks like there is a bug for Testnet4 that does not allow for the 20 minute exception. If you switch to Signet I expect everything to work properly. I'll be able to work on a patch in a week or two

@notmandatory
Copy link
Member Author

Looks like at least a 6-7 block reorg happened on testnet4.

Screenshot 2025-06-06 at 12 11 25

@rustaceanrob
Copy link
Contributor

Yeah they happen often, I know exactly where in the header validation I can add an exception. It's a shame validation can't be the shame for all networks, but I'll have a fix up at some point. The problem should not be the forks themselves, just that minimum difficulty blocks are allowed

@notmandatory
Copy link
Member Author

Makes sense, thanks for taking a look and good to know it's just a testnet4 thing you can fixup later.

@notmandatory
Copy link
Member Author

I confirmed CBF/Kyoto sync and receive test works fine on signet.

@notmandatory notmandatory requested a review from tvpeter June 6, 2025 18:25
@tvpeter
Copy link
Collaborator

tvpeter commented Jun 7, 2025

tACK bd526bd

I confirmed CBF/Kyoto sync and receive test works fine on signet.

I've tested signet and testnet4 on electrum and they worked well. Kyoto do get stuck for me establishing connections but Rob previously explained that it might be due to poor connectivity. So since yours worked, I'm confident it'll work for me too.

Copy link
Collaborator

@tvpeter tvpeter left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @notmandatory

@tvpeter tvpeter merged commit f0b51cb into bitcoindevkit:master Jun 7, 2025
8 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in BDK-CLI Jun 7, 2025
rustaceanrob added a commit to rustaceanrob/kyoto that referenced this pull request Jun 18, 2025
Raised by: bitcoindevkit/bdk-cli#197

Users of `Testnet4` will run into problems when loading headers from the
database, as the network allows for minimum difficulty blocks. Instead
of adding logic for the header timestamps just for the sake of
`Testnet4`, I am opting to simply ignore the difficutly adjustment. This
boolean does not evaluate to `true` on `Bitcoin`, which is easily
verified in `rust-bitcoin`.

Notably `Signet` does not allow minimum difficulty blocks, so difficulty
adjustment logic is still tested by a testnet as well as mainnet. This
is only dropping `Testnet4`
rustaceanrob added a commit to rustaceanrob/kyoto that referenced this pull request Jun 18, 2025
Raised by: bitcoindevkit/bdk-cli#197

Users of `Testnet4` will run into problems when loading headers from the
database, as the network allows for minimum difficulty blocks. Instead
of adding logic for the header timestamps just for the sake of
`Testnet4`, I am opting to simply ignore the difficutly adjustment. This
boolean does not evaluate to `true` on `Bitcoin`, which is easily
verified in `rust-bitcoin`.

Notably `Signet` does not allow minimum difficulty blocks, so difficulty
adjustment logic is still tested by a testnet as well as mainnet. This
is only dropping `Testnet4`
open-archer702 added a commit to open-archer702/kyoto that referenced this pull request Sep 29, 2025
Raised by: bitcoindevkit/bdk-cli#197

Users of `Testnet4` will run into problems when loading headers from the
database, as the network allows for minimum difficulty blocks. Instead
of adding logic for the header timestamps just for the sake of
`Testnet4`, I am opting to simply ignore the difficutly adjustment. This
boolean does not evaluate to `true` on `Bitcoin`, which is easily
verified in `rust-bitcoin`.

Notably `Signet` does not allow minimum difficulty blocks, so difficulty
adjustment logic is still tested by a testnet as well as mainnet. This
is only dropping `Testnet4`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants