test: remove unused variables in `p2p_invalid_block` #28412

pull brunoerg wants to merge 1 commits into bitcoin:master from brunoerg:2023-08-test-remove-unused-p2p-invalid-block changing 1 files +0 −2
  1. brunoerg commented at 12:12 PM on September 5, 2023: contributor

    No description provided.

  2. test: remove unused variables in `p2p_invalid_block` 3eb03803c4
  3. DrahtBot commented at 12:12 PM on September 5, 2023: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK stickies-v

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. DrahtBot added the label Tests on Sep 5, 2023
  5. maflcko commented at 12:32 PM on September 5, 2023: member

    Shouldn't vulture be able to detect those with our setting of 100%?

  6. fanquake commented at 12:43 PM on September 5, 2023: member

    Shouldn't vulture be able to detect those with our setting of 100%?

    Yea, this seems to keep coming up. Looks like dropping the confidence level to 60% would at least produce some output (none of the code changed in this PR).

  7. maflcko commented at 12:46 PM on September 5, 2023: member

    IIRC dropping the confidence would lead to false positives, which we want to avoid.

  8. fanquake commented at 12:48 PM on September 5, 2023: member

    IIRC dropping the confidence would lead to false positives

    Yea, most of the output produced at 60 is that (or code we wouldn't want to remove). I guess having Vulture at 100 when it doesn't seem to work, means we could just remove it?

  9. brunoerg commented at 1:12 PM on September 5, 2023: contributor

    Shouldn't vulture be able to detect those with our setting of 100%?

    It should, but it doesn't work as expected. It doesn't detect scenarios like:

    abc = 1
    abc = 2
    call(abc)
    

    Even dropping confidence, it catches only some stuff from our test framework (false flag). E.g.:

    test/functional/p2p_invalid_block.py:32: unused method 'set_test_params' (60% confidence)
    test/functional/p2p_invalid_block.py:33: unused attribute 'num_nodes' (60% confidence)
    test/functional/p2p_invalid_block.py:34: unused attribute 'setup_clean_chain' (60% confidence)
    test/functional/p2p_invalid_block.py:35: unused attribute 'extra_args' (60% confidence)
    test/functional/p2p_invalid_block.py:37: unused method 'run_test' (60% confidence)
    
  10. maflcko commented at 1:28 PM on September 5, 2023: member

    Maybe report it upstream?

  11. brunoerg commented at 2:25 PM on September 5, 2023: contributor

    Maybe report it upstream?

    Seems good. https://github.com/jendrikseipp/vulture/issues/315 is useful for us as well.

  12. stickies-v approved
  13. stickies-v commented at 2:37 PM on September 7, 2023: contributor

    ACK 3eb03803c4111d09c63550a6a6c09afbe3430bf6

    I was confused by the PR and commit title though as we're not removing any variables, and they are used. I'd just call it "unused code".

  14. fanquake merged this on Sep 7, 2023
  15. fanquake closed this on Sep 7, 2023

  16. Frank-GER referenced this in commit 9c1c27b7e6 on Sep 8, 2023
  17. bitcoin locked this on Sep 6, 2024

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-02 03:13 UTC

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