]> Untitled Git - bdk/commit
feat!: Improve spk-based syncing flow
author志宇 <hello@evanlinjin.me>
Thu, 13 Feb 2025 11:08:18 +0000 (22:08 +1100)
committer志宇 <hello@evanlinjin.me>
Fri, 28 Feb 2025 03:12:03 +0000 (14:12 +1100)
commit800f3580f8518e15ccaf9622fdd2e5141a50d5e5
treed0443e5432838d3ab6b94c0d45f238dbc7e8d7df
parentee527454b0dc451ea44fd9410db3e396cb48817f
feat!: Improve spk-based syncing flow

* Change `TxUpdate::seen_ats` to be a `HashSet<(Txid, u64)>` so we can
  introduce multiple timestamps per tx. This is useful to introduce both
  `first_seen` and `last_seen` timestamps to `TxGraph`. This is also a
  better API for chain-sources as they can just insert timestamps into
  the field without checking previous values.
* Change sync/full-scan flow to have the request structure introduce the
  sync time instead of introducing the timestamp when apply the
  `TxUpdate`. This simplifies the `apply_update{_at}` logic and makes
  `evicted_at` easier to reason about (in the future).
crates/chain/benches/canonicalization.rs
crates/chain/src/indexed_tx_graph.rs
crates/chain/src/tx_graph.rs
crates/chain/tests/test_tx_graph.rs
crates/core/src/spk_client.rs
crates/core/src/tx_update.rs
crates/electrum/src/bdk_electrum_client.rs
crates/electrum/tests/test_electrum.rs
crates/esplora/src/async_ext.rs
crates/esplora/src/blocking_ext.rs
crates/esplora/src/lib.rs