wallet: fix importdescriptors batch abort on timestamp error #35185

pull shuv-amp wants to merge 1 commits into bitcoin:master from shuv-amp:fix-importdesc-timestamp-abort changing 2 files +41 −10
  1. shuv-amp commented at 6:53 PM on April 30, 2026: none

    Fixes #35181.

    importdescriptors returns one result per request, but timestamp parsing happened before the per-item result was created. A missing or invalid timestamp could therefore throw a top-level RPC error and abort the batch response after earlier requests may already have been applied.

    Handle timestamp failures per item by adding a {success: false, error: ...} result for the failing request and continuing with later requests.

    Store parsed timestamps during the import loop so the rescan error path does not need to parse failed requests again.

    Tested:

    python3 build/test/functional/test_runner.py wallet_importdescriptors.py --timeout-factor=3
    
  2. DrahtBot added the label Wallet on Apr 30, 2026
  3. DrahtBot commented at 6:54 PM on April 30, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK polespinasa

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #34861 (wallet: Add importdescriptors interface by polespinasa)
    • #33392 (wallet, rpc: add UTXO set check and incremental rescan to importdescriptors by musaHaruna)
    • #31668 (Added rescan option for import descriptors by saikiran57)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. polespinasa commented at 7:08 PM on April 30, 2026: member

    cACK

    Will review the code soon. I think this change makes sense. @achow101 is there a reason why we would want to throw and not store the error on each import?

    Apart from that, there is a PR refactoring the importdescriptors code in #34861. I think it may make sense for you to try to add this patch on top of that new code. Or even maybe, if this gets a few concept ACKs I can cherry-pick your commit and add the changes in the refactor.

  5. shuv-amp force-pushed on Apr 30, 2026
  6. shuv-amp force-pushed on Apr 30, 2026
  7. DrahtBot added the label CI failed on May 1, 2026
  8. DrahtBot commented at 12:32 AM on May 1, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task iwyu: https://github.com/bitcoin/bitcoin/actions/runs/25184385086/job/73872950325</sub> <sub>LLM reason (✨ experimental): CI failed because the IWYU (include-what-you-use) check reported an incorrect/missing include in src/util/feefrac.h and exited with failure.</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>

  9. shuv-amp force-pushed on May 1, 2026
  10. wallet: return per-item error for bad timestamp in importdescriptors
    importdescriptors is documented to return one result for each request.
    Timestamp parsing happened before the per-item result was created, so a
    missing or invalid timestamp threw a top-level RPC error and aborted the
    batch. Earlier items could already have been applied, but the response
    was lost.
    
    Catch timestamp failures per item, append a failed result, and continue.
    Store parsed timestamps so the rescan path does not re-parse failed
    requests.
    30c2593ac6
  11. shuv-amp force-pushed on May 2, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-04 00:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me