test: use test_framework.p2p `P2P_SERVICES` constant in functional tests #23036

pull jonatack wants to merge 1 commits into bitcoin:master from jonatack:use-test_framework-P2P_SERVICES-in-functional-tests changing 6 files +35 −28
  1. jonatack commented at 2:53 PM on September 19, 2021: member

    P2P_SERVICES is defined in test/functional/test_framework/p2p.py, so we can use it as a single definition for our functional tests. It may also be a tiny bit more efficient to use the constant rather than calculating NODE_NETWORK | NODE_WITNESS every time we need it in the tests.

  2. test: use test_framework.p2p P2P_SERVICES in functional tests b69a106bcd
  3. DrahtBot commented at 3:20 PM on September 19, 2021: member

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #23035 (p2p, rpc, test: expose tried and refcount in getnodeaddresses, update/improve tests by jonatack)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  4. klementtan approved
  5. klementtan commented at 3:58 PM on September 19, 2021: contributor

    crACK b69a106bcd8ddefdb810df6ebb3625c430197e04

    • Verified that refactoring NODE_NETWORK | NODE_WITNESS to P2P_SERVICES and reordering of imports is the only change.
    • Also verified that all instances of NODE_NETWORK | NODE_WITNESS have been refactored with git grep NODE_WITNESS.
  6. DrahtBot added the label Tests on Sep 19, 2021
  7. laanwj commented at 12:27 PM on September 21, 2021: member

    Code review ACK b69a106bcd8ddefdb810df6ebb3625c430197e04 I think it's good to use a constant for the default service flags, if there is no reason to specifically deviate from them.

    It may also be a tiny bit more efficient to use the constant

    Bitwise OR is one of the most efficient operations to perform on a CPU. Also, none of these are in inner loops. I strongly doubt this figures into test run time in any noticeable way :smile:

  8. jonatack commented at 12:53 PM on September 21, 2021: member

    (Thanks!) Yes, that definitely was not the main argument for it :)

  9. fanquake approved
  10. fanquake commented at 8:36 AM on September 23, 2021: member

    ACK b69a106bcd8ddefdb810df6ebb3625c430197e04 - didn't look at the formatting changes.

  11. fanquake merged this on Sep 23, 2021
  12. fanquake closed this on Sep 23, 2021

  13. jonatack deleted the branch on Sep 23, 2021
  14. sidhujag referenced this in commit b3fa4e1f79 on Sep 24, 2021
  15. DrahtBot locked this on Oct 30, 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:13 UTC

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