Skip to content

Commit e428b03

Browse files
rustaceanrobthunderbiscuit
authored andcommitted
Bump bdk_kyoto version
The CBF crate, renamed on crates.io from `kyoto` to `bip157`, includes some performance improvements and dependency reduction. Starting with a relatively simple change, the configuration of a DNS resolver has been removed, as DNS is now carried out by the operating system. In testing this has resolved problems for DNS queries while using a VPN or on public WiFi (with firewalls). Now the CBF node does no disk I/O over `sqlite`. This removes a number of warings and errors related to persistance. All chain data is stored within the `Wallet` structure and subsequently persisted to `bdk_chain`'s extension for `sqlite`. This creates a single source-of-truth for persistance between sessions, which has been a huge pain point in the past. The logic of `CheckPoint::insert` handles competing forks. The builder has no error cases at the FFI level with this change. The `ScanType` has been reduced to two options, `Scan` or `Recovery`. The `Recovery` variant contains a few notable checkpoints to start from. It also contains a field that the user may set to peek scripts while scanning filters. This should be approximately the number of scripts revealed by the wallet being recovered. The guidance for developers here would be to set conservatively. One scheme is setting the peek to 1_000, 10_000, 100_000, depending on profiles: normal, power user, enterprise. The `Info` variants have been reduced to a single `Progress` containing all info related to the sync. Broadcasting a transaction now waits for the confirmation of gossip, as in at least one remote node asked for the transaction be shared with them. `Node::run` is now mutable. This implies `CbfNode.run()` can only be called once. I think that is perferctly reasonable as any other type of behavior is faulty. `bitcoin-address-book` is a simple crate I created to abstract peer selection, which `bip157` depends on.
1 parent 34248a9 commit e428b03

File tree

4 files changed

+121
-154
lines changed

4 files changed

+121
-154
lines changed

bdk-ffi/Cargo.lock

Lines changed: 24 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bdk-ffi/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ path = "uniffi-bindgen.rs"
1818
bdk_wallet = { version = "2.1.0", features = ["all-keys", "keys-bip39", "rusqlite"] }
1919
bdk_esplora = { version = "0.22.1", default-features = false, features = ["std", "blocking", "blocking-https-rustls"] }
2020
bdk_electrum = { version = "0.23.1", default-features = false, features = ["use-rustls-ring"] }
21-
bdk_kyoto = { version = "0.14.0" }
21+
bdk_kyoto = { version = "0.15.0" }
2222

2323
uniffi = { version = "=0.29.4", features = ["cli"]}
2424
thiserror = "1.0.58"

bdk-ffi/src/error.rs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -776,12 +776,6 @@ pub enum TxidParseError {
776776
InvalidTxid { txid: String },
777777
}
778778

779-
#[derive(Debug, thiserror::Error, uniffi::Error)]
780-
pub enum CbfBuilderError {
781-
#[error("the database could not be opened or created: {reason}")]
782-
DatabaseError { reason: String },
783-
}
784-
785779
#[derive(Debug, thiserror::Error, uniffi::Error)]
786780
pub enum CbfError {
787781
#[error("the node is no longer running")]
@@ -1569,16 +1563,8 @@ pub enum HashParseError {
15691563
InvalidHexString { hex: String },
15701564
}
15711565

1572-
impl From<bdk_kyoto::builder::SqlInitializationError> for CbfBuilderError {
1573-
fn from(value: bdk_kyoto::builder::SqlInitializationError) -> Self {
1574-
CbfBuilderError::DatabaseError {
1575-
reason: value.to_string(),
1576-
}
1577-
}
1578-
}
1579-
1580-
impl From<bdk_kyoto::kyoto::ClientError> for CbfError {
1581-
fn from(_value: bdk_kyoto::kyoto::ClientError) -> Self {
1566+
impl From<bdk_kyoto::bip157::ClientError> for CbfError {
1567+
fn from(_value: bdk_kyoto::bip157::ClientError) -> Self {
15821568
CbfError::NodeStopped
15831569
}
15841570
}

0 commit comments

Comments
 (0)