Bugfix: fix pruneblockchain returned prune height #15991

pull jonasschnelli wants to merge 2 commits into bitcoin:master from jonasschnelli:2019/05/pruning_test changing 2 files +9 −17
  1. jonasschnelli commented at 3:38 pm on May 9, 2019: contributor

    The help of pruneblockchain tells us that the return value is Height of the last block pruned.,… but the implementation naively returns the provided input height and therefore not respecting that pruning can’t be done on all possible blockheight due to the fact that we only prune complete blockfiles (which combine multiple blocks).

    This fixes the return value to actually return the correct prune height.

  2. jonasschnelli added the label RPC/REST/ZMQ on May 9, 2019
  3. jonasschnelli added the label Needs backport on May 9, 2019
  4. jonasschnelli added this to the milestone 0.18.1 on May 9, 2019
  5. promag approved
  6. promag commented at 5:15 pm on May 9, 2019: member

    utACK 2b3849d.

    Please see 87af0b4229 in https://github.com/promag/bitcoin/tree/pr15991, where the highest pruned block is returned from FindFilesToPruneManual.

    Edit: on a second thought your code is more suitable for backport.

  7. promag commented at 9:58 pm on May 12, 2019: member

    Tested ACK 2b3849d, but should fix the extended test test/functional/feature_pruning.py, which gives the following error:

     02019-05-12T21:49:52.136000Z TestFramework (ERROR): Assertion failed
     1Traceback (most recent call last):
     2  File "/Users/joao/Projects/bitcoin/test/functional/test_framework/test_framework.py", line 175, in main
     3    self.run_test()
     4  File "./test/functional/feature_pruning.py", line 462, in run_test
     5    self.manual_test(3, use_timestamp=False)
     6  File "./test/functional/feature_pruning.py", line 312, in manual_test
     7    prune(100)
     8  File "./test/functional/feature_pruning.py", line 289, in prune
     9    assert_equal(ret, expected_ret)
    10  File "/Users/joao/Projects/bitcoin/test/functional/test_framework/util.py", line 39, in assert_equal
    11    raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
    12AssertionError: not(0 == 100)
    

    With this change I think it makes sense to compare the result with node.getblockchaininfo()['prunedheight'].

  8. MarcoFalke commented at 10:38 pm on May 12, 2019: member
    utACK 2b3849dcd2f8678f03d738c618828602bd249d1b @promag Thanks for running the test ;)
  9. MarcoFalke closed this on May 15, 2019

  10. MarcoFalke reopened this on May 15, 2019

  11. MarcoFalke commented at 11:44 am on May 17, 2019: member
  12. MarcoFalke commented at 7:24 pm on May 23, 2019: member
    @jonasschnelli are you still working on this?
  13. jonasschnelli commented at 5:10 pm on May 24, 2019: contributor
    I haven’t started working on the prune test fix… I have plans to do this the next week. But happy to pull in a commit if someone else wants to fix it.
  14. promag commented at 10:18 am on May 25, 2019: member
    @jonasschnelli promag@22ff1bbe7 is an option, if accepted should be squashed.
  15. jonasschnelli force-pushed on May 29, 2019
  16. jonasschnelli commented at 7:12 am on May 29, 2019: contributor
    Added 22ff1bbe71c4acc1fd4303399abbb3a52f436667 from @promag repo (test fix). I don’t think it needs squashing.
  17. MarcoFalke commented at 11:26 am on May 29, 2019: member
    @jonasschnelli Are you sure you pushed the correct branch?
  18. MarcoFalke commented at 10:18 am on June 5, 2019: member
    @jonasschnelli My previous ACK was 2b3849d, which is a small bugfix. The current pull request adds a config option, which does not qualify as a bugfix that should be backported.
  19. MarcoFalke commented at 10:19 am on June 5, 2019: member

    I don’t think it needs squashing.

    The test will fail otherwise, breaking git bisect.

  20. DrahtBot commented at 3:09 pm on June 7, 2019: member

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

    Conflicts

    No conflicts as of last run.

  21. Fix RPC/pruneblockchain returned prune height 97f517dd85
  22. fixup: Fix prunning test f402012ccf
  23. jonasschnelli force-pushed on Jun 11, 2019
  24. jonasschnelli commented at 8:22 am on June 11, 2019: contributor
    There was a rebase issue. Thanks, @MarcoFalke for reporting. Fixed.
  25. MarcoFalke commented at 9:10 am on June 11, 2019: member
    ACK f402012ccfc596d7d94851dabbf386c278ff5335
  26. jonasschnelli merged this on Jun 13, 2019
  27. jonasschnelli closed this on Jun 13, 2019

  28. jonasschnelli referenced this in commit 431d81b61c on Jun 13, 2019
  29. MarcoFalke removed the label Needs backport on Jun 13, 2019
  30. MarcoFalke referenced this in commit abd9a8fbb9 on Jun 13, 2019
  31. MarcoFalke referenced this in commit c6b07ee8de on Jun 13, 2019
  32. MarcoFalke referenced this in commit 775f0b7b76 on Jun 13, 2019
  33. sidhujag referenced this in commit 98ee6d76a3 on Jun 13, 2019
  34. MarcoFalke referenced this in commit c80a498ae5 on Jun 14, 2019
  35. MarcoFalke referenced this in commit 592016ba18 on Jun 14, 2019
  36. HashUnlimited referenced this in commit 68e3989082 on Aug 23, 2019
  37. HashUnlimited referenced this in commit 094a467bb1 on Aug 23, 2019
  38. Bushstar referenced this in commit 69b1963269 on Aug 24, 2019
  39. Bushstar referenced this in commit adcc1bb881 on Aug 24, 2019
  40. jasonbcox referenced this in commit 9ffd982fdb on Sep 8, 2020
  41. PastaPastaPasta referenced this in commit 70c4c85955 on Oct 28, 2021
  42. Munkybooty referenced this in commit 5f57aa55ea on Oct 29, 2021
  43. Munkybooty referenced this in commit 58c187bc9e on Oct 30, 2021
  44. Munkybooty referenced this in commit 0e388bfe12 on Nov 2, 2021
  45. Munkybooty referenced this in commit eded623e6d on Nov 4, 2021
  46. Munkybooty referenced this in commit fe895b17e4 on Nov 16, 2021
  47. Munkybooty referenced this in commit 34d1a742d4 on Nov 18, 2021
  48. DrahtBot locked this on Dec 16, 2021

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: 2024-11-23 09:12 UTC

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