refactor: Move `NodeId` declaration into `net_types.h` and fix includes in related modules #36807

pull hebasto wants to merge 2 commits into bitcoin:master from hebasto:261108-nodeid changing 13 files +52 −21
  1. hebasto commented at 6:57 PM on November 8, 2026: member

    Two identical declarations of NodeId make it ambiguous for static analysis tools such as IWYU which header should provide the symbol. Move the declaration into net_types.h.

    The second commit fixes the #includes of the net, net_types and node/eviction modules, which the first commit touched, and adds the headers that other files previously received transitively from them.

    A prerequisite for #36808.

  2. DrahtBot added the label Refactoring on Nov 8, 2026
  3. DrahtBot commented at 6:58 PM on November 8, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK maflcko, sedited
    Stale ACK jpk68

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #36808 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36808.svg"></sub> (iwyu: Fix warnings in src/test/fuzz and treat them as errors by hebasto)
    • #36114 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36114.svg"></sub> (wallet: harden external signer psbt processing, revamp mock by Sjors)
    • #35671 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35671.svg"></sub> (mining: add TxCollection to bandwidth-efficiently validate external block templates by Sjors)
    • #35600 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35600.svg"></sub> (net: prevent duplication manual connections (take 2) by willcl-ark)

    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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. hebasto removed the label Refactoring on Nov 8, 2026
  5. DrahtBot added the label Refactoring on Nov 8, 2026
  6. jpk68 commented at 7:27 PM on November 8, 2026: contributor

    ACK 144b4abf6a877d0ddab54fef823b4119aede7969

  7. DrahtBot added the label CI failed on Nov 8, 2026
  8. DrahtBot removed the label CI failed on Nov 8, 2026
  9. hebasto force-pushed on Nov 10, 2026
  10. hebasto force-pushed on Nov 10, 2026
  11. hebasto commented at 4:42 PM on November 10, 2026: member

    Rebased.

  12. in src/node/node_id.h:11 in 756eba946b
       6 | +#define BITCOIN_NODE_NODE_ID_H
       7 | +
       8 | +#include <cstdint>
       9 | +
      10 | +/** Identifier of a peer connection. */
      11 | +typedef int64_t NodeId;
    


    maflcko commented at 4:57 PM on November 10, 2026:

    Why not in src/net_types.h and why not using NodeId = int64_t;, and why not the shorter comment /// Identifier of a peer connection.


    hebasto commented at 7:18 PM on November 10, 2026:

    Thanks! Reworked.

  13. hebasto force-pushed on Nov 10, 2026
  14. hebasto force-pushed on Nov 10, 2026
  15. DrahtBot added the label CI failed on Nov 10, 2026
  16. hebasto renamed this:
    refactor: Introduce `node/node_id.h` header and fix includes in related modules
    refactor: Move `NodeId` declaration into `net_types.h` and fix includes in related modules
    on Nov 10, 2026
  17. refactor: Move `NodeId` declaration into `net_types.h`
    Two identical declarations of `NodeId` make it ambiguous for static
    tools such as IWYU which header should provide the symbol. Move the
    declaration into `net_types.h`.
    f58f08c565
  18. refactor: Fix includes in `net`, `net_types` and `node/eviction` modules
    The changes in other files add headers that were previously included
    transitively.
    541a000542
  19. hebasto force-pushed on Nov 10, 2026
  20. DrahtBot removed the label CI failed on Nov 10, 2026
  21. maflcko commented at 11:23 AM on November 11, 2026: member

    review ACK 541a000542d6bafb783e080ba427424e96233c4c 🍨

    <details><summary>Show signature</summary>

    Signature:

    untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
    RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
    trusted comment: review ACK 541a000542d6bafb783e080ba427424e96233c4c 🍨
    z9pqPYhJjpt1h0ku48dRUL3+2uRvEvUO/YyYO3f58RTgse1/uhXdruQRrRaQBsc36QzB59ITPOC96YJ2oCVvCA==
    

    </details>

  22. sedited approved
  23. sedited commented at 10:02 AM on November 12, 2026: contributor

    ACK 541a000542d6bafb783e080ba427424e96233c4c

  24. sedited merged this on Nov 12, 2026
  25. sedited closed this on Nov 12, 2026

  26. hebasto deleted the branch on Nov 12, 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-11-30 03:50 UTC

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