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. robot-visions cross-referenced this on Apr 21, 2020 from issue test: add further BIP37 size limit checks to p2p_filter.py by theStack
  3. DrahtBot added the label Tests on Apr 21, 2020
  4. DrahtBot commented at 12:43 AM on April 22, 2020: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

  5. DrahtBot cross-referenced this on Apr 22, 2020 from issue test: enable opening partial p2p connections where useful by jonatack
  6. theStack commented at 11:29 AM on April 22, 2020: contributor

    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?

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

    Good idea, updated! And thanks for the review.

  9. 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!

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

  15. robot-visions deleted the branch on Apr 29, 2020
  16. sidhujag referenced this in commit 44a764d706 on May 2, 2020
  17. Fabcien referenced this in commit a2a9c5790d on Jan 28, 2021
  18. bitcoin 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-05-20 06:54 UTC