test: Fix wait_for_getheaders() call in test_outbound_eviction_blocks_relay_only() #32823

pull pablomartin4btc wants to merge 2 commits into bitcoin:master from pablomartin4btc:test_p2p_outbound_eviction_block_relay_fix changing 1 files +15 −13
  1. pablomartin4btc commented at 5:24 PM on June 27, 2025: member

    This change avoids relying on tip_header.hash, which is None when the header is deserialized from hex during CBlockHeader() construction. Instead, tip_header.rehash() explicitly computes the hash, making the test behavior more robust.

    Using the explicit rehash() avoids depending on wait_for_getheaders() falling back to any received message, thus making the test more deterministic.

    This is a follow-up to #32742.

    Also, as noted in a previous review comment, "the hash field is wrong either way, simply due to being the wrong type (it is an optional hex string), as opposed to an optional int".


    The first commit intention is to improve clarity around the tests purpose, helping reviewers follow what's being verified and why. What started as a small comment during review of #32742 led me reviewing and try to improve most relevant tests comments for consistency and correctness.

  2. test: Clarify roles in outbound eviction comments
    Some ambiguous uses of "we" referring to either the node or the peer are replaced with clearer phrasing.
    
    Also rephrase some comments for consistency and readability.
    
    Applies to all relevant outbound eviction tests in p2p_eviction_logic.py.
    26598ed21e
  3. test: Use rehash() in outbound eviction block-relay
    Ensure that tip_header.rehash() is used instead of tip_header.hash, which is None when the header is deserialized from hex.
    
    This avoids depending on wait_for_getheaders() falling back to any received message, making the test more explicit and robust.
    ec004cdb86
  4. DrahtBot added the label Tests on Jun 27, 2025
  5. DrahtBot commented at 5:24 PM on June 27, 2025: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32823.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK theStack, yuvicc, danielabrozzoni, achow101

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

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  6. fanquake requested review from theStack on Jun 30, 2025
  7. theStack approved
  8. theStack commented at 10:30 PM on June 30, 2025: contributor

    lgtm ACK ec004cdb86e6471915e1033f390c76ee0428e415 :hash:

    The second commit is a test bugfix very similar to #32742 / dd8447f70faf6419b4617da3c1b57098e9cd66a6 and should be backported (fwiw, I checked all other wait_for_... calls with hash parameters in this test file and think we caught them all now). The other commit improves the code comments w.r.t. consistent peer/node naming and getting rid of the "we" phrasing, agree that this is clearer now.

  9. yuvicc commented at 4:52 AM on July 1, 2025: contributor

    ACK ec004cdb86e6471915e1033f390c76ee0428e415

    • some comments has been updated to maintain readability
    • update wait_for_getheader to use rehash() for robust testing
  10. danielabrozzoni commented at 12:26 PM on July 1, 2025: member

    ACK ec004cdb86e6471915e1033f390c76ee0428e415

    Code looks good to me, I like the rephrasing of the comments, the test is easier to follow now :)

  11. achow101 commented at 8:30 PM on July 2, 2025: member

    ACK ec004cdb86e6471915e1033f390c76ee0428e415

  12. achow101 merged this on Jul 2, 2025
  13. achow101 closed this on Jul 2, 2025

  14. fanquake referenced this in commit f82015ccfc on Jul 3, 2025
  15. fanquake referenced this in commit 3a57bfaaf9 on Jul 3, 2025
  16. fanquake commented at 11:16 AM on July 3, 2025: member

    Backported to 29.x in #32863.

  17. fanquake referenced this in commit 672c85cb1e on Jul 18, 2025
  18. glozow referenced this in commit ef380a454c on Jul 18, 2025
  19. stringintech referenced this in commit f19e7819e9 on Jul 19, 2025
  20. alexanderwiederin referenced this in commit 9997c3d993 on Jul 25, 2025
  21. alexanderwiederin referenced this in commit 8d6ebb9c4e on Jul 28, 2025
  22. alexanderwiederin referenced this in commit 533a4585b5 on Jul 28, 2025
  23. yuvicc referenced this in commit 22f55cf11d on Aug 26, 2025
  24. ajtowns referenced this in commit cbec6aba32 on Sep 4, 2025
  25. ajtowns referenced this in commit 27ea00ca39 on Sep 4, 2025
  26. bug-castercv502 referenced this in commit d4bd8a1259 on Sep 28, 2025
  27. stickies-v referenced this in commit a19c56cd7c on Nov 4, 2025
  28. morozow referenced this in commit 550ec6b193 on May 8, 2026
  29. morozow referenced this in commit aefb32ce50 on May 8, 2026
  30. morozow referenced this in commit 8214c3bc7c on May 8, 2026
  31. Kino1994 referenced this in commit 13d607134f on Jun 28, 2026
  32. BigcoinBGC referenced this in commit 2cc6be88bc on Jun 30, 2026
  33. bitcoin locked this on Jul 30, 2026

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-08-11 10:51 UTC

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