sync_blocks cleanup #9136

pull ryanofsky wants to merge 3 commits into bitcoin:master from ryanofsky:sync-clean changing 1 files +14 −7
  1. ryanofsky commented at 9:09 PM on November 11, 2016: member

    This PR is a followup to #9058. It adds more detail to sync_block exceptions and fixes the buggy sync_blocks timeout implementation.

  2. fanquake added the label Tests on Nov 12, 2016
  3. morcos commented at 4:23 PM on November 14, 2016: member

    tested ACK

  4. MarcoFalke commented at 4:38 PM on November 14, 2016: member

    Thanks!

    utACK 9683a332e8565be7399b17bf77b9fddd432d7a20

  5. [qa] Improve sync_blocks error messages. fd6bb700b7
  6. [qa] Fix sync_blocks timeout argument
    Motivation for this change is mainly to make sync_blocks behavior easier to
    understand. Behavior is unchanged in the normal case when there are only 2
    nodes in the rpc_connections set. When there are more than 2 nodes, the
    previous "timeout -= wait" statement wouldn't take into account time spent
    waiting for all nodes and as a result could lead to blocking for longer than
    the requested timeout.
    05e57ccd74
  7. [qa] Avoid 2 list comprehensions in sync_blocks 7943b13ab3
  8. in qa/rpc-tests/test_framework/util.py:None in 9683a332e8 outdated
     146 | +            raise AssertionError("Block sync failed, mismatched block hashes:{}".format(
     147 | +                                 "".join("\n  {!r}".format(tip) for tip in tips)))
     148 |          maxheight = max(heights)
     149 | -    raise AssertionError("Block sync failed with heights: {}".format(heights))
     150 | +        cur_time = time.time()
     151 | +    raise AssertionError("Block sync to height {} timed out{}:".format(
    


    MarcoFalke commented at 4:41 PM on November 14, 2016:

    µNit: I think you want the colon in front of the format specifier?


    ryanofsky commented at 5:05 PM on November 14, 2016:

    Thanks, fixed.

  9. ryanofsky force-pushed on Nov 14, 2016
  10. MarcoFalke merged this on Nov 14, 2016
  11. MarcoFalke closed this on Nov 14, 2016

  12. MarcoFalke referenced this in commit b422913346 on Nov 14, 2016
  13. codablock referenced this in commit 12883cfe4d on Jan 15, 2018
  14. andvgal referenced this in commit e548d42cbb on Jan 6, 2019
  15. CryptoCentric referenced this in commit fd0002fa42 on Feb 24, 2019
  16. MarcoFalke locked this on Sep 8, 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: 2026-04-25 00:15 UTC

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