|
Ran
|
Jobs
1
|
Files
30
|
Run time
1min
|
Badge
README BADGES
|
push
github
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
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 64 |
78.94 |
0.21% | crates/electrum/src/bdk_electrum_client.rs |
| 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 |
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 16042287032.1 | 30 |
81.68 |
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|