Skip to content

Bump bdk_kyoto version#864

Merged
thunderbiscuit merged 1 commit intobitcoindevkit:masterfrom
rustaceanrob:9-24-kyoto-upgrade
Oct 3, 2025
Merged

Bump bdk_kyoto version#864
thunderbiscuit merged 1 commit intobitcoindevkit:masterfrom
rustaceanrob:9-24-kyoto-upgrade

Conversation

@rustaceanrob
Copy link
Copy Markdown
Collaborator

Work in progress draft PR. Copied from my commit message:

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.

Changelog notice

Checklists

All Submissions:

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

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

@rustaceanrob rustaceanrob force-pushed the 9-24-kyoto-upgrade branch 2 times, most recently from a78f5eb to d0d2a95 Compare September 30, 2025 09:28
@rustaceanrob rustaceanrob marked this pull request as ready for review September 30, 2025 09:41
Comment thread bdk-ffi/src/kyoto.rs
.build()
.unwrap()
.block_on(lookup_host(hostname, self.dns_resolver));
.block_on(lookup_host(hostname));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

if blocking here should we remove the async for the function?

I know it was already like this but it just caught my eye here on review

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes we should, good call.

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.
Copy link
Copy Markdown
Member

@thunderbiscuit thunderbiscuit left a comment

Choose a reason for hiding this comment

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

ACK e428b03.

Copy link
Copy Markdown
Collaborator

@reez reez left a comment

Choose a reason for hiding this comment

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

ACK e428b03

@thunderbiscuit thunderbiscuit merged commit e428b03 into bitcoindevkit:master Oct 3, 2025
6 checks passed
@rustaceanrob rustaceanrob deleted the 9-24-kyoto-upgrade branch October 4, 2025 08:05
@ItoroD
Copy link
Copy Markdown
Collaborator

ItoroD commented Oct 6, 2025

@rustaceanrob For ScanType, since New is removed I believe Sync will just handle for when the wallet is newly setup as well. As in, although I do not technically have a last checkpoint because I am new wallet, it still downloads as if starting point was the last check point?

@rustaceanrob
Copy link
Copy Markdown
Collaborator Author

It will actually start from genesis. This was partially due to developers not using the option in practice, and the checkpoints being a trust-vector and maintenance burden. For wallets that are known to be new, they may recover from taproot.

Another strategy is they can ping mempool.space for a recent checkpoint and add it to the wallet.

@ItoroD
Copy link
Copy Markdown
Collaborator

ItoroD commented Oct 6, 2025

It will actually start from genesis. This was partially due to developers not using the option in practice, and the checkpoints being a trust-vector and maintenance burden. For wallets that are known to be new, they may recover from taproot.

Another strategy is they can ping mempool.space for a recent checkpoint and add it to the wallet.

Alright, thanks for the explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants