]> Untitled Git - bdk/log
bdk
4 months agochore(bdk-chain): bump to `0.23.1`, update `CHANGELOG`
Leonardo Lima [Thu, 31 Jul 2025 14:51:34 +0000 (11:51 -0300)]
chore(bdk-chain): bump to `0.23.1`, update `CHANGELOG`

chore(bdk-core): bump to `bdk-core` `0.6.1` and update `CHANGELOG`

chore(bdk-testenv): bump to `bdk-testenv` `0.13.1` and update `CHANGELOG`

chore(bdk-filestore): bump to `0.21.1` and update `CHANGELOG`

chore(bitcoind-rpc): bump to `0.21.0` and update `CHANGELOG`

chore(bdk-electrum): bump to `0.23.1` and update `CHANGELOG`

chore(bdk-esplora): bump to `0.22.1` and update `CHANGELOG`

4 months agoMerge bitcoindevkit/bdk#1989: chore(bdk-electrum): use new `batch_transaction_get_mer...
merge-script [Mon, 4 Aug 2025 16:11:13 +0000 (13:11 -0300)]
Merge bitcoindevkit/bdk#1989: chore(bdk-electrum): use new `batch_transaction_get_merkle` API

b663940ac3c81f57589f13bcc49dc1f8b483dc74 chore(bdk-electrum): use new `batch_transaction_get_merkle` API (Leonardo Lima)

Pull request description:

  fixes #1987
  depends on https://github.com/bitcoindevkit/rust-electrum-client/pull/170

  ### Description

  - update `batch_fetch_anchors` to use `batch_transaction_get_merkle` method instead of manually creating the batch call.

  ### Changelog notice

  ```md
  ### Changes
  - Use new `batch_transaction_get_merkle` method instead of batch raw calls
  ```

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo +nightly fmt` and `cargo clippy` before committing

ACKs for top commit:
  ValuedMammal:
    ACK b663940ac3c81f57589f13bcc49dc1f8b483dc74
  LagginTimes:
    ACK b663940ac3c81f57589f13bcc49dc1f8b483dc74

Tree-SHA512: 8c08bcaf99bb65098015995eae67c710fbe2f8e76d47796aebbfba1c5a1c78174023be3cb21299e4c820d156110742c9e85819c253dcf9bc3e1fa1621ca35378

4 months agochore(bdk-electrum): use new `batch_transaction_get_merkle` API
Leonardo Lima [Fri, 4 Jul 2025 18:46:03 +0000 (15:46 -0300)]
chore(bdk-electrum): use new `batch_transaction_get_merkle` API

- removes the now unused `serde_json` dependency from `bdk_electrum`.
- update `batch_fetch_anchors` to use `batch_transaction_get_merkle`
  method instead of manually creating the batch call.

4 months agoMerge bitcoindevkit/bdk#1994: ci: automated update to rustc 1.88.0
merge-script [Fri, 1 Aug 2025 16:27:27 +0000 (12:27 -0400)]
Merge bitcoindevkit/bdk#1994: ci: automated update to rustc 1.88.0

cedf9e1a01bcb6703cd543a8a791d4db4f688c82 ci: automated update to rustc 1.88.0 (Github Action)

Pull request description:

  Automated update to Github CI workflow `cont_integration.yml` by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

ACKs for top commit:
  ValuedMammal:
    ACK cedf9e1a01bcb6703cd543a8a791d4db4f688c82

Tree-SHA512: 8b310912b41ec3171681c8a62f180e61e54929776e82b6221debecdd04b36c03aca5c1d83fc6261fed21807a71284cb47ed8c0ca2b7290428242c9fb618e1ed2

4 months agoMerge bitcoindevkit/bdk#1986: ci: replace grcov by cargo-llvm-cov
merge-script [Tue, 29 Jul 2025 23:51:06 +0000 (19:51 -0400)]
Merge bitcoindevkit/bdk#1986: ci: replace grcov by cargo-llvm-cov

066c4cd160f6d4c70409b299a173f31f93728fae ci: replace grcov by cargo-llvm-cov (nymius)

Pull request description:

  ### Description

  As explained in #1984 , I discovered some misreportings in the coverage information given by grcov.

  Fixes #1984

  ### Notes to the reviewers

  The discussion about the tool to use is open, but I'm adding this PR to showcase how a change from `grcov` to `cargo-llvm-cov` would look like and the improvements in reporting this change will bring. [Look the report in `coveralls`](https://coveralls.io/github/nymius/bdk?branch=ci/replace-grcov-by-cargo-llvm-cov) to get a better perspective of them.

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo +nightly fmt` and `cargo clippy` before committing

ACKs for top commit:
  ValuedMammal:
    ACK 066c4cd160f6d4c70409b299a173f31f93728fae
  oleonardolima:
    ACK 066c4cd160f6d4c70409b299a173f31f93728fae

Tree-SHA512: d237fcc36efb6a4d3ccfaa371c2c70fc18ee40b48ca48f1230c5df6dca093f57bc1096927ddb15f9cae59a4640d9e34bf3ef1a309037e21fe0e8348e132bf38d

4 months agoMerge bitcoindevkit/bdk#2001: ci: fix `socket2` pin
merge-script [Tue, 29 Jul 2025 18:52:52 +0000 (15:52 -0300)]
Merge bitcoindevkit/bdk#2001: ci: fix `socket2` pin

5ebbac83ee2dcf50011976d55e0446d9f23780f8 ci: fix `socket2` pin (Wei Chen)

Pull request description:

  ### Description

  Fix `socket2` pin that was causing CI issues.

  ### Changelog notice

  * Unpinned `socket2` dependency that was causing CI issues.

  ### Checklists

  #### All Submissions:

  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)

ACKs for top commit:
  oleonardolima:
    ACK 5ebbac83ee2dcf50011976d55e0446d9f23780f8
  notmandatory:
    ACK 5ebbac83ee2dcf50011976d55e0446d9f23780f8

Tree-SHA512: f5b59fb0f8489f136f4e817de72a728a785e4e4803624143f90d35a70cba9cc4b0185c1fa3fcc42132cccd7bc4b80d7b7d8469e1c172b68e790dfe1af253ac7b

4 months agoci: fix `socket2` pin
Wei Chen [Tue, 29 Jul 2025 10:29:48 +0000 (10:29 +0000)]
ci: fix `socket2` pin

4 months agoMerge bitcoindevkit/bdk#1988: Detect new mempool txs
merge-script [Sat, 26 Jul 2025 10:47:05 +0000 (10:47 +0000)]
Merge bitcoindevkit/bdk#1988: Detect new mempool txs

51ee99a39fbf9a6dc0ead964e794ca3bebd43ed0 docs(bitcoind_rpc): fixed typo in docs (Wei Chen)
73ab1eb06bcfaa0368a07b84a054bdd2f4f84f06 chore(bitcoind_rpc): Make clippy happy (志宇)
7e894f464ffc0fc21a05e485eae574292e8a63d5 feat(bitcoind_rpc)!: Use `getrawmempool` without verbose (志宇)
05464ecf850feabd30a13aa4927d8797d06148cf fix(bitcoind_rpc)!: Simplify emitter (志宇)
67dfb0b1482f81fe5a888e94c8f54dc5be99e409 test(bitcoind_rpc): Detect new mempool txs (志宇)

Pull request description:

  ### Description

  There is a bug in `bdk_bitcoind_rpc` where some new mempool transactions will not be emitted at all.

  This problem exists because the avoid-re-emission logic depends on rounded-to-nearest-second timestamps.

  The fix is to just emit all mempool transactions but wrap them in `Arc`s so that emission becomes cheap.

  **Background:** I tried using `bdk_bitcoind_rpc` as the chain-source to write an example to showcase the [`IntentTracker`](https://github.com/bitcoindevkit/bdk_wallet/pull/257). However, `bdk_bitcoind_rpc` failed to emit some mempool transactions.

  ### Notes to the reviewers

  The test added in c22c68f fails without these fixes.

  Some tests are removed as they are no longer relevant.

  ### Changelog notice

  ```md
  Fixed:
  - Some mempool transactions not being emitted at all. The fix is to replace the avoid-re-emission-logic with one which emits all mempool transactions.
  ```

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo +nightly fmt` and `cargo clippy` before committing

  #### Bugfixes:

  * [x] This pull request breaks the existing API
  * [x] I've added tests to reproduce the issue which are now passing
  ~* [ ] I'm linking the issue being fixed by this PR~

ACKs for top commit:
  nymius:
    cACK 51ee99a39fbf9a6dc0ead964e794ca3bebd43ed0
  LagginTimes:
    Re-ACK 51ee99a39fbf9a6dc0ead964e794ca3bebd43ed0

Tree-SHA512: 04e180e1d28c3f4c581a61ccac95e8e7e6927123d272ed07eae0ae51bf70799df44298b47ba0e49a309fd76366875e8d18d73478252931713137844857b8ed5a

4 months agoMerge bitcoindevkit/bdk#1999: fix(ci): pin `socket2@0.6.0` to `0.5.10` on MSRV
merge-script [Fri, 25 Jul 2025 23:03:51 +0000 (20:03 -0300)]
Merge bitcoindevkit/bdk#1999: fix(ci): pin `socket2@0.6.0` to `0.5.10` on MSRV

87399b117abf5130da236e47181d64a611138bf3 fix(ci): pin `socket2@0.6.0` to `0.5.10` (Leonardo Lima)

Pull request description:

  ### Description

  It pins the `socket2@0.6.0` to `0.5.10` in order to fix the MSRV CI step.

  ### Changelog notice

  - Update the `ci/pin-msrv.sh` to also pin `socket2@0.6.0` to `0.5.10` version.

  ### Checklists

  #### All Submissions:

  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)

ACKs for top commit:
  ValuedMammal:
    ACK 87399b117abf5130da236e47181d64a611138bf3
  LagginTimes:
    ACK 87399b117abf5130da236e47181d64a611138bf3

Tree-SHA512: 739345cdc7c6f51b77f9a6bcb9b8abafcb5bbec3142674f94eaa5394e9a83643de27cbc62e7962790352be17f7c4cc3812844054c7d01b129aace1bb100b3b97

4 months agofix(ci): pin `socket2@0.6.0` to `0.5.10`
Leonardo Lima [Thu, 24 Jul 2025 18:49:48 +0000 (15:49 -0300)]
fix(ci): pin `socket2@0.6.0` to `0.5.10`

4 months agodocs(bitcoind_rpc): fixed typo in docs
Wei Chen [Mon, 21 Jul 2025 07:27:22 +0000 (07:27 +0000)]
docs(bitcoind_rpc): fixed typo in docs

5 months agoMerge bitcoindevkit/bdk#1996: ci: pin `webpki-roots` for MSRV compatibility
merge-script [Sat, 19 Jul 2025 07:46:12 +0000 (07:46 +0000)]
Merge bitcoindevkit/bdk#1996: ci: pin `webpki-roots` for MSRV compatibility

e1c8891e599d0d3215ba4d86b61d49c083517c96 ci: pin `webpki-roots` for MSRV compatibility (Wei Chen)

Pull request description:

  ### Description

  This PR pins the `webpki-roots` crate to version 1.0.1 to maintain compatibility with our current MSRV.

  ### Changelog notice

  - Pin `webpki-roots` to 1.0.1 for MSRV compatibility.

  ### Checklists

  #### All Submissions:

  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)

ACKs for top commit:
  oleonardolima:
    ACK e1c8891e599d0d3215ba4d86b61d49c083517c96
  evanlinjin:
    ACK e1c8891e599d0d3215ba4d86b61d49c083517c96

Tree-SHA512: 9849cf47f6c269b100374d4c32591ea0caa70f40f0249ead6e5364862f939efff1dffb612d5760622c6389d38874c7c238f4774c019e483ce6dcd826939d653d

5 months agoci: pin `webpki-roots` for MSRV compatibility
Wei Chen [Fri, 18 Jul 2025 18:39:04 +0000 (18:39 +0000)]
ci: pin `webpki-roots` for MSRV compatibility

5 months agoMerge bitcoindevkit/bdk#1977: Add `TxGraph::get_last_evicted`
merge-script [Fri, 18 Jul 2025 11:15:10 +0000 (11:15 +0000)]
Merge bitcoindevkit/bdk#1977: Add `TxGraph::get_last_evicted`

b555acb91e30f7134ec2663477b015225140b11b feat(chain): Add `TxGraph::get_last_evicted` (志宇)

Pull request description:

  ### Description

  Ideally, this would be included as a field in `TxNode`, however that would be a breaking change.

  ### Changelog notice

  ```md
  Added
  - `TxGraph::get_last_evicted`
  ```

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo +nightly fmt` and `cargo clippy` before committing

  #### New Features:

  ~* [ ] I've added tests for the new feature~
  * [x] I've added docs for the new feature

ACKs for top commit:
  evanlinjin:
    self-ACK b555acb91e30f7134ec2663477b015225140b11b

Tree-SHA512: f1661d204e89e400b93e17f51f890a591edcdeea95803c4c48b937b700f48d5f2d975fcf33def3c5e36df13809ac2cc75f99ffc99716fa38c356b253a61eb5cb

5 months agoMerge bitcoindevkit/bdk#1981: refactor(electrum): remove `unwrap()`s and `expect()`s
merge-script [Fri, 18 Jul 2025 11:15:10 +0000 (11:15 +0000)]
Merge bitcoindevkit/bdk#1981: refactor(electrum): remove `unwrap()`s and `expect()`s

b24ae6d71815e268417034fda44f2d57325f6166 test(electrum): test sync with incorrect network (Wei Chen)
0fdbe9d170941218dddd396c7204bfb8de035d43 fix(electrum): Return error on incorrect network (志宇)
2b56f1a0487742d9a5a3043c8235c3ecca96a487 refactor(electrum): remove `unwrap()`s and `expect()`s (Wei Chen)

Pull request description:

  Partially resolves https://github.com/bitcoindevkit/bdk_wallet/issues/30.

  ### Description

  This PR eliminates all `unwrap()` and `expect()` calls from `bdk_electrum_client`, replacing them with proper error handling. Given that all public methods already return `Result`, we now propagate error messages instead of panicking.

  ### Changelog notice

  * Removed all `unwrap()`s and `expect()`s from `bdk_electrum_client.rs`.

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo +nightly fmt` and `cargo clippy` before committing

ACKs for top commit:
  evanlinjin:
    ACK b24ae6d71815e268417034fda44f2d57325f6166

Tree-SHA512: 33c08031fda35ecc12100202fe7cba2f107bc4537e7519e2ed4df9c1ea70f4a644f0fce0d92175af9745d0bf352c61094eee2ff353636ba8342691d12e3b47cc

5 months agofeat(chain): Add `TxGraph::get_last_evicted`
志宇 [Sat, 14 Jun 2025 03:15:48 +0000 (13:15 +1000)]
feat(chain): Add `TxGraph::get_last_evicted`

Ideally, this would be included as a field in `TxNode`, however that
would be a breaking change.

5 months agoMerge bitcoindevkit/bdk#1993: keychain_txout: `apply_changeset` restores spk cache...
merge-script [Thu, 17 Jul 2025 18:27:11 +0000 (14:27 -0400)]
Merge bitcoindevkit/bdk#1993: keychain_txout: `apply_changeset` restores spk cache before last revealed

6ddecc983ab3fb163303af4902bd10cf7e4a1fdf refactor(keychain_txout): `apply_changeset` restores spk cache before last revealed (valued mammal)

Pull request description:

  This patch improves readability and maintains logical consistency with the use of `spk_cache` throughout the `keychain_txout` module.

  While it might offer a performance benefit, the results are mostly comparable with the current benchmarks as far as I can tell. At least there's no indication that it would negatively impact performance.

  fixes #1975

  ### Changelog notice

  ### Checklists

  #### All Submissions:

  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)

ACKs for top commit:
  LagginTimes:
    ACK 6ddecc983ab3fb163303af4902bd10cf7e4a1fdf

Tree-SHA512: 4c11d049f94f332c88c63687d5147d25cc372d65b5f1d9d9c8784e1310e0f03e9aee479b684c255dbebb1510a7922331ad07cbcbdf47d534cf28ea8ee0e1be66

5 months agoci: automated update to rustc 1.88.0
Github Action [Tue, 15 Jul 2025 01:22:51 +0000 (01:22 +0000)]
ci: automated update to rustc 1.88.0

5 months agorefactor(keychain_txout): `apply_changeset` restores spk cache before last revealed
valued mammal [Sat, 12 Jul 2025 14:44:46 +0000 (10:44 -0400)]
refactor(keychain_txout): `apply_changeset` restores spk cache before last revealed

This change improves readability and maintains logical consistency with
the use of `spk_cache` throughout the `keychain_txout` module.

5 months agotest(electrum): test sync with incorrect network
Wei Chen [Sun, 13 Jul 2025 18:42:42 +0000 (18:42 +0000)]
test(electrum): test sync with incorrect network

5 months agofix(electrum): Return error on incorrect network
志宇 [Thu, 10 Jul 2025 03:04:24 +0000 (03:04 +0000)]
fix(electrum): Return error on incorrect network

5 months agorefactor(electrum): remove `unwrap()`s and `expect()`s
Wei Chen [Wed, 25 Jun 2025 22:01:53 +0000 (22:01 +0000)]
refactor(electrum): remove `unwrap()`s and `expect()`s

5 months agoci: replace grcov by cargo-llvm-cov
nymius [Wed, 2 Jul 2025 14:10:20 +0000 (11:10 -0300)]
ci: replace grcov by cargo-llvm-cov

5 months agoMerge bitcoindevkit/bdk#1976: Disallow unconfirmed coinbase
merge-script [Thu, 10 Jul 2025 03:04:24 +0000 (03:04 +0000)]
Merge bitcoindevkit/bdk#1976: Disallow unconfirmed coinbase

c84035e4d804943da7b3308411a1402b1ff6e2ad test(chain): Add scenario: coinbase tx must not become unconfirmed (志宇)
e8da007011c3c7e247c26a1c9984319229bb0afa fix(chain): Unconfirmed coinbase txs should never be canonical (志宇)

Pull request description:

  ### Description

  The logic in `CanonicalIter` includes transactions anchored to blocks outside the best chain, since they may still appear in the mempool.

  However, coinbase transactions can never be unconfirmed—a case the previous logic failed to exclude.

  ### Notes to the reviewers

  Sorry for my previous oversight on this.

  ### Changelog notice

  ```md
  Fixed:
  - During canonicalization, exclude coinbase transactions when considering txs that are anchored in stale blocks.
  ```

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo +nightly fmt` and `cargo clippy` before committing

  #### Bugfixes:

  ~* [ ] This pull request breaks the existing API~
  * [x] I've added tests to reproduce the issue which are now passing
  * [ ] I'm linking the issue being fixed by this PR

ACKs for top commit:
  evanlinjin:
    self-ACK c84035e4d804943da7b3308411a1402b1ff6e2ad

Tree-SHA512: 3aaff032ce390a7a8845c8704727daccab1afa2b0437f6706802f6ec37f7ffd79729407f1cba91b7e5045974a3a627c78a150242e2aaacb04a03b8f47528046b

5 months agoMerge bitcoindevkit/bdk#1990: How can we be happy if clippy is not?
merge-script [Thu, 10 Jul 2025 03:04:24 +0000 (03:04 +0000)]
Merge bitcoindevkit/bdk#1990: How can we be happy if clippy is not?

f4e158a3e415d0131a560156cf8f6bb21c98f6f7 chore(esplora): Allow `dead_code` for helper methods (志宇)
cb7a980b846685bbe38d7ff9b12d11cbf529df76 chore: Make clippy happy (志宇)
93657a0f1e3606e672204aee51dab97dd93b9404 chore: `.gitignore` Exclude criterion results (志宇)

Pull request description:

  ### Description

  I made clippy happy.

  ### Checklists

  #### All Submissions:

  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)

Top commit has no ACKs.

Tree-SHA512: b28afe91dd5d47dfc83a4d14bc47d8efa1e5077448cbbddd1fd74a74232a120e0823d778fa007cde7cfbea52d07ee1f5e719590a56fa143ec9288efc4e56afe1

5 months agotest(chain): Add scenario: coinbase tx must not become unconfirmed
志宇 [Fri, 13 Jun 2025 03:12:59 +0000 (13:12 +1000)]
test(chain): Add scenario: coinbase tx must not become unconfirmed

5 months agochore(esplora): Allow `dead_code` for helper methods
志宇 [Thu, 10 Jul 2025 03:04:24 +0000 (03:04 +0000)]
chore(esplora): Allow `dead_code` for helper methods

This suppresses warnings in CI.

5 months agofix(chain): Unconfirmed coinbase txs should never be canonical
志宇 [Fri, 13 Jun 2025 03:07:37 +0000 (13:07 +1000)]
fix(chain): Unconfirmed coinbase txs should never be canonical

The logic in `CanonicalIter` will consider txs that are anchored to
blocks not in the best chain since they still can appear in the mempool.

However, coinbase txs can never be unconfirmed - which the old logic
failed to exclude.

5 months agochore: Make clippy happy
志宇 [Thu, 10 Jul 2025 03:04:24 +0000 (03:04 +0000)]
chore: Make clippy happy

5 months agochore: `.gitignore` Exclude criterion results
志宇 [Thu, 10 Jul 2025 03:04:24 +0000 (03:04 +0000)]
chore: `.gitignore` Exclude criterion results

5 months agochore(bitcoind_rpc): Make clippy happy
志宇 [Thu, 10 Jul 2025 03:04:24 +0000 (03:04 +0000)]
chore(bitcoind_rpc): Make clippy happy

5 months agoMerge bitcoindevkit/bdk#1979: feat: add `justfile`
merge-script [Thu, 10 Jul 2025 02:13:09 +0000 (02:13 +0000)]
Merge bitcoindevkit/bdk#1979: feat: add `justfile`

501766e7106f043d45b5ab6d29e9af83d6590e13 feat: add `justfile` (Luis Schwab)

Pull request description:

  <!-- You can erase any parts of this template not applicable to your Pull Request. -->

  ### Description

  Closes #1967.

  This PR adds a `justfile`, updates the PR template to use it, and adds a section on the `README.md` to show available recipes.

  These are the implemented recipes:
  ```justfile
  alias b := build
  alias c := check
  alias f := fmt
  alias t := test
  alias p := pre-push

  _default:
    @just --list

  # Build the project
  build:
     cargo build

  # Check code: formatting, compilation, linting, and commit signature
  check:
     cargo +nightly fmt --all -- --check
     cargo check --workspace --all-features
     cargo clippy --all-features --all-targets -- -D warnings
     @[ "$(git log --pretty='format:%G?' -1 HEAD)" = "N" ] && \
         echo "\n⚠️  Unsigned commit: BDK requires that commits be signed." || \
         true

  # Format all code
  fmt:
     cargo +nightly fmt

  # Run all tests for all crates with all features enabled
  test:
     @just _test-bitcoind_rpc
     @just _test-chain
     @just _test-core
     @just _test-electrum
     @just _test-esplora
     @just _test-file_store
     @just _test-testenv

  _test-bitcoind_rpc:
      cargo test -p bdk_bitcoind_rpc --all-features

  _test-chain:
      cargo test -p bdk_chain --all-features

  _test-core:
      cargo test -p bdk_core --all-features

  _test-electrum:
      cargo test -p bdk_electrum --all-features

  _test-esplora:
      cargo test -p bdk_esplora --all-features

  _test-file_store:
      cargo test -p bdk_file_store --all-features

  _test-testenv:
      cargo test -p bdk_testenv --all-features

  # Run pre-push suite: format, check, and test
  pre-push: fmt check test
  ```

  `check` will verify if `HEAD` was signed and echo that warning if not. It does not check all commits, but I think that checking only the last is a pretty good heuristic (who signs the last commit only?).

  Before pushing, one only needs to run `just p`.

  ### Checklists

  #### All Submissions:

  * [X] I've signed all my commits
  * [X] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [X] I ran `just p` before pushing

ACKs for top commit:
  ValuedMammal:
    ACK 501766e7106f043d45b5ab6d29e9af83d6590e13
  evanlinjin:
    ACK 501766e7106f043d45b5ab6d29e9af83d6590e13

Tree-SHA512: b42109c7c3e01f529b794f37bacf8c6c2298243dd5f827c59ce74e7c64a4ef48eac84c4de86280bec828f56a81854c57458d9ea2b10acb83766fc1bdb34d24b6

5 months agofeat(bitcoind_rpc)!: Use `getrawmempool` without verbose
志宇 [Thu, 10 Jul 2025 02:13:09 +0000 (02:13 +0000)]
feat(bitcoind_rpc)!: Use `getrawmempool` without verbose

This is the more performant method. The downside is that mempool txids
are not returned to the seen-in-mempool timestamps so the caller either
needs to provide this, or we need to rely on std to get the current
timestamp.

* `Emitter::mempool` method now requires the `std` feature. A non-std
  version of this is added: `Emitter::mempool_at` which takes in a
  `sync_time` parameter.

Additional changes:

* `NO_EXPECTED_MEMPOOL_TXIDS` is renamed to `NO_EXPECTED_MEMPOOL_TXS`.
* Updated documentation.
* Fix imports so that `bdk_bitcoind_rpc` compiles without `std`.

5 months agofix(bitcoind_rpc)!: Simplify emitter
志宇 [Thu, 3 Jul 2025 23:58:53 +0000 (23:58 +0000)]
fix(bitcoind_rpc)!: Simplify emitter

Instead of having an avoid-reemission logic based on timestamps returned
by bitcoind RPC, we wrap all transactions in `Arc` and always emit the
entire mempool. This makes emission cheap while avoiding the flawed
avoid-reemission logic.

5 months agotest(bitcoind_rpc): Detect new mempool txs
志宇 [Thu, 3 Jul 2025 23:59:14 +0000 (23:59 +0000)]
test(bitcoind_rpc): Detect new mempool txs

5 months agoMerge bitcoindevkit/bdk#1971: esplora: `chain_update` errors if no point of connection
merge-script [Thu, 3 Jul 2025 14:19:29 +0000 (10:19 -0400)]
Merge bitcoindevkit/bdk#1971: esplora: `chain_update` errors if no point of connection

568a36642c43d74132339a4e42dd41c545a764e1 refactor(esplora): in debug build assert that `latest_blocks` is not empty (valued mammal)
dd394cb31869df89c5e5b3bbbf88e26763348878 fix(esplora): `chain_update` errors if no point of connection (valued mammal)

Pull request description:

  ### Description

  Before, the `chain_update` function might have panicked if the local checkpoint was not on the same network as the remote server. Now if we have iterated all of the blocks of the local CP and do not find a point of agreement, then we return early with a `esplora_client::Error::HeaderHashNotFound`.

  cc bitcoindevkit/bdk_wallet#30

  ### Notes to the reviewers

  ### Changelog notice

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo +nightly fmt` and `cargo clippy` before committing

  #### New Features:

  * [ ] I've added tests for the new feature
  * [ ] I've added docs for the new feature

  #### Bugfixes:

  * [ ] This pull request breaks the existing API
  * [x] I've added tests to reproduce the issue which are now passing
  * [x] I'm linking the issue being fixed by this PR

ACKs for top commit:
  ValuedMammal:
    ACK 568a36642c43d74132339a4e42dd41c545a764e1

Tree-SHA512: 8dceaf24f1214d3463e14c7b5965beb34138985319962af04d1027028da2fddece185a7437a33713020e38b2a4129bd14e1dc0a3735e9ece15ab35a5f828360a

5 months agoMerge bitcoindevkit/bdk#1968: bench: Add `reindex_tx_graph` benchmark
merge-script [Thu, 3 Jul 2025 14:01:32 +0000 (10:01 -0400)]
Merge bitcoindevkit/bdk#1968: bench: Add `reindex_tx_graph` benchmark

f51f5b5659941a68b74e5b142296a8aaf9665afa docs(chain): Improve API docs (valued mammal)
fcf38349d895b0c627b4149e448a29468ed629b4 test(keychain_txout): test spk cache (valued mammal)
e07ec1cefbb6cc973398d4281bfde58c8c15cc4b bench(chain): Add `reindex_tx_graph` benchmark (valued mammal)

Pull request description:

  This PR contains the following changes:

  - Add benchmark `reindex_tx_graph`. Run with `cargo bench -p bdk_chain --bench indexer`.
  - Add unit test to `keychain_txout` module to test behavior of spk-cache.
  - Fixup a few doc comments.

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo +nightly fmt` and `cargo clippy` before committing

ACKs for top commit:
  ValuedMammal:
    ACK f51f5b5659941a68b74e5b142296a8aaf9665afa

Tree-SHA512: 4d6826a825fa40fa13bd622ed6cff49366c541a7e0a7035a45fbeb98853d693ddef7fab113f6d77259fd75eddfc91623834363e028235fb26336c8865fccb02b

5 months agoMerge bitcoindevkit/bdk#1897: test for excluded bounds in outputs_in_range
merge-script [Thu, 3 Jul 2025 13:48:13 +0000 (09:48 -0400)]
Merge bitcoindevkit/bdk#1897: test for excluded bounds in outputs_in_range

ad792670c487e62183d901338b2655ec7b81c688 test for excluded bounds in outputs_in_range (aagbotemi)

Pull request description:

  <!-- You can erase any parts of this template not applicable to your Pull Request. -->

  ### Description
  This PR covers a wide range on tests for excluded bounds and the `SpkTxOutIndex::outputs_in_range`. This PR fixes bitcoindevkit/bdk_wallet#58

  <!-- Describe the purpose of this PR, what's being adding and/or fixed -->

  ### Notes to the reviewers

  <!-- In this section you can include notes directed to the reviewers, like explaining why some parts
  of the PR were done in a specific way -->

  ### Changelog notice

  <!-- Notice the release manager should include in the release tag message changelog -->
  <!-- See https://keepachangelog.com/en/1.0.0/ for examples -->

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] 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

  #### Bugfixes:

  * [ ] This pull request breaks the existing API
  * [ ] I've added tests to reproduce the issue which are now passing
  * [x] I'm linking the issue being fixed by this PR

ACKs for top commit:
  ValuedMammal:
    ACK ad792670c487e62183d901338b2655ec7b81c688
  oleonardolima:
    utACK ad792670c487e62183d901338b2655ec7b81c688

Tree-SHA512: 268e48ce6e7ffb0ed62d0124869caf1fbcff65d787a1a6566a5521408a8b9659a9f25cba5523802e805ac24bfa7809fff51e49c6be59cef6b6ecf4a29ffb9b0a

5 months agoMerge bitcoindevkit/bdk#1957: feat(electrum): optimize merkle proof validation with...
merge-script [Thu, 3 Jul 2025 03:39:18 +0000 (03:39 +0000)]
Merge bitcoindevkit/bdk#1957: feat(electrum): optimize merkle proof validation with batching

156cbab67f4ff91276f9f03749944f4c46210f7f test(electrum): Improve benchmark (志宇)
4ea5ea6c490adb0652ad068bc816c2434c51da35 feat(electrum): batch `transaction.get_merkle` calls via `batch_call` (Wei Chen)
ec4fd971c81e7d3bcf8fbdac15c6df63b934cd70 feat(electrum): batched `Header`s and `script_get_history` (Wei Chen)
f21a21d8c8dfc5b84957c854c1f1daee59bcc620 test(electrum): add `criterion` benchmark for `sync` (Wei Chen)
b57768dd2bd25d4fc9d6acc3990b04fa8594e7b1 fix(electrum): improve tx validation and gap limit scanning (keerthi)
7a18cad68be6bda33deaeb50ec9a5307d1ce8f6d feat(electrum): optimize merkle proof validation with batching (Wei Chen)

Pull request description:

  Replaces #1908, originally authored by @Keerthi421.
  Fixes #1891.

  ### Description

  This PR optimizes `sync`/`full_scan` performance by batching and caching key RPC calls to slash network round-trips and eliminate redundant work.

  Key improvements:

  * Gather all `blockchain.transaction.get_merkle` calls into a single `batch_call` request.
  * Use `batch_script_get_history` instead of many individual `script_get_history` calls.
  * Use `batch_block_header` to fetch all needed block headers in one call rather than repeatedly calling `block_header`.
  * Introduce a cache of transaction anchors to skip re-validating already confirmed transactions.

  #### Anchor Caching Performance Improvements

  Results suggest a significant speed up with a warmed up cache. Tested on local Electrum server with:
  ```
  $ cargo bench -p bdk_electrum --bench test_sync
  ```

  Results before this PR (https://github.com/LagginTimes/bdk/tree/1957-master-branch):

  ```
  sync_with_electrum      time:   [1.3702 s 1.3732 s 1.3852 s]
  ```

  Results after this PR:

  ```
  sync_with_electrum      time:   [851.31 ms 853.26 ms 856.23 ms]
  ```
  #### Batch Call Performance Improvements

  No persisted data was carried over between runs, so each test started with cold caches and measured only raw batching performance. Tested with`example_electrum` out of https://github.com/LagginTimes/bdk/tree/example_electrum_timing with the following parameters:

  ```
  $ example_electrum init "tr([62f3f3af/86'/1'/0']tpubDD4Kse29e47rSP5paSuNPhWnGMcdEDAuiG42LEd5yaRDN2CFApWiLTAzxQSLS7MpvxrpxvRJBVcjhVPRk7gec4iWfwvLrEhns1LA4h7i3c2/0/*)#cn4sudyq"
  $ example_electrum scan tcp://signet-electrumx.wakiyamap.dev:50001
  ```

  Results before this PR:

  ```
  FULL_SCAN TIME: 8.145874476s
  ```

  Results after this PR (using this PR's [`bdk_electrum_client.rs`](https://github.com/bitcoindevkit/bdk/blob/70495e2010541acbb5d62f9b5692de20924ac53f/crates/electrum/src/bdk_electrum_client.rs)):

  ```
  FULL_SCAN TIME: 2.594050112s
  ```

  ### Changelog notice

  * Add transaction anchor cache to prevent redundant network calls.
  * Batch Merkle proof, script history, and header requests.

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

  #### New Features:

  * [x] I've added tests for the new feature
  * [x] I've added docs for the new feature

  #### Bugfixes:

  * [ ] This pull request breaks the existing API
  * [x] I've added tests to reproduce the issue which are now passing
  * [x] I'm linking the issue being fixed by this PR

ACKs for top commit:
  oleonardolima:
    tACK 156cbab67f4ff91276f9f03749944f4c46210f7f
  evanlinjin:
    ACK 156cbab67f4ff91276f9f03749944f4c46210f7f

Tree-SHA512: dc7dc1d7de938223cc03293d8bb8ae12c8799c7ec8ba8c7faec5cf2076c96a1b1e50b406cbcc90cbd6cbe7a311c0c11dd036691c03ed067c469a26260903993b

5 months agofeat: add `justfile`
Luis Schwab [Tue, 1 Jul 2025 17:06:39 +0000 (14:06 -0300)]
feat: add `justfile`

5 months agodocs(chain): Improve API docs
valued mammal [Fri, 30 May 2025 17:22:07 +0000 (13:22 -0400)]
docs(chain): Improve API docs

Fixed parameter names to match the function or struct definition,
and correct some spelling mistakes.

5 months agotest(keychain_txout): test spk cache
valued mammal [Fri, 30 May 2025 17:16:02 +0000 (13:16 -0400)]
test(keychain_txout): test spk cache

- Test cached spk matches derived
- Recover state of spk cache from changeset

5 months agobench(chain): Add `reindex_tx_graph` benchmark
valued mammal [Mon, 26 May 2025 02:04:27 +0000 (22:04 -0400)]
bench(chain): Add `reindex_tx_graph` benchmark

5 months agorefactor(esplora): in debug build assert that `latest_blocks` is not empty
valued mammal [Sat, 7 Jun 2025 14:43:11 +0000 (10:43 -0400)]
refactor(esplora): in debug build assert that `latest_blocks` is not empty

5 months agofix(esplora): `chain_update` errors if no point of connection
valued mammal [Thu, 5 Jun 2025 17:17:21 +0000 (13:17 -0400)]
fix(esplora): `chain_update` errors if no point of connection

Before, the `chain_update` function would hit a panic if the
local checkpoint was not on the same network as the remote
server. Now if we have iterated all of the blocks of the
`local_cp` and do not find a "point of agreement", then we
return early with a `esplora_client::Error::HeaderHashNotFound`.

5 months agotest(electrum): Improve benchmark
志宇 [Wed, 25 Jun 2025 23:34:50 +0000 (23:34 +0000)]
test(electrum): Improve benchmark

* Actually use different spks
* Do not benchmark applying updates (only fetching/contructing)
* Have two benches: One with cache, one without.
* Remove `black_box`.

5 months agofeat(electrum): batch `transaction.get_merkle` calls via `batch_call`
Wei Chen [Tue, 27 May 2025 18:15:44 +0000 (18:15 +0000)]
feat(electrum): batch `transaction.get_merkle` calls via `batch_call`

5 months agofeat(electrum): batched `Header`s and `script_get_history`
Wei Chen [Mon, 26 May 2025 23:18:07 +0000 (23:18 +0000)]
feat(electrum): batched `Header`s and `script_get_history`

5 months agotest(electrum): add `criterion` benchmark for `sync`
Wei Chen [Sun, 25 May 2025 18:28:19 +0000 (18:28 +0000)]
test(electrum): add `criterion` benchmark for `sync`

6 months agofix(electrum): improve tx validation and gap limit scanning
keerthi [Thu, 10 Apr 2025 09:21:26 +0000 (14:51 +0530)]
fix(electrum): improve tx validation and gap limit scanning

6 months agofeat(electrum): optimize merkle proof validation with batching
Wei Chen [Sat, 22 Mar 2025 12:16:12 +0000 (17:46 +0530)]
feat(electrum): optimize merkle proof validation with batching

Co-authored-by: keerthi <keerthi.sree2105@gmail.com>
6 months agotest for excluded bounds in outputs_in_range
aagbotemi [Tue, 18 Mar 2025 01:18:04 +0000 (02:18 +0100)]
test for excluded bounds in outputs_in_range

- replace range syntax with explicit Bound types in outputs_in_range tests

6 months agoMerge bitcoindevkit/bdk#1978: ci: automated update to rustc 1.87.0
Steve Myers [Tue, 17 Jun 2025 20:35:49 +0000 (15:35 -0500)]
Merge bitcoindevkit/bdk#1978: ci: automated update to rustc 1.87.0

54e2b533a261ade79bfc6e17215ddde22c5f3248 ci: automated update to rustc 1.87.0 (Github Action)

Pull request description:

  Automated update to Github CI workflow `cont_integration.yml` by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

ACKs for top commit:
  ValuedMammal:
    ACK 54e2b533a261ade79bfc6e17215ddde22c5f3248
  notmandatory:
    ACK 54e2b533a261ade79bfc6e17215ddde22c5f3248

Tree-SHA512: ead615e82de3f30980733c85271b9fc85644705750fbb4a1d6812831923da3370292bd7864e5ecc1b4ac182ad0d6ff22a861669a9cda7bbb1d9dc414abf82954

6 months agoci: automated update to rustc 1.87.0
Github Action [Sun, 15 Jun 2025 01:23:55 +0000 (01:23 +0000)]
ci: automated update to rustc 1.87.0

6 months agoMerge bitcoindevkit/bdk#1972: ci: pin `tracing-core` to `0.1.33` for msrv
merge-script [Fri, 13 Jun 2025 07:49:59 +0000 (07:49 +0000)]
Merge bitcoindevkit/bdk#1972: ci: pin `tracing-core` to `0.1.33` for msrv

7c8b4db50987bd6f17df4ac60fb513cdc33c5e2f ci: pin `tracing-core` to `0.1.33` (Wei Chen)

Pull request description:

  ### Description

  Pin `tracing-core` to `0.1.33` for msrv.

  ### Changelog notice

  * Pin `tracing-core` to `0.1.33`.

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo +nightly fmt` and `cargo clippy` before committing

ACKs for top commit:
  ValuedMammal:
    ACK 7c8b4db50987bd6f17df4ac60fb513cdc33c5e2f
  oleonardolima:
    ACK 7c8b4db50987bd6f17df4ac60fb513cdc33c5e2f

Tree-SHA512: 2bbca7a6506a3a083cc3a13aa0221dd5d5442c7435bf57f5bfe01d48365b1eab355caf9cb27ee7c57f4adc4d3aa621f6f3ec9379f4b03d5d9a5f9e2284d64785

6 months agoci: pin `tracing-core` to `0.1.33`
Wei Chen [Sun, 8 Jun 2025 17:39:35 +0000 (17:39 +0000)]
ci: pin `tracing-core` to `0.1.33`

6 months agoMerge bitcoindevkit/bdk#1970: chore: bump `bdk_chain` to 0.23.0 bitcoind_rpc-0.20.0 chain-0.23.0 core-0.6.0 electrum-0.23.0 esplora-0.22.0 file_store-0.21.0 testenv-0.13.0
valued mammal [Tue, 27 May 2025 15:06:03 +0000 (11:06 -0400)]
Merge bitcoindevkit/bdk#1970: chore: bump `bdk_chain` to 0.23.0

6afb6a6213d9e2667df669e91faab20df5ffc056 chore: update changelogs (valued mammal)
340bdc1c7a6a8382e3c6ed75e1938be9b0c957e1 chore: bump `bdk_chain` to 0.23.0 (valued mammal)

Pull request description:

  core to 0.6.0
  bitcoind_rpc to 0.20.0
  electrum to 0.23.0
  esplora to 0.22.0
  file_store 0.21.0
  testenv to 0.13.0

  TODO

  - [x] Update changelogs

  fixes #1969

ACKs for top commit:
  oleonardolima:
    ACK 6afb6a6213d9e2667df669e91faab20df5ffc056

Tree-SHA512: 844c4c3db714877351bba01eedca476d73973fa88be41c13220936dbec4853097d3322f8018b74e9a80233f34e3ed5a57a02b46cc3c85cdf28b6e5890077f34d

6 months agochore: update changelogs
valued mammal [Tue, 27 May 2025 14:41:12 +0000 (10:41 -0400)]
chore: update changelogs

6 months agochore: bump `bdk_chain` to 0.23.0
valued mammal [Mon, 26 May 2025 23:16:03 +0000 (19:16 -0400)]
chore: bump `bdk_chain` to 0.23.0

core to 0.6.0
bitcoind_rpc to 0.20.0
electrum to 0.23.0
esplora to 0.22.0
file_store 0.21.0
testenv to 0.13.0

6 months agoMerge bitcoindevkit/bdk#1963: Persist spks derived from `KeychainTxOutIndex`
valued mammal [Tue, 27 May 2025 14:03:47 +0000 (10:03 -0400)]
Merge bitcoindevkit/bdk#1963: Persist spks derived from `KeychainTxOutIndex`

62767f0702e6497d08fea702b747fd6e7fa72b8c fix(rusqlite_impl): Fix derived spks create table statement (valued mammal)
603f133d9adf0e933c270c40b0f5284eca7c5722 docs(chain): Adds docs for persisting spks in `KeychainTxOutIndex` (志宇)
3126cd214536db6c9636f4e7b6b92019fcee535e feat(chain)!: Clean up ergonomics of `IndexedTxGraph` (志宇)
a0555817136e4ef5a36272cb311123e0bce54657 feat(chain): `KeychainTxOutIndex`: Make spk cache optional (志宇)
19e3b5df1b25d206c3b1eecefd7befc783dce127 feat(chain): Add `KeychainTxOutIndex::from_changeset` constructor (志宇)
d761265af0586b4425c8f0ee4515e8b9f3fff247 feat(chain): `KeychainTxOutIndex`: Debug build checks (志宇)
76875e7a4ea36ed5ae4b5ae211068111d3f28813 fix(chain)!: API and logical issues in `KeychainTxOutIndex` (志宇)
d299daea4278f9c63fcf57ae7b7079c0b6f7ebc4 feat(chain)!: Persist spks derived from `KeychainTxOutIndex` (志宇)

Pull request description:

  Replaces #1960
  Fixes #1964

  ### Description

  Users with large wallet and/or complex descriptors may experience slow startup of `KeychainTxOutIndex`. This PR addresses this problem by providing the option to persist derived spks so that they no longer need to be re-derived on startup.

  The `IndexedTxGraph` API has been changed for better ergonomics.

  Compared to #1960, this is a more longterm solution that does not depend on multi-threading logic.

  ### Changelog notice

  ```md
  Changed
    - `KeychainTxOutIndex::new` to take in an additional parameter `persist_spks` to control whether derived spks are cached and persisted across restarts. The default of `persist_spks` is false.
    - `KeychainTxOutIndex` methods (`lookahead_to_target, `next_unused_spk`, `reveal_next_spk`) now return changesets as they may derive spks to be persisted.
    - The `InsertDescriptorError` type now wraps descriptors in `Box` to reduce enum size.

  Added
    - `spk_cache` field to `indexer::keychain_txout::ChangeSet` which persists derived spks.
    - `IndexedTxGraph::from_changeset` - allows constructing from `indexed_tx_graph::ChangeSet` and only indexing when ready.
    - `IndexedTxGraph::reindex` method.

  Fixed
    - `KeychainTxOutIndex::reveal_to_target` so that it actually returns `None` if the `keychain` does not exist.
  ```

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo +nightly fmt` and `cargo clippy` before committing

  #### New Features:

  * [ ] I've added tests for the new feature
  * [x] I've added docs for the new feature

ACKs for top commit:
  ValuedMammal:
    ACK 62767f0702e6497d08fea702b747fd6e7fa72b8c
  notmandatory:
    ACK 62767f0702e6497d08fea702b747fd6e7fa72b8c

Tree-SHA512: dc1aa4308ffcc6d121e0d7a1ca4ff9f641ed5db63204747fde47ac02e45dae9b65da95554541705a98b69e59f741c043485a26db736966417061a4c9d220ba29

6 months agofix(rusqlite_impl): Fix derived spks create table statement
valued mammal [Mon, 26 May 2025 14:10:24 +0000 (10:10 -0400)]
fix(rusqlite_impl): Fix derived spks create table statement

Do not reference last revealed table, in case none are revealed.
Correct SQL column name.

6 months agoMerge bitcoindevkit/bdk#1966: fix(chain): persist `first_seen`
merge-script [Fri, 23 May 2025 12:10:11 +0000 (22:10 +1000)]
Merge bitcoindevkit/bdk#1966: fix(chain): persist `first_seen`

b27a019b595545ffe8fed6b77aeccb68f7b23938 fix(chain): persist `first_seen` (Wei Chen)

Pull request description:

  Fixes #1965.

  ### Description

  Adds missing persistence for `first_seen`, which was not included in #1950.

  ### Changelog notice

  - Adds `first_seen` column to the `bdk_txs` table via schema v3 migration.
  - Updates `from_sqlite()` and `persist_to_sqlite()` to handle `first_seen`.
  - Updates the v0-to-v3 migration test to verify compatibility with older schemas.

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo +nightly fmt` and `cargo clippy` before committing

  #### New Features:

  * [x] I've added tests for the new feature
  * [x] I've added docs for the new feature

  #### Bugfixes:

  * [ ] This pull request breaks the existing API
  * [x] I've added tests to reproduce the issue which are now passing
  * [x] I'm linking the issue being fixed by this PR

ACKs for top commit:
  evanlinjin:
    ACK b27a019b595545ffe8fed6b77aeccb68f7b23938

Tree-SHA512: a8c4cd930e20f7bdf1a02fc3155b5df9f1627676fe10a2d77ea856e71e45f783bba1bb8cf4eceb8dba71c345e7985a9e091002966cec147871e6672c0e2ac5c4

6 months agoMerge bitcoindevkit/bdk#1961: Add `is_empty` methods to `TxUpdate` and `{}_Response...
merge-script [Fri, 23 May 2025 11:59:05 +0000 (21:59 +1000)]
Merge bitcoindevkit/bdk#1961: Add `is_empty` methods to `TxUpdate` and `{}_Response` types

e9263f9b70271cbcfd67c2f5b250c447ba1fd4fe feat(core): Add `is_empty` methods to `TxUpdate` and `{}_Response` types (志宇)

Pull request description:

  ### Description

  `is_empty` methods are helpful in various contexts so I added them.

  ### Changelog notice

  ```md
  Added
    - `is_empty` methods to `TxUpdate`, `SyncResponse` and `FullScanResponse`
  ```

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

  #### New Features:

  * [x] I've added tests for the new feature
  * [x] I've added docs for the new feature

ACKs for top commit:
  LagginTimes:
    ACK e9263f9b70271cbcfd67c2f5b250c447ba1fd4fe

Tree-SHA512: 767a581b5d66da31f609db3ffba2457cb0f579c386e8e960bd89d6650852ba9d3c00e94432aaeba586d19b01fa8982ffdee2615c867b98ad8efa8e16505e3180

6 months agodocs(chain): Adds docs for persisting spks in `KeychainTxOutIndex`
志宇 [Fri, 23 May 2025 11:23:38 +0000 (21:23 +1000)]
docs(chain): Adds docs for persisting spks in `KeychainTxOutIndex`

6 months agofix(chain): persist `first_seen`
Wei Chen [Fri, 23 May 2025 11:12:14 +0000 (11:12 +0000)]
fix(chain): persist `first_seen`

6 months agofeat(chain)!: Clean up ergonomics of `IndexedTxGraph`
志宇 [Fri, 23 May 2025 08:27:55 +0000 (18:27 +1000)]
feat(chain)!: Clean up ergonomics of `IndexedTxGraph`

* `new` is now intended to construct a fresh indexed-tx-graph
* `from_changeset` is added for constructing indexed-tx-graph from a
  previously persisted changeset
* added `reindex` for calling after indexer mutations that require it
* reintroduce `Default` impl

6 months agofeat(core): Add `is_empty` methods to `TxUpdate` and `{}_Response` types
志宇 [Sun, 18 May 2025 23:52:17 +0000 (09:52 +1000)]
feat(core): Add `is_empty` methods to `TxUpdate` and `{}_Response` types

6 months agofeat(chain): `KeychainTxOutIndex`: Make spk cache optional
志宇 [Fri, 23 May 2025 05:44:35 +0000 (15:44 +1000)]
feat(chain): `KeychainTxOutIndex`: Make spk cache optional

Also added staging changes to `ChangeSet::spk_cache`. This way, we can
avoid returning `ChangeSet`s for `apply_changeset` and
`insert_descriptor`.

* `KeychainTxOutIndex::new` now takes in an additional `use_spk_cache`
  parameter.
* Fixed `reveal_to_target` method to actually return `None` if the
  keychain does not exist.

6 months agofeat(chain): Add `KeychainTxOutIndex::from_changeset` constructor
志宇 [Fri, 23 May 2025 01:51:12 +0000 (11:51 +1000)]
feat(chain): Add `KeychainTxOutIndex::from_changeset` constructor

This incentivies constructing `KeychainTxOutIndex` from a changeset
before inserting descriptors (to make use of the spk cache).

6 months agofeat(chain): `KeychainTxOutIndex`: Debug build checks
志宇 [Fri, 23 May 2025 01:24:21 +0000 (11:24 +1000)]
feat(chain): `KeychainTxOutIndex`: Debug build checks

* When merging changesets, assert that spk of a given descriptor id &
  derivation index does not get changed.
* When reading spk from cache, check the spk by deriving it.

6 months agofix(chain)!: API and logical issues in `KeychainTxOutIndex`
志宇 [Fri, 23 May 2025 00:47:26 +0000 (10:47 +1000)]
fix(chain)!: API and logical issues in `KeychainTxOutIndex`

Thanks to @valuedmammal for the suggestions

6 months agofeat(chain)!: Persist spks derived from `KeychainTxOutIndex`
志宇 [Thu, 22 May 2025 07:14:18 +0000 (17:14 +1000)]
feat(chain)!: Persist spks derived from `KeychainTxOutIndex`

6 months agoMerge bitcoindevkit/bdk#1946: chore: create and apply rustfmt.toml
Steve Myers [Wed, 21 May 2025 15:29:07 +0000 (10:29 -0500)]
Merge bitcoindevkit/bdk#1946: chore: create and apply rustfmt.toml

7bdbcdd2a1b6bb0fb9fafd7792615a1a3a302a5a chore: apply fmt (Luis Schwab)
655b77b4ddc8982c3c747f5553abb83801b09a0b chore: create rustfmt.toml, update CI to use nightly for fmt job (Luis Schwab)

Pull request description:

  This PR adds basic formatting configuration for uniform comments. Note that the nightly toolchain is necessary.

  ### Changelog:

  - Create rustfmt.toml with this config:
  ```
  comment_width = 100
  format_code_in_doc_comments = true
  wrap_comments = true
  ```
  - Apply rustfmt.toml.
  - Update the fmt CI job to use the nightly toolchain.
  - Update PR template to use nightly toolchain.

  Note: I had to add #[rustfmt::skip] to test_extract_satisfaction_timelock() because the base64 PSBT would get wrapped due to the slashes.

  #### All Submissions:

  * [X] I've signed all my commits
  * [X] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [X] I ran `cargo +nightly fmt` and `cargo clippy` before committing

ACKs for top commit:
  notmandatory:
    ACK 7bdbcdd2a1b6bb0fb9fafd7792615a1a3a302a5a

Tree-SHA512: 03b056e1da5733e8aa9a9244192b48a5c170902216d936ddbeaf81e22608fee3344ae6386a06019c7806f0a3e1597ab5be34f78661809181693c63954a61cce0

6 months agochore: apply fmt
Luis Schwab [Tue, 20 May 2025 21:36:47 +0000 (18:36 -0300)]
chore: apply fmt

6 months agochore: create rustfmt.toml, update CI to use nightly for fmt job
Luis Schwab [Fri, 16 May 2025 14:12:34 +0000 (11:12 -0300)]
chore: create rustfmt.toml, update CI to use nightly for fmt job

7 months agoMerge bitcoindevkit/bdk#1813: Add zizmor github actions security analysis workflow
Steve Myers [Tue, 20 May 2025 18:22:49 +0000 (13:22 -0500)]
Merge bitcoindevkit/bdk#1813: Add zizmor github actions security analysis workflow

a50fa4c1014ad0739f2ca4d51738b1f1207d679f ci: add zizmor github actions security analysis workflow (Steve Myers)

Pull request description:

  ### Description

  Added workflow to run zizmor github actions security analysis.

  See: https://woodruffw.github.io/zizmor/usage/#use-in-github-actions

  ### Notes to the reviewers

  I built this PR on top of #1778.

  I pinned zizmor to version 1.6.0.

  ### Changelog notice

  ci: add zizmor github actions security analysis workflow and fix possible vulnerabilities

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

Top commit has no ACKs.

Tree-SHA512: 5eaa6b6ce59fb3f724a368098174000e096ddc0c798c5132e089a02c611f5132ea9e123418c54cb98628361de80faaf562742eae45ccb68c5040e7475f948b72

7 months agoci: add zizmor github actions security analysis workflow
Steve Myers [Tue, 28 Jan 2025 02:19:30 +0000 (20:19 -0600)]
ci: add zizmor github actions security analysis workflow

7 months agoMerge bitcoindevkit/bdk#1955: chore: Update rust-version to 1.86.0
merge-script [Mon, 19 May 2025 00:47:05 +0000 (10:47 +1000)]
Merge bitcoindevkit/bdk#1955: chore: Update rust-version to 1.86.0

e8c911c464ff7f0d35259cccee0d286c11f04bb2 chore: update rust-version to 1.86.0 (valued mammal)

Pull request description:

  Update `rust-version` to 1.86.0 and address some clippy lints, in particular [`clippy::doc_overindented_list_items`](https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items).

  fix #1940

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

ACKs for top commit:
  evanlinjin:
    re-ACK e8c911c464ff7f0d35259cccee0d286c11f04bb2

Tree-SHA512: e09377f4b31f7da1a74f4cc4b3a7d7f5f7235aac00001adc3cf4b5758efd0383facb367348db2173bd88379259d0d465292d4dd0ab68bc3b61a0bf111b989e7a

7 months agoMerge bitcoindevkit/bdk#1806: fix(docs): `merge_chains` outdated documentation
merge-script [Fri, 16 May 2025 08:55:32 +0000 (18:55 +1000)]
Merge bitcoindevkit/bdk#1806: fix(docs): `merge_chains` outdated documentation

5647241f45b29fe5f7ad5aa5a94c0c4f72f9adea fix(docs): `merge_chains` documentation (Leonardo Lima)

Pull request description:

  <!-- You can erase any parts of this template not applicable to your Pull Request. -->

  ### Description

  It's a minor documentation fix, as reported during the audit and referenced in bitcoindevkit/bdk_wallet#59.

  <!-- Describe the purpose of this PR, what's being adding and/or fixed -->

  ### Notes to the reviewers

  I'm unsure if anything else / any other explanation should be included in the documentation. Let me know if you think more context should be added to it.

  <!-- In this section you can include notes directed to the reviewers, like explaining why some parts
  of the PR were done in a specific way -->

  ### Changelog notice

  - Update `bdk_chain::local_chain::merge_chains` documentation.

  <!-- Notice the release manager should include in the release tag message changelog -->
  <!-- See https://keepachangelog.com/en/1.0.0/ for examples -->

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

ACKs for top commit:
  evanlinjin:
    self-ACK 5647241f45b29fe5f7ad5aa5a94c0c4f72f9adea

Tree-SHA512: a70a67eab9c8fa0c60a674efed82ddeb9bc9b69763fefaa38a9058d7a1e67c06045c3e5a31aaf0d48c0a599d03bac0a3a86530cc250acefea9497572c01b8b0e

7 months agofix(docs): `merge_chains` documentation
Leonardo Lima [Tue, 21 Jan 2025 20:56:00 +0000 (17:56 -0300)]
fix(docs): `merge_chains` documentation

- it's a small fix for `merge_chains` docs, reported on audit.
- adds an `Errors` section to cover what scenarios it can fail.

7 months agochore: update rust-version to 1.86.0
valued mammal [Wed, 30 Apr 2025 21:12:26 +0000 (17:12 -0400)]
chore: update rust-version to 1.86.0

Clippy was complaining about overindented list items, so fix
that here as well.

7 months agoMerge bitcoindevkit/bdk#1950: feat!(chain): implement `first_seen` tracking
merge-script [Fri, 16 May 2025 06:13:18 +0000 (16:13 +1000)]
Merge bitcoindevkit/bdk#1950: feat!(chain): implement `first_seen` tracking

8b17bcfc03c39cd35415742bc31293b7969d1024 feat!(chain): implement `first_seen` tracking (uvuvuwu)

Pull request description:

  ### Description

  This PR solves issue #1947 by implementing `first_seen` tracking.

  * Added `first_seen` field to `TxGraph` and `ChangeSet` so that `first_seen` timestamp can be added when inserting a new seen-at using `insert_seen_at`.

  * `first_seen` added to `TxNode` as a way to retrieve the first-seen timestamp for a transaction.

  * `first_seen` added to `ChainPosition::Unconfirmed` to order unconfirmed transactions by `first_seen`.

  * New tests have been added for the above described functionalities.

  ### Changelog notice

  * Add tracking first-seen timestamps of transactions

  <!-- Notice the release manager should include in the release tag message changelog -->
  <!-- See https://keepachangelog.com/en/1.0.0/ for examples -->

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

  #### New Features:

  * [x] I've added tests for the new feature
  * [x] I've added docs for the new feature

ACKs for top commit:
  evanlinjin:
    ACK 8b17bcfc03c39cd35415742bc31293b7969d1024

Tree-SHA512: effb95704181f80ca25b63f5cf42b7a9357895647abefa91d4cc7ade7604bcfa4cca663d3916b935b520d935cf562412c5238f96636a428d115bf56b1957c9d5

7 months agofeat!(chain): implement `first_seen` tracking
uvuvuwu [Thu, 24 Apr 2025 04:34:11 +0000 (16:34 +1200)]
feat!(chain): implement `first_seen` tracking

7 months agoMerge bitcoindevkit/bdk#1951: Release `bdk_chain` v0.22.0 bitcoind_rpc-0.19.0 chain-0.22.0 core-0.5.0 electrum-0.22.0 esplora-0.21.0 file_store-0.20.0 testenv-0.12.0
valued mammal [Thu, 1 May 2025 15:37:11 +0000 (11:37 -0400)]
Merge bitcoindevkit/bdk#1951: Release `bdk_chain` v0.22.0

4c34331289beaf7b8968ca069b3bfa596523ea06 chore: Update changelogs (valued mammal)
ba4e7fdfc6fa70f8690041f4223d7ac2ec8dcf69 chore: bump bdk_chain to 0.22.0 (valued mammal)

Pull request description:

  chore: bump bdk_chain to 0.22.0

  - bdk_core 0.5.0
  - bitcoind_rpc 0.19.0
  - electrum 0.22.0
  - esplora 0.21.0
  - file_store 0.20.0
  - testenv 0.12.0

  fixes #1945

ACKs for top commit:
  LagginTimes:
    ACK 4c34331289beaf7b8968ca069b3bfa596523ea06

Tree-SHA512: ba9a4fd160373e12bc88db3474a48724ed83f88d35f562d26d5e59005320d585d20ffe1d115295f9bd6caa0d1996010e0e6158f17c47508d177dbe7b499ec8a2

7 months agochore: Update changelogs
valued mammal [Sat, 26 Apr 2025 16:24:40 +0000 (12:24 -0400)]
chore: Update changelogs

7 months agochore: bump bdk_chain to 0.22.0
valued mammal [Sat, 26 Apr 2025 16:23:37 +0000 (12:23 -0400)]
chore: bump bdk_chain to 0.22.0

- bdk_core 0.5.0
- bitcoind_rpc 0.19.0
- electrum 0.22.0
- esplora 0.21.0
- file_store 0.20.0
- testenv 0.12.0

7 months agoMerge bitcoindevkit/bdk#1857: feat(rpc)!: Update `Emitter::mempool` to support `evict...
valued mammal [Thu, 1 May 2025 15:07:40 +0000 (11:07 -0400)]
Merge bitcoindevkit/bdk#1857: feat(rpc)!: Update `Emitter::mempool` to support `evicted_at`

8513d83a2ef2fe748e9007984187a7f08d256ee6 feat(bitcoind_rpc)!: Reduce friction of `Emitter` API. (志宇)
0a02d26835a41556cf0f6899f97fdb42bf4d0f9d feat(chain): Add convenience conversions for `CanonicalTx` (志宇)
d11f6efe8f6feddaa115cde32ebead19f92c2f64 feat(graph): add convenience function for inserting relevant `evicted_at`s (Wei Chen)
28ef7c9a22c4364925329628fa84fd09ecc82e2e refactor(rpc)!: update `mempool` interface and test code (valued mammal)

Pull request description:

  Fixes #1740

  ### Description

  Work for this began as part of #1811, based on this [comment](https://github.com/bitcoindevkit/bdk/pull/1811#discussion_r1945941691).

  `Emitter::mempool` now returns a `MempoolEvent` which provides the data for tracking `evicted_at`:

  ```
  pub struct MempoolEvent {
      /// Unemitted transactions or transactions with ancestors that are unseen by the receiver.
      ///
      /// To understand the second condition, consider a receiver which filters transactions based on
      /// whether it alters the UTXO set of tracked script pubkeys. If an emitted mempool transaction
      /// spends a tracked UTXO which is confirmed at height `h`, but the receiver has only seen up to
      /// block of height `h-1`, we want to re-emit this transaction until the receiver has seen the
      /// block at height `h`.
      pub new_txs: Vec<(Transaction, u64)>,

      /// [`Txid`]s of all transactions that have been evicted from mempool.
      pub evicted_txids: HashSet<Txid>,

      /// The latest timestamp of when a transaction entered the mempool.
      ///
      /// This is useful for setting the timestamp for evicted transactions.
      pub latest_update_time: u64,
  }
  ```

  ### Changelog notice

  * Change `Emitter::mempool` to return `MempoolEvent`s which contain mempool-eviction data.
  * Change `Emitter::client` to have more relaxed generic bounds. `C: Deref, C::Target: RpcApi` are the new bounds.
  * Add conversion impls for `CanonicalTx` to `Txid`/`Arc<Transaction>`.
  * Add `ChainPosition::is_unconfirmed` method.

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

  #### New Features:

  * [x] I've added tests for the new feature
  * [x] I've added docs for the new feature

  #### Bugfixes:

  * [x] This pull request breaks the existing API
  * [x] I've added tests to reproduce the issue which are now passing
  * [x] I'm linking the issue being fixed by this PR

ACKs for top commit:
  ValuedMammal:
    ACK 8513d83a2ef2fe748e9007984187a7f08d256ee6

Tree-SHA512: 28149458085dc4cefefe06656769d701b53f891c1ecb5d400aba8b23d63c026d6e4db1c9e6f47c8ad167edc1559d897d28e9bb71e7bd144792b5cecc0bcd31ce

7 months agofeat(bitcoind_rpc)!: Reduce friction of `Emitter` API.
志宇 [Thu, 1 May 2025 00:36:10 +0000 (10:36 +1000)]
feat(bitcoind_rpc)!: Reduce friction of `Emitter` API.

* Change signature of `Emitter::new` so that `expected_mempool_txids`
  can be more easily constructed from `TxGraph` methods.
* Change generic bounds of `C` within `Emitter<C>` to be `C: DeRef,
  C::Target: RpcApi`. This allows the caller to have `Arc<Client>` as
  `C` and does not force to caller to hold a lifetimed reference.

7 months agofeat(chain): Add convenience conversions for `CanonicalTx`
志宇 [Thu, 1 May 2025 00:28:42 +0000 (10:28 +1000)]
feat(chain): Add convenience conversions for `CanonicalTx`

* `From<CanonicalTx> for Txid`
* `From<CanonicalTx> for Arc<Transaction>`

Also added a convenience method `ChainPosition::is_unconfirmed`.

These are intended to simplify the calls needed to populate the
`expected_mempool_txids` field of `Emitter::new`.

7 months agofeat(graph): add convenience function for inserting relevant `evicted_at`s
Wei Chen [Fri, 25 Apr 2025 07:29:36 +0000 (07:29 +0000)]
feat(graph): add convenience function for inserting relevant `evicted_at`s

7 months agorefactor(rpc)!: update `mempool` interface and test code
valued mammal [Sat, 1 Feb 2025 15:15:55 +0000 (10:15 -0500)]
refactor(rpc)!: update `mempool` interface and test code

7 months agoMerge bitcoindevkit/bdk#1808: Introduce canonicalization parameters
valued mammal [Thu, 1 May 2025 14:19:35 +0000 (10:19 -0400)]
Merge bitcoindevkit/bdk#1808: Introduce canonicalization parameters

53afb3511cb472c0fd91ccf2815fa0c44ffc56ba test(graph): Add additional witness scenarios (Wei Chen)
46af2a5ca4182a0b654c42e672f2a58bd39b5b96 feat(chain)!: Add ability to modify canonicalization algorithm (志宇)
58fcf3287be09d28a34243cf7aa02b8de1012148 refactor(chain): Make private fields in `CanonicalIter` concise. (志宇)
5eb5e86b5e456a571a7bd217fb7117f5acf8cf41 feat(chain): Signed txs should displace unsigned txs in `TxGraph`. (志宇)

Pull request description:

  Partially Fixes bitcoindevkit/bdk_wallet#40

  ### Description

  Add the ability to modify the canonicalization algorithm. Right now, the only modifier is `assume_canonical` which takes in a `Vec` (ordered list) of txids and superimposes it on the canonicalization algorithm. Txs later in the list (higher index) have a higher priority (in case of conflicts).

  ### Notes to the reviewers

  None at the moment.

  ### Changelog notice

  * Added `CanonicalizationParams` to allow the caller to modify the canonicalization algorithm. This in a new parameter on `CanonicalIter::new`.
  * Changed `TxGraph::insert_tx` to allow for updating a transaction's witness field. This is useful for initially introducing an unsigned tx and adding witnesses later on.

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

  #### New Features:

  * [x] I've added tests for the new feature
  * [x] I've added docs for the new feature

  #### Bugfixes:

  * [x] This pull request breaks the existing API
  * [x] I've added tests to reproduce the issue which are now passing
  * [x] I'm linking the issue being fixed by this PR

ACKs for top commit:
  LagginTimes:
    ACK 53afb3511cb472c0fd91ccf2815fa0c44ffc56ba
  ValuedMammal:
    ACK 53afb3511cb472c0fd91ccf2815fa0c44ffc56ba

Tree-SHA512: 9fd070a3829d194f4d216c873922d9d47e047fa4b618628b875456f5cf4661d6b6c08a3a0dd4739b3a0f765e47c7c99acca53f195379e37f0f9cfed027bde17b

7 months agotest(graph): Add additional witness scenarios
Wei Chen [Mon, 28 Apr 2025 18:07:59 +0000 (18:07 +0000)]
test(graph): Add additional witness scenarios

7 months agofeat(chain)!: Add ability to modify canonicalization algorithm
志宇 [Thu, 23 Jan 2025 04:16:46 +0000 (15:16 +1100)]
feat(chain)!: Add ability to modify canonicalization algorithm

Introduce `CanonicalizationParams` which is passed in to
`CanonicalIter::new`.

`CanonicalizationParams::assume_canonical` is the only field right now.
This contains a list of txids that we assume to be canonical,
superceding any other canonicalization rules.

7 months agoMerge bitcoindevkit/bdk#1910: build(deps): bump Swatinem/rust-cache from 2.7.7 to...
Steve Myers [Thu, 1 May 2025 02:18:21 +0000 (21:18 -0500)]
Merge bitcoindevkit/bdk#1910: build(deps): bump Swatinem/rust-cache from 2.7.7 to 2.7.8

883afeef93265ae066dfa7f297433d5503edc0e6 build(deps): bump Swatinem/rust-cache from 2.7.7 to 2.7.8 (dependabot[bot])

Pull request description:

  Bumps [Swatinem/rust-cache](https://github.com/swatinem/rust-cache) from 2.7.7 to 2.7.8.
  <details>
  <summary>Release notes</summary>
  <p><em>Sourced from <a href="https://github.com/swatinem/rust-cache/releases">Swatinem/rust-cache's releases</a>.</em></p>
  <blockquote>
  <h2>v2.7.8</h2>
  <h2>What's Changed</h2>
  <ul>
  <li>Include CPU arch in the cache key for arm64 Linux runners by <a href="https://github.com/rhysd"><code>@rhysd</code></a> in <a href="https://redirect.github.com/Swatinem/rust-cache/pull/228">Swatinem/rust-cache#228</a></li>
  </ul>
  <p><strong>Full Changelog</strong>: <a href="https://github.com/Swatinem/rust-cache/compare/v2.7.7...v2.7.8">https://github.com/Swatinem/rust-cache/compare/v2.7.7...v2.7.8</a></p>
  </blockquote>
  </details>
  <details>
  <summary>Changelog</summary>
  <p><em>Sourced from <a href="https://github.com/Swatinem/rust-cache/blob/master/CHANGELOG.md">Swatinem/rust-cache's changelog</a>.</em></p>
  <blockquote>
  <h2>2.7.8</h2>
  <ul>
  <li>Include CPU arch in the cache key</li>
  </ul>
  </blockquote>
  </details>
  <details>
  <summary>Commits</summary>
  <ul>
  <li><a href="https://github.com/Swatinem/rust-cache/commit/9d47c6ad4b02e050fd481d890b2ea34778fd09d6"><code>9d47c6a</code></a> 2.7.8</li>
  <li><a href="https://github.com/Swatinem/rust-cache/commit/27b8ea9368cf428f0bfe41b0876b1a7e809d9844"><code>27b8ea9</code></a> Include CPU arch in the cache key (<a href="https://redirect.github.com/swatinem/rust-cache/issues/228">#228</a>)</li>
  <li>See full diff in <a href="https://github.com/swatinem/rust-cache/compare/v2.7.7...v2.7.8">compare view</a></li>
  </ul>
  </details>
  <br />

  [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Swatinem/rust-cache&package-manager=github_actions&previous-version=2.7.7&new-version=2.7.8)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

  Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

  [//]: # (dependabot-automerge-start)
  [//]: # (dependabot-automerge-end)

  ---

  <details>
  <summary>Dependabot commands and options</summary>
  <br />

  You can trigger Dependabot actions by commenting on this PR:
  - `@dependabot rebase` will rebase this PR
  - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
  - `@dependabot merge` will merge this PR after your CI passes on it
  - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
  - `@dependabot cancel merge` will cancel a previously requested merge and block automerging
  - `@dependabot reopen` will reopen this PR if it is closed
  - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
  - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

  </details>

ACKs for top commit:
  notmandatory:
    ACK 883afeef93265ae066dfa7f297433d5503edc0e6

Tree-SHA512: 5687a1e279223b8b923ae8fac9d221b37d343a273c688743794c646971fd4aec9022d1a7379c8708159b8df03bfca5b16b1dc4ae5847836279d2c403a062fa71

7 months agobuild(deps): bump Swatinem/rust-cache from 2.7.7 to 2.7.8 github/dependabot/github_actions/Swatinem/rust-cache-2.7.8
dependabot[bot] [Thu, 1 May 2025 02:09:49 +0000 (02:09 +0000)]
build(deps): bump Swatinem/rust-cache from 2.7.7 to 2.7.8

Bumps [Swatinem/rust-cache](https://github.com/swatinem/rust-cache) from 2.7.7 to 2.7.8.
- [Release notes](https://github.com/swatinem/rust-cache/releases)
- [Changelog](https://github.com/Swatinem/rust-cache/blob/master/CHANGELOG.md)
- [Commits](https://github.com/swatinem/rust-cache/compare/v2.7.7...v2.7.8)

---
updated-dependencies:
- dependency-name: Swatinem/rust-cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
7 months agorefactor(chain): Make private fields in `CanonicalIter` concise.
志宇 [Thu, 23 Jan 2025 02:33:43 +0000 (13:33 +1100)]
refactor(chain): Make private fields in `CanonicalIter` concise.

7 months agofeat(chain): Signed txs should displace unsigned txs in `TxGraph`.
志宇 [Thu, 23 Jan 2025 01:41:04 +0000 (12:41 +1100)]
feat(chain): Signed txs should displace unsigned txs in `TxGraph`.

7 months agoMerge bitcoindevkit/bdk#1917: Canonicalization should handle transactions that spend...
merge-script [Wed, 23 Apr 2025 23:21:21 +0000 (09:21 +1000)]
Merge bitcoindevkit/bdk#1917: Canonicalization should handle transactions that spend from two conflicting transactions

370497c3a9c361e10c8341cbb07210f026cc3e04 fix(chain): Correctly handle txs that double spend themselves (志宇)

Pull request description:

  Fixes #1898

  ### Description

  When we initially created the canonicalization algorithm, we didn't expect callers to insert invalid transactions into the graph. However, user error happens and we should handle it correctly.

  Before this PR, when inserting transactions that double-spend themselves (where two or more different inputs of the transactions conflict), the canonicalization result will have inconsistencies.

  ### Notes to the reviewers

  Logic changes are all contained in `CanonicalIter::mark_canonical`. `mark_canonical` will detect whether the `tx` being passed in double spends itself. If so, we abort and undo all changes made so far.

  There is a slight <2% degradation in performance with this change (except in two cases where there is a performance improvement of ~10%).

  [bench.txt](https://github.com/user-attachments/files/19788730/bench.txt)

  ### Changelog notice

  * Fix canonicalization mess-up when transactions that conflict with itself are inserted.

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

  #### Bugfixes:

  ~~* [ ] This pull request breaks the existing API~~
  * [x] I've added tests to reproduce the issue which are now passing
  * [x] I'm linking the issue being fixed by this PR

ACKs for top commit:
  ValuedMammal:
    ACK 370497c3a9c361e10c8341cbb07210f026cc3e04
  LagginTimes:
    ACK 370497c3a9c361e10c8341cbb07210f026cc3e04

Tree-SHA512: 41b08208b3ca7119ff10898c22f91b1fd41bb83876e4ca0655ece13b43db8cf3963a529286282c5fcd0e94d6ae073ffb30b19e91d28d8459957d5592bbacd3c9

8 months agofix(chain): Correctly handle txs that double spend themselves
志宇 [Fri, 28 Mar 2025 06:06:26 +0000 (17:06 +1100)]
fix(chain): Correctly handle txs that double spend themselves

Detect self-double-spends in `CanonicalIter::mark_canonical`. Disregard
the tx that self-double-spends and all it's attached meta data (such as
timestamps and anchors).

Add new test cases on `test_tx_conflict_handling` for transactions that
self-double-spend.