Page MenuHomePhabricator

wallet: avoid rescans if under the snapshot
ClosedPublic

Authored by PiRK on Thu, Feb 6, 15:11.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC2069f3c76279: wallet: avoid rescans if under the snapshot
Summary

Refuse to load a wallet if it requires a rescan lower than the height of
an unvalidated snapshot we're running -- in more general terms, if we
don't have data for the blocks.

This is a backport of core#23997 and core#26282

Depends on D17645

Test Plan

ninja all check-all

Event Timeline

PiRK requested review of this revision.Thu, Feb 6, 15:11
PiRK edited the summary of this revision. (Show Details)

squash with 26282 (more helpful error message)

Failed tests logs:

====== Bitcoin ABC functional tests: abc_p2p_getavaaddr.py ======

------- Stdout: -------
2025-02-08T10:38:53.843000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_🏃_20250208_103852/abc_p2p_getavaaddr_5
2025-02-08T10:39:57.912000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
        def test_function():
            if check_connected:
                assert self.is_connected
            return test_function_in()
'''
2025-02-08T10:39:57.912000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 149, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 139, in _run_test_internal
    self.run_test()
  File "/work/test/functional/abc_p2p_getavaaddr.py", line 554, in run_test
    self.getavaaddr_interval_test()
  File "/work/test/functional/abc_p2p_getavaaddr.py", line 173, in getavaaddr_interval_test
    requester.wait_until(requester.addr_received)
  File "/work/test/functional/test_framework/p2p.py", line 582, in wait_until
    wait_until_helper(
  File "/work/test/functional/test_framework/util.py", line 296, in wait_until_helper
    raise AssertionError(
AssertionError: Predicate ''''
        def test_function():
            if check_connected:
                assert self.is_connected
            return test_function_in()
''' not true after 60.0 seconds
2025-02-08T10:39:57.963000Z TestFramework (INFO): Stopping nodes
2025-02-08T10:39:58.114000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_🏃_20250208_103852/abc_p2p_getavaaddr_5
2025-02-08T10:39:58.114000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_🏃_20250208_103852/abc_p2p_getavaaddr_5/test_framework.log
2025-02-08T10:39:58.114000Z TestFramework (ERROR): 
2025-02-08T10:39:58.115000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_🏃_20250208_103852/abc_p2p_getavaaddr_5' to consolidate all logs
2025-02-08T10:39:58.115000Z TestFramework (ERROR): 
2025-02-08T10:39:58.115000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2025-02-08T10:39:58.115000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2025-02-08T10:39:58.115000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: abc_p2p_getavaaddr.py

Failed tests logs:

====== Bitcoin ABC functional tests: feature_assumevalid.py ======

------- Stdout: -------
2025-02-08T10:38:41.532000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_🏃_20250208_103630/feature_assumevalid_43
2025-02-08T10:39:47.642000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
        self.wait_until(lambda: self.nodes[0].getblockcount() >= COINBASE_MATURITY + 1)
'''
2025-02-08T10:39:47.643000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 149, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 139, in _run_test_internal
    self.run_test()
  File "/work/test/functional/feature_assumevalid.py", line 158, in run_test
    self.wait_until(lambda: self.nodes[0].getblockcount() >= COINBASE_MATURITY + 1)
  File "/work/test/functional/test_framework/test_framework.py", line 871, in wait_until
    return wait_until_helper(
           ^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/util.py", line 296, in wait_until_helper
    raise AssertionError(
AssertionError: Predicate ''''
        self.wait_until(lambda: self.nodes[0].getblockcount() >= COINBASE_MATURITY + 1)
''' not true after 60.0 seconds
2025-02-08T10:39:47.695000Z TestFramework (INFO): Stopping nodes
2025-02-08T10:39:48.049000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_🏃_20250208_103630/feature_assumevalid_43
2025-02-08T10:39:48.050000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_🏃_20250208_103630/feature_assumevalid_43/test_framework.log
2025-02-08T10:39:48.050000Z TestFramework (ERROR): 
2025-02-08T10:39:48.050000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_🏃_20250208_103630/feature_assumevalid_43' to consolidate all logs
2025-02-08T10:39:48.050000Z TestFramework (ERROR): 
2025-02-08T10:39:48.050000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2025-02-08T10:39:48.050000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2025-02-08T10:39:48.050000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: feature_assumevalid.py

PiRK planned changes to this revision.Sat, Feb 8, 16:46

need to investigate that CI second failure (the first one is clearly unrelated)

rebase. I'm convinced the feature_assumevalid.py failure is unrelated to this diff

Failed tests logs:

====== Bitcoin ABC functional tests: abc_p2p_getavaaddr.py ======

------- Stdout: -------
2025-02-11T08:38:27.907000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_🏃_20250211_083825/abc_p2p_getavaaddr_4
2025-02-11T08:39:31.354000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
        def test_function():
            if check_connected:
                assert self.is_connected
            return test_function_in()
'''
2025-02-11T08:39:31.354000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 149, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 139, in _run_test_internal
    self.run_test()
  File "/work/test/functional/abc_p2p_getavaaddr.py", line 554, in run_test
    self.getavaaddr_interval_test()
  File "/work/test/functional/abc_p2p_getavaaddr.py", line 173, in getavaaddr_interval_test
    requester.wait_until(requester.addr_received)
  File "/work/test/functional/test_framework/p2p.py", line 582, in wait_until
    wait_until_helper(
  File "/work/test/functional/test_framework/util.py", line 296, in wait_until_helper
    raise AssertionError(
AssertionError: Predicate ''''
        def test_function():
            if check_connected:
                assert self.is_connected
            return test_function_in()
''' not true after 60.0 seconds
2025-02-11T08:39:31.406000Z TestFramework (INFO): Stopping nodes
2025-02-11T08:39:31.508000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_🏃_20250211_083825/abc_p2p_getavaaddr_4
2025-02-11T08:39:31.508000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_🏃_20250211_083825/abc_p2p_getavaaddr_4/test_framework.log
2025-02-11T08:39:31.508000Z TestFramework (ERROR): 
2025-02-11T08:39:31.508000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_🏃_20250211_083825/abc_p2p_getavaaddr_4' to consolidate all logs
2025-02-11T08:39:31.508000Z TestFramework (ERROR): 
2025-02-11T08:39:31.508000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2025-02-11T08:39:31.508000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2025-02-11T08:39:31.508000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: abc_p2p_getavaaddr.py

Failed tests logs:

====== Bitcoin ABC functional tests: abc_p2p_getavaaddr.py ======

------- Stdout: -------
2025-02-11T08:38:38.445000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_🏃_20250211_083835/abc_p2p_getavaaddr_4
2025-02-11T08:39:46.322000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
        def test_function():
            if check_connected:
                assert self.is_connected
            return test_function_in()
'''
2025-02-11T08:39:46.322000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 149, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 139, in _run_test_internal
    self.run_test()
  File "/work/test/functional/abc_p2p_getavaaddr.py", line 554, in run_test
    self.getavaaddr_interval_test()
  File "/work/test/functional/abc_p2p_getavaaddr.py", line 192, in getavaaddr_interval_test
    requester.wait_until(requester.addr_received)
  File "/work/test/functional/test_framework/p2p.py", line 582, in wait_until
    wait_until_helper(
  File "/work/test/functional/test_framework/util.py", line 296, in wait_until_helper
    raise AssertionError(
AssertionError: Predicate ''''
        def test_function():
            if check_connected:
                assert self.is_connected
            return test_function_in()
''' not true after 60.0 seconds
2025-02-11T08:39:46.374000Z TestFramework (INFO): Stopping nodes
2025-02-11T08:39:46.576000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_🏃_20250211_083835/abc_p2p_getavaaddr_4
2025-02-11T08:39:46.576000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_🏃_20250211_083835/abc_p2p_getavaaddr_4/test_framework.log
2025-02-11T08:39:46.576000Z TestFramework (ERROR): 
2025-02-11T08:39:46.576000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_🏃_20250211_083835/abc_p2p_getavaaddr_4' to consolidate all logs
2025-02-11T08:39:46.577000Z TestFramework (ERROR): 
2025-02-11T08:39:46.577000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2025-02-11T08:39:46.577000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2025-02-11T08:39:46.577000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: abc_p2p_getavaaddr.py

This revision is now accepted and ready to land.Tue, Feb 11, 14:33