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

bitcoindevkit / bdk / 13580984527
79%

Build:
DEFAULT BRANCH: master
Ran 28 Feb 2025 03:56AM UTC
Jobs 1
Files 52
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

28 Feb 2025 03:53AM UTC coverage: 84.621% (+0.06%) from 84.56%
13580984527

push

github

evanlinjin
Merge bitcoindevkit/bdk#1838: Make full-scan/sync flow easier to reason about.

800f3580f feat!: Improve spk-based syncing flow (志宇)
ee527454b feat(core)!: Make `TxUpdate` non-exhaustive (志宇)

Pull request description:

  ### Description

  #1811 introduces the `evicted-at` concept. While adding this to `TxUpdate`, I realized there were some shortcomings in our full-scan & sync flow:

  * Chain sources that use `TxUpdate` to convey updates cannot choose to add transactions without a `seen_at` timestamp as the `TxGraph::apply_update_at` logic adds this timestamp for all unanchored txs if the `seen_at` parameter is specified. Purposefully adding uncanonical txs is useful for wallets that want to know about replaced txs.
  * The `TxGraph::apply_update_at` logic is hard to reason about. `TxUpdate::seen_ats` already has the `seen_at` timestamp per tx, but `apply_update_at()` also takes in a `seen_at` timestamp`.
  * `TxUpdate::seen_ats` currently forces us to only have one `seen-at` per tx as it's a map of `txid -> seen_at`. However, in the future we want to add a `first-seen` timestamp to `TxGraph` which is basically the earliest `seen-at` timestamp introduced so we may want to have multiple `seen_at`s per tx. The other issue is if we merge `TxUpdate`s, we will loose data. I.e. we can only keep the `last_seen` or the `first_seen`.

  These problems were exacerbated when introducing `evicted-at`. In the old design, the chain-source has no concept of sync time (as sync time was introduced after-the-fact when applying the `TxUpdate`). Therefore the introduced `TxUpdate::evicted` field was a `HashSet<Txid>` (no timestamps) and relied on the `TxGraph::apply_upate_at` logic to introduce the `evicted-at` timestamp. All this makes the sync logic harder to understand. What happens if the `seen_at` input is `None`? What happens if updates were applied out of order? What happens when we merge `TxUpdates` ... (continued)

108 of 142 new or added lines in 6 files covered. (76.06%)

4 existing lines in 4 files now uncovered.

11979 of 14156 relevant lines covered (84.62%)

15100.12 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
86.03
0.01% crates/chain/src/tx_graph.rs
1
94.59
-5.41% crates/esplora/src/lib.rs
7
90.96
-0.58% crates/esplora/src/async_ext.rs
7
90.78
-0.55% crates/esplora/src/blocking_ext.rs
18
78.09
-1.76% crates/electrum/src/bdk_electrum_client.rs

Uncovered Existing Lines

Lines Coverage ∆ File
1
83.03
3.29% crates/chain/src/indexed_tx_graph.rs
1
78.09
-1.76% crates/electrum/src/bdk_electrum_client.rs
1
90.96
-0.58% crates/esplora/src/async_ext.rs
1
94.59
-5.41% crates/esplora/src/lib.rs
Jobs
ID Job ID Ran Files Coverage
1 13580984527.1 28 Feb 2025 03:56AM UTC 52
84.62
GitHub Action Run
Source Files on build 13580984527
  • Tree
  • List 52
  • Changed 18
  • Source Changed 0
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • b26ff891 on github
  • Prev Build on master (#13580469730)
  • Next Build on master (#13687812686)
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