full_scan over RPC ignores --scan-stop-gap: restored wallet silently misses funds at external index >= 25
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Read src/handlers/online.rs, especially the RPC branch after the Electrum and Esplora handling, and compare how stop_gap is consumed by each backend. Run the linked regtest reproduction to confirm the external-index failure and inspect the wallet lookahead context described in the issue. Done means RPC scans no longer silently miss these funds, or clearly warn and document the limitation.
索引モデルが issue の本文から書いたものです。
説明
Environment: bdk-cli 4.0.0 from crates.io (tag v4.0.0, git 5b3cb00, built with --features rpc), bdk_wallet 3.2.0, bdk_chain 0.23.3, bdk_bitcoind_rpc 0.22.0, Bitcoin Core v31.1.0, regtest, macOS arm64
What happens
Restoring a wpkh() descriptor exported from Bitcoin Core and running full_scan with --client-type rpc does not find funds received at external index 25 or higher when no lower index has been used. The command exits with status 0, prints "Full scan completed successfully." and reports a zero balance. Passing --scan-stop-gap 100 does not change the result, even though full_scan --help documents that flag without noting that it has no effect with --client-type rpc.
| Funded external index (only) | Core getbalance |
bdk-cli balance |
|---|---|---|
| 24 | 1.00000000 | 100000000 sat |
| 25 | 1.00000000 | 0 |
| 30 | 1.00000000 | 0 |
30 with --scan-stop-gap 100 |
1.00000000 | 0 |
bdk-cli's own event output shows the chain was fully walked in every case ("Chain tip advanced from height 0 to …"), but a "Transaction … confirmed" event appears only for index 24.
Expected behavior
Either the funds are found when --scan-stop-gap is raised (as the help text suggests), or the CLI warns that the flag has no effect with --client-type rpc.
Why (from reading the v4.0.0 source)
In src/handlers/online.rs, stop_gap is passed to the Electrum (L123) and Esplora (L134) clients, but the RPC branch (L141+) walks blocks with Emitter and never reads it. Detection then depends on the keychain lookahead (DEFAULT_LOOKAHEAD = 25 in bdk_chain 0.23.3). bdk_wallet already exposes a lookahead() parameter for this, but bdk-cli does not use or expose it.
Related library-level context: bitcoindevkit/bdk_wallet#83, where it was noted that lookahead and stop_gap "should be fixed together". This report is about the CLI surface: the flag is accepted but has no effect with RPC, and there is no way to raise the lookahead from the CLI.
Why it matters
Bitcoin Core wallets pre-derive 1000 keys by default (DEFAULT_KEYPOOL_SIZE), so funds past index 24 are plausible. A user restoring such a backup with bdk-cli over RPC sees a successful scan and a zero balance.
Possible fixes (maintainers' call)
- Pass
--scan-stop-gapthrough as the wallet lookahead for block-based backends, or add a--lookaheadoption. - Warn or error when
--scan-stop-gapis passed with--client-type rpc. - Document the behavior.
Reproduction: self-contained regtest script and logs: https://gist.github.com/devdavidejesus/25b34cb7d2735f04791800c12b21d59d
- 主要言語
- Rust
- スター
- 143
- フォーク
- 98
- 平均マージ
- 5日 21時間
- マージ済み PR(30日)
- 4
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bitcoindevkit/bdk-cli のほかの issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
bitcoindevkit/bdk-cli#332 · コメント 2 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
bitcoindevkit/bdk-cli#330 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
bitcoindevkit/bdk-cli#318 ·
メンテナーはふだん 3 日以内に返信
-
Enforce Core-compatible OP_RETURN / datacarrier and standard tx-size limits in create_tx対応中かも @tvpeter が 5 日前に担当しました。 オープンenhancement
bitcoindevkit/bdk-cli#339 · 担当者 1 名 ·
メンテナーはふだん 3 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
bitcoindevkit/bdk-cli#338 ·
メンテナーはふだん 3 日以内に返信
bitcoindevkit/bdk-cli の issue をすべて見る
似ている issue
-
ai_p2
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
ClickHouse/ClickHouse#123351 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
github/copilot-sdk#2804 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
lance-format/lance#9655 ·
メンテナーはふだん 2 日以内に返信
-
bug language::rust router
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Vector35/binaryninja-api#8621 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信