Commit message · Max Fangtx-sync: parallelize esplora status queries
The esplora sync loop awaited each HTTP query sequentially: one
get_block_status per relevant txid, 3 round trips (merkle block, tx,
block status) per watched transaction, and one get_output_status per
watched output. With many channels this pure latency dominates sync
wall-clock time, particularly during the first sync after a restart.
In async builds, run the per-block, per-transaction, and per-output
queries concurrently via buffer_unordered, bounded at 16 in-flight
requests by default and configurable via with_concurrency.
Confirmed transactions are already sorted by (height, in-block
position) before being fed to the confirmables, so completion order
does not matter. The blocking client variant remains sequential.
Also dedup block status queries by block hash (multiple relevant txids
can share a block), and drop a redundant duplicate-txid check when
iterating watched_transactions: it is a HashSet, so txids are unique.
Note that items are moved into the concurrently-polled futures as owned
values (txids copied, watched outputs cloned). Borrowing them compiles
within this crate but trips rustc's "implementation of FnOnce is not
general enough" false positive in downstream callers that box the
returned sync future.
68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queuedsigning or wallet pathsecond-pass: security-sensitive path
AI analysis · Informational 21/100This commit is a performance improvement, not a security fix. It speeds up how rust-lightning asks an Esplora server about transaction and block status by running many requests at once instead of one at a time. The change also removes a duplicate check and deduplicates repeated block-status lookups. There is no indication in the commit that it fixes a vulnerability or that the old code was unsafe.