test: check misbehavior more independently in p2p_filter.py #18726

pull robot-visions wants to merge 1 commits into bitcoin:master from robot-visions:p2p-filter changing 1 files +26 −5
  1. robot-visions commented at 6:37 PM on April 21, 2020: contributor

    This expands on #18672 in two ways:

    • Check positive cases (filterload accepted, filteradd accepted) in addition to the negative cases added in #18672
    • Address MarcoFalke 's suggestion to successfully load a filter before testing filteradd
  2. DrahtBot added the label Tests on Apr 21, 2020
  3. DrahtBot commented at 12:43 AM on April 22, 2020: member

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

  4. theStack commented at 11:29 AM on April 22, 2020: member

    Concept ACK -- nit: now with so many small tests for checking the size limits, you could put them all in a new method of the test?

  5. robot-visions force-pushed on Apr 22, 2020
  6. robot-visions commented at 5:39 PM on April 22, 2020: contributor

    Good idea, updated! And thanks for the review.

  7. in test/functional/p2p_filter.py:83 in edf2491c73 outdated
      83 | +        with self.nodes[0].assert_debug_log(['Misbehaving']):
      84 | +            filter_node.send_and_ping(msg_filterload(data=b'\xaa', nHashFuncs=MAX_BLOOM_HASH_FUNCS+1))
      85 | +
      86 | +        self.log.info('Check that filter with max hash functions is accepted')
      87 | +        with self.nodes[0].assert_debug_log([], unexpected_msgs=['Misbehaving']):
      88 | +            filter_node.send_and_ping(msg_filterload(data=b'\xaa', nHashFuncs=MAX_BLOOM_HASH_FUNCS, nTweak=0, nFlags=1))
    


    theStack commented at 12:43 PM on April 25, 2020:

    nit: explicitely setting nTweak and nFlags is not needed here


    robot-visions commented at 4:29 PM on April 25, 2020:

    Fixed, thanks!

  8. theStack approved
  9. test: check misbehavior more independently in p2p_filter.py cd543d9193
  10. robot-visions force-pushed on Apr 25, 2020
  11. MarcoFalke merged this on Apr 29, 2020
  12. MarcoFalke closed this on Apr 29, 2020

  13. robot-visions deleted the branch on Apr 29, 2020
  14. sidhujag referenced this in commit 44a764d706 on May 2, 2020
  15. Fabcien referenced this in commit a2a9c5790d on Jan 28, 2021
  16. DrahtBot locked this on Feb 15, 2022

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-14 21:14 UTC

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