wollet: fetch address histories concurrently - #175
Open
dadafros wants to merge 1 commit into
Open
Conversation
The address walk of the esplora full scan awaits one history request per address sequentially, so wall-clock grows linearly with the number of scanned addresses even though EsploraClientBuilder::concurrency already parallelizes transaction and header downloads. Drive the same batch through an ordered buffered stream honoring the configured concurrency: buffered (not buffer_unordered) because callers map results back to derivation indices positionally, and try_collect to stop at the first error like the sequential loop does. The per-address futures are instantiated eagerly (they stay inert until polled; buffered still caps concurrent polling): holding an &Address-borrowing closure inside the stream trips rustc's higher-ranked FnOnce limitation (rust-lang/rust#89976) as soon as a downstream async_trait consumer such as lwk_boltz must prove the resulting future Send. Default concurrency stays 1, so behavior is unchanged unless opted in.
dadafros
force-pushed
the
concurrent-address-histories
branch
from
August 5, 2026 13:18
7ab2a4e to
d976f00
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #169: the pagination half is superseded by f450cb3/94a57422, so per the closing invitation this brings back only the concurrency half, rebased on top of them.
get_scripts_history_esploraawaited one request per address sequentially; it now drives the batch through an orderedbufferedstream honoringEsploraClientBuilder::concurrency. Default stays 1, so behavior is unchanged unless opted in.One non-obvious bit: the per-address futures are instantiated eagerly (they stay inert until polled) — holding an
&Address-borrowing closure in the stream trips rust-lang/rust#89976 when anasync_traitconsumer like lwk_boltz must prove the futureSend.The paging e2e (
test_esplora_address_history_paging) now runs atconcurrency(4), so it also exercises the concurrent walk.