|
Ran
|
Jobs
1
|
Files
52
|
Run time
1min
|
Badge
README BADGES
|
push
github
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
| 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 |
| 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 |
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 13580984527.1 | 52 |
84.62 |
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|