• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bitcoindevkit / bdk / 16042287032
79%

Build:
DEFAULT BRANCH: master
Ran 03 Jul 2025 05:31AM UTC
Jobs 1
Files 30
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Jul 2025 03:39AM UTC coverage: 81.684% (-0.7%) from 82.396%
16042287032

push

github

evanlinjin
Merge bitcoindevkit/bdk#1957: feat(electrum): optimize merkle proof validation with batching

156cbab67 test(electrum): Improve benchmark (志宇)
4ea5ea6c4 feat(electrum): batch `transaction.get_merkle` calls via `batch_call` (Wei Chen)
ec4fd971c feat(electrum): batched `Header`s and `script_get_history` (Wei Chen)
f21a21d8c test(electrum): add `criterion` benchmark for `sync` (Wei Chen)
b57768dd2 fix(electrum): improve tx validation and gap limit scanning (keerthi)
7a18cad68 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 carri... (continued)

130 of 194 new or added lines in 1 file covered. (67.01%)

27 existing lines in 7 files now uncovered.

5218 of 6388 relevant lines covered (81.68%)

33786.73 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
64
78.94
0.21% crates/electrum/src/bdk_electrum_client.rs

Uncovered Existing Lines

Lines Coverage ∆ File
2
66.95
-1.03% crates/chain/src/rusqlite_impl.rs
2
90.14
-1.06% crates/esplora/src/async_ext.rs
2
94.58
-1.72% crates/file_store/src/store.rs
2
91.04
-1.3% crates/testenv/src/lib.rs
3
72.29
0.01% crates/chain/src/local_chain.rs
6
78.94
0.21% crates/electrum/src/bdk_electrum_client.rs
10
88.74
-2.21% crates/esplora/src/blocking_ext.rs
Jobs
ID Job ID Ran Files Coverage
1 16042287032.1 03 Jul 2025 05:31AM UTC 30
81.68
GitHub Action Run
Source Files on build 16042287032
  • Tree
  • List 30
  • Changed 23
  • Source Changed 0
  • Coverage Changed 23
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 1039d3cc on github
  • Prev Build on master (#15717531900)
  • Next Build on master (#16052224723)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc