Repository navigation
Conversation
A `parallel_requests` of 0 made `full_scan` and `sync` skip every request and return an empty `Ok`, because each fetch loop takes its next batch with `.take(parallel_requests)` and stops when the batch is empty. Clamp it to 1 in `fetch_txs_with_keychain_spks`, `fetch_txs_with_txids` and `fetch_txs_with_outpoints`, for both the blocking and async clients. This matches how `stop_gap` is already handled. Document the behaviour on the public methods and in the crate docs, and add tests for each scan path. Fixes bitcoindevkit#2291
A `batch_size` of 0 made `full_scan` and `sync` skip every request and return an empty `Ok`, because `populate_with_spks` builds each batch with `(0..batch_size)` and returns when the batch is empty. Clamp it to 1 in `populate_with_spks`, document the behaviour on the public methods, and add tests for both scan methods. Fixes bitcoindevkit#2291
yahia008
force-pushed
the
fix/zero-parallel-requests
branch
from
October 9, 2026 16:08
a5aa794 to
b3e6434
Compare
Author
|
Hi! This is my first contribution to BDK, so the CI workflows are waiting for maintainer approval. Could someone approve them when you have a moment? 🙏 So far I've run these in a Codespace, and they all pass:
I'm also happy to hear whether you'd prefer an error for |
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.
Description
Fixes #2291.
Passing
parallel_requests = 0tobdk_esplora, orbatch_size = 0tobdk_electrum, causedfull_scanandsyncto skip all requests and return an emptyOk. This made the wallet appear synced despite missing transactions, without indicating that the scan or sync had failed.Notes to the reviewers
This change ensures that zero-valued request limits do not cause
full_scanorsyncto silently skip the requested work and return an apparently successful result.The regression tests use an unreachable server endpoint to verify that the requested fetches are not skipped when the relevant parameter is zero. The Esplora tests cover
parallel_requests = 0, while the Electrum tests coverbatch_size = 0andparallel_requests = 0, including the separate fetch loops for script pubkeys, transaction IDs, and outpoints.Changelog notice
Checklists
All Submissions: