Skip to content

qa: feature_pruning.py fails when built ENABLE_WALLET=OFF #34175

Closed

Description

@hebasto

Below are the steps to reproduce the bug:

$ cmake -B build -DENABLE_WALLET=OFF
$ cmake --build build
$ ./build/test/functional/feature_pruning.py --tmpdir $(pwd)/tmp
2025-12-29T18:31:27.385714Z TestFramework (INFO): PRNG seed is: 6842027149269818275
2025-12-29T18:31:27.386337Z TestFramework (INFO): Initializing test directory /home/hebasto/dev/bitcoin/tmp
2025-12-29T18:31:28.135416Z TestFramework (INFO): Warning! This test requires 4GB of disk space
2025-12-29T18:31:28.135533Z TestFramework (INFO): Mining a big blockchain of 995 blocks
2025-12-29T18:31:49.087269Z TestFramework (INFO): Check that we haven't started pruning yet because we're below PruneAfterHeight
2025-12-29T18:31:49.087331Z TestFramework (INFO): Success
2025-12-29T18:31:49.087425Z TestFramework (INFO): Though we're already using more than 550MiB, current usage: 592.1861515045166
2025-12-29T18:31:49.087446Z TestFramework (INFO): Mining 25 more blocks should cause the first block file to be pruned
2025-12-29T18:31:49.917042Z TestFramework (INFO): Success
2025-12-29T18:31:49.917238Z TestFramework (INFO): Usage should be below target: 480.3139057159424
2025-12-29T18:31:49.917265Z TestFramework (INFO): Check that we'll exceed disk space target if we have a very high stale block rate
2025-12-29T18:31:49.917287Z TestFramework (INFO): Mine 24 (stale) blocks on Node 1, followed by 25 (main chain) block reorg from Node 0, for 12 rounds
2025-12-29T18:32:23.946016Z TestFramework (INFO): Usage can be over target because of high stale rate: 640.085205078125
2025-12-29T18:32:23.947212Z TestFramework (INFO): Check that we can survive a 288 block reorg still
2025-12-29T18:32:23.947673Z TestFramework (INFO): Current block height: 1320
2025-12-29T18:32:23.948098Z TestFramework (INFO): Invalidating block 170863767faea392ccf9ff5b962cc758ebe9991b2562af2f3aa044c321d175e2 at height 1033
2025-12-29T18:32:24.322179Z TestFramework (INFO): New best height: 1032
2025-12-29T18:32:24.429004Z TestFramework (INFO): Generating new longer chain of 300 more blocks
2025-12-29T18:32:24.562884Z TestFramework (INFO): Reconnect nodes
2025-12-29T18:32:25.769411Z TestFramework (INFO): Verify height on node 2: 1332
2025-12-29T18:32:25.769654Z TestFramework (INFO): Usage possibly still high because of stale blocks in block files: 640.085205078125
2025-12-29T18:32:25.769682Z TestFramework (INFO): Mine 220 more large blocks so we have requisite history
2025-12-29T18:32:32.175362Z TestFramework (INFO): Usage should be below target: 448.4003086090088
2025-12-29T18:32:32.175530Z TestFramework (INFO): Test that we can rerequest a block we previously pruned if needed for a reorg
2025-12-29T18:32:33.817865Z TestFramework (INFO): Will need to redownload block 1033
2025-12-29T18:32:33.938875Z TestFramework (INFO): Rewind node 0 to prev main chain to mine longer chain to trigger redownload. Blocks needed: 233
2025-12-29T18:32:35.807399Z TestFramework (INFO): Verify node 2 reorged back to the main chain, some blocks of which it had to redownload
2025-12-29T18:32:38.244340Z TestFramework (INFO): Test manual pruning with block indices
2025-12-29T18:32:39.327901Z TestFramework (INFO): Success
2025-12-29T18:32:39.327948Z TestFramework (INFO): Test manual pruning with timestamps
2025-12-29T18:32:40.410622Z TestFramework (INFO): Success
2025-12-29T18:32:40.410722Z TestFramework (INFO): Test invalid pruning command line options
2025-12-29T18:32:40.580461Z TestFramework (INFO): Test scanblocks can not return pruned data
2025-12-29T18:32:40.583664Z TestFramework (ERROR): Unexpected exception
Traceback (most recent call last):
  File "/home/hebasto/dev/bitcoin/test/functional/test_framework/test_framework.py", line 142, in main
    self.run_test()
    ~~~~~~~~~~~~~^^
  File "/home/hebasto/dev/bitcoin/./build/test/functional/feature_pruning.py", line 481, in run_test
    self.test_scanblocks_pruned()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/hebasto/dev/bitcoin/./build/test/functional/feature_pruning.py", line 496, in test_scanblocks_pruned
    assert_raises_rpc_error(-1, "Block not available (pruned data)", node.scanblocks,
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        "start", [{"desc": f"raw({false_positive_spk.hex()})"}], 0, 0, "basic", {"filter_false_positives": True})
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hebasto/dev/bitcoin/test/functional/test_framework/util.py", line 157, in assert_raises_rpc_error
    assert try_rpc(code, message, fun, *args, **kwds), "No exception raised"
           ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: No exception raised
2025-12-29T18:32:40.636711Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later.
2025-12-29T18:32:40.636826Z TestFramework (WARNING): Not cleaning up dir /home/hebasto/dev/bitcoin/tmp
2025-12-29T18:32:40.636857Z TestFramework (ERROR): Test failed. Test logging available at /home/hebasto/dev/bitcoin/tmp/test_framework.log
2025-12-29T18:32:40.636939Z TestFramework (ERROR): 
2025-12-29T18:32:40.637012Z TestFramework (ERROR): Hint: Call /home/hebasto/dev/bitcoin/test/functional/combine_logs.py '/home/hebasto/dev/bitcoin/tmp' to consolidate all logs
2025-12-29T18:32:40.637031Z TestFramework (ERROR): 
2025-12-29T18:32:40.637048Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2025-12-29T18:32:40.637086Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
2025-12-29T18:32:40.637103Z TestFramework (ERROR): 
[node 5] Cleaning up leftover process
[node 4] Cleaning up leftover process
[node 3] Cleaning up leftover process
[node 2] Cleaning up leftover process
[node 1] Cleaning up leftover process

The combined log appears to be too large to upload to GitHub.

This was initially observed on NetBSD and was later reproduced on Fedora 43.

Activity

  1. brunoerg commented on Dec 30, 2025

    @brunoerg
    Contributor

    I was able to reproduce it on macOS 14.3:

    cmake -B build_no_wallet -DENABLE_IPC=OFF -DENABLE_WALLET=OFF && cmake --build build_no_wallet -j 10 && ./build_no_wallet/test/functional/feature_pruning.py --tmpdir $(pwd)/tmp
    
    2025-12-30T21:10:45.025328Z TestFramework (INFO): Test manual pruning with block indices
    2025-12-30T21:10:46.286682Z TestFramework (INFO): Success
    2025-12-30T21:10:46.286738Z TestFramework (INFO): Test manual pruning with timestamps
    2025-12-30T21:10:47.544538Z TestFramework (INFO): Success
    2025-12-30T21:10:47.544656Z TestFramework (INFO): Test invalid pruning command line options
    2025-12-30T21:10:47.686153Z TestFramework (INFO): Test scanblocks can not return pruned data
    2025-12-30T21:10:47.688006Z TestFramework (ERROR): Unexpected exception
    Traceback (most recent call last):
      File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/test_framework.py", line 142, in main
        self.run_test()
        ~~~~~~~~~~~~~^^
      File "/Users/brunogarcia/projects/bitcoin-core-dev/./build_no_wallet/test/functional/feature_pruning.py", line 481, in run_test
        self.test_scanblocks_pruned()
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
      File "/Users/brunogarcia/projects/bitcoin-core-dev/./build_no_wallet/test/functional/feature_pruning.py", line 496, in test_scanblocks_pruned
        assert_raises_rpc_error(-1, "Block not available (pruned data)", node.scanblocks,
        ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            "start", [{"desc": f"raw({false_positive_spk.hex()})"}], 0, 0, "basic", {"filter_false_positives": True})
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/util.py", line 157, in assert_raises_rpc_error
        assert try_rpc(code, message, fun, *args, **kwds), "No exception raised"
               ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AssertionError: No exception raised
    2025-12-30T21:10:47.742645Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later.
    2025-12-30T21:10:47.742746Z TestFramework (WARNING): Not cleaning up dir /Users/brunogarcia/projects/bitcoin-core-dev/tmp
    2025-12-30T21:10:47.742778Z TestFramework (ERROR): Test failed. Test logging available at /Users/brunogarcia/projects/bitcoin-core-dev/tmp/test_framework.log
    2025-12-30T21:10:47.742868Z TestFramework (ERROR):
    2025-12-30T21:10:47.742948Z TestFramework (ERROR): Hint: Call /Users/brunogarcia/projects/bitcoin-core-dev/test/functional/combine_logs.py '/Users/brunogarcia/projects/bitcoin-core-dev/tmp' to consolidate all logs
    2025-12-30T21:10:47.742973Z TestFramework (ERROR):
    2025-12-30T21:10:47.742996Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
    2025-12-30T21:10:47.743040Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
    2025-12-30T21:10:47.743061Z TestFramework (ERROR):
    [node 5] Cleaning up leftover process
    [node 4] Cleaning up leftover process
    [node 3] Cleaning up leftover process
    [node 2] Cleaning up leftover process
    [node 1] Cleaning up leftover process
  2. brunoerg commented on Dec 30, 2025

    @brunoerg
    Contributor

    I did not investigate it in depth, but I think we shouldn't test the behavior of scanblocks for a pruned node, especially filtering false positives, with the genesis block since it has no undo data. Also, without wallet, the wallet_test is skipped so node5 isn't synced with node0 and the prune isn't done?

  3. added a commit that references this issue on Jan 14, 2026
    cd0959c
  4. added 3 commits that reference this issue on Oct 1, 2026
    951db46
    4fde2fc
    8ff8083
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions