From: Vihiga Tyonum Date: Tue, 30 Jun 2026 13:07:16 +0000 (+0100) Subject: feat(cbf): Update bdk_kyoto to v0.17.0 X-Git-Url: http://internal-gitweb-vhost/blockdata/script/encode/-script/display/DatabaseConfig.html?a=commitdiff_plain;h=205d46c15f4e6c54b021d1f5192f6985e1a067c4;p=bdk-cli feat(cbf): Update bdk_kyoto to v0.17.0 - update bdk_kyoto to v0.17.0 - add ew broadcast/subscriber API for KyotoClient --- diff --git a/Cargo.lock b/Cargo.lock index 9425b2e..1031c69 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -346,11 +346,11 @@ dependencies = [ [[package]] name = "bdk_kyoto" -version = "0.15.4" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f35b9f8b3aa8c4647bec7a92b050c496742d955e0ac1edcb4e7c2deabf63c54" +checksum = "346c1d502ee4613cf2201db9c3b93a2317772d8eaa372114f34bf5f374be94fd" dependencies = [ - "bdk_wallet 2.1.0", + "bdk_wallet 3.1.0", "bip157", ] @@ -431,13 +431,14 @@ dependencies = [ [[package]] name = "bip157" -version = "0.3.4" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88df5c18baaea9be4219679afbd4fc26491606f89f6ecdaffcdcabd67635b07b" +checksum = "14485468baff5ec4114d186f1683635f3094de9f5a4b3953bf82ac6cccba40e8" dependencies = [ "bip324", "bitcoin", "bitcoin-address-book", + "bitcoin_hashes 0.20.0", "tokio", ] @@ -493,6 +494,15 @@ dependencies = [ "bitcoin", ] +[[package]] +name = "bitcoin-consensus-encoding" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8d7ca3dc8ff835693ad73bf1596240c06f974a31eeb3f611aaedf855f1f2725" +dependencies = [ + "bitcoin-internals 0.5.0", +] + [[package]] name = "bitcoin-hpke" version = "0.13.0" @@ -527,6 +537,12 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a90bbbfa552b49101a230fb2668f3f9ef968c81e6f83cf577e1d4b80f689e1aa" +[[package]] +name = "bitcoin-internals" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a30a22d1f112dde8e16be7b45c63645dc165cef254f835b3e1e9553e485cfa64" + [[package]] name = "bitcoin-io" version = "0.1.4" @@ -596,6 +612,17 @@ dependencies = [ "hex-conservative 0.3.2", ] +[[package]] +name = "bitcoin_hashes" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8a45c2b41c457a9a9e4670422fcbdf109afb3b22bc920b4045e8bdfd788a3d" +dependencies = [ + "bitcoin-consensus-encoding", + "bitcoin-internals 0.5.0", + "hex-conservative 0.3.2", +] + [[package]] name = "bitcoin_uri" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index c3c6938..14184d4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ serde= {version = "1.0", features = ["derive"]} bdk_bitcoind_rpc = { version = "0.21.0", features = ["std"], optional = true } bdk_electrum = { version = "0.23.2", optional = true } bdk_esplora = { version = "0.22.1", features = ["async-https", "tokio"], optional = true } -bdk_kyoto = { version = "0.15.4", optional = true } +bdk_kyoto = { version = "0.17.0", optional = true } bdk_redb = { version = "0.2.0", optional = true } bdk_sp = { version = "0.1.0", optional = true, git = "https://github.com/bitcoindevkit/bdk-sp", tag = "v0.1.0" } shlex = { version = "1.3.0", optional = true } diff --git a/src/client.rs b/src/client.rs index ad51391..9aed57f 100644 --- a/src/client.rs +++ b/src/client.rs @@ -23,10 +23,7 @@ use { }; #[cfg(feature = "cbf")] -use { - crate::utils::trace_logger, - bdk_kyoto::{BuilderExt, LightClient}, -}; +use {crate::utils::trace_logger, bdk_kyoto::BuilderExt}; #[cfg(any( feature = "electrum", @@ -103,7 +100,7 @@ impl BlockchainClient { let txid = tx.compute_txid(); let wtxid = client .requester - .broadcast_random(tx.clone()) + .submit_package(tx) .await .map_err(|_| { tracing::warn!("Broadcast was unsuccessful"); @@ -205,7 +202,8 @@ impl BlockchainClient { #[cfg(feature = "cbf")] pub struct KyotoClientHandle { pub requester: bdk_kyoto::Requester, - pub update_subscriber: tokio::sync::Mutex, + pub update_subscriber: + tokio::sync::Mutex>, } #[cfg(any( @@ -267,21 +265,16 @@ pub(crate) fn new_blockchain_client( .data_dir(&_datadir) .build_with_wallet(_wallet, scan_type)?; - let LightClient { - requester, - info_subscriber, - warning_subscriber, - update_subscriber, - node, - } = light_client; + let (client, logging, update_subscriber) = light_client.subscribe(); + // `start()` spawns the node's run loop on a tokio task internally. + let requester = client.start().requester(); let subscriber = tracing_subscriber::FmtSubscriber::new(); let _ = tracing::subscriber::set_global_default(subscriber); - tokio::task::spawn(async move { node.run().await }); - tokio::task::spawn( - async move { trace_logger(info_subscriber, warning_subscriber).await }, - ); + tokio::task::spawn(async move { + trace_logger(logging.info_subscriber, logging.warning_subscriber).await + }); BlockchainClient::KyotoClient { client: Box::new(KyotoClientHandle {