Page MenuHomePhabricator

Bugfix: RPC/blockchain: pruneblockchain: Return the height of the actual last pruned block
ClosedPublic

Authored by PiRK on Tue, Mar 4, 08:56.

Details

Summary

From 0.14 (2017 Mar) until before 0.19 (2019 Nov), the height of the last
block pruned was returned, subject to a bug if there were blocks left unpruned
due to sharing files with later blocks.

In #15991, this was "fixed" to the current implementation, introducing a new
bug: now, it returns the first *unpruned* block.

Since the user provides the parameter as a block to include in pruning, it
makes more sense to fix the behaviour to match the documentation.

This is a backport of core#24629

Depends on D17743

Test Plan

ninja all check check-functional-extended

Event Timeline

PiRK requested review of this revision.Tue, Mar 4, 08:56

Failed tests logs:

====== Bitcoin ABC functional tests with the next upgrade activated: abc_p2p_avalanche_contender_voting.py ======

------- Stdout: -------
2025-03-04T09:13:30.083000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_🏃_20250304_091233/abc_p2p_avalanche_contender_voting_43
2025-03-04T09:13:39.627000Z 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_avalanche_contender_voting.py", line 215, in run_test
    assert local_winner_cid in polled_contenders
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
2025-03-04T09:13:39.678000Z TestFramework (INFO): Stopping nodes
2025-03-04T09:13:39.879000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_🏃_20250304_091233/abc_p2p_avalanche_contender_voting_43
2025-03-04T09:13:39.879000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_🏃_20250304_091233/abc_p2p_avalanche_contender_voting_43/test_framework.log
2025-03-04T09:13:39.879000Z TestFramework (ERROR): 
2025-03-04T09:13:39.879000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_🏃_20250304_091233/abc_p2p_avalanche_contender_voting_43' to consolidate all logs
2025-03-04T09:13:39.879000Z TestFramework (ERROR): 
2025-03-04T09:13:39.880000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2025-03-04T09:13:39.880000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2025-03-04T09:13:39.880000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests with the next upgrade activated: abc_p2p_avalanche_contender_voting.py

add a release note and rebase&

PiRK added a parent revision: D17743: Bump version to 0.30.13.
This revision is now accepted and ready to land.Tue, Mar 4, 09:43