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

Manually merged
hebasto merged 2 commits from 261108-nodeid into master 2026-11-12 10:12:57 +00:00 AGit
hebasto commented 2026-11-08 18:57:58 +00:00 (Migrated from github.com)

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 https://github.com/bitcoin/bitcoin/pull/36808.

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 `#include`s 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 https://github.com/bitcoin/bitcoin/pull/36808.
DrahtBot commented 2026-11-08 18:58:07 +00:00 (Migrated from github.com)

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

External sites

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 <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #36808 (iwyu: Fix warnings in src/test/fuzz and treat them as errors by hebasto)
  • #36114 (wallet: harden external signer psbt processing, revamp mock by Sjors)
  • #35671 (mining: add TxCollection to bandwidth-efficiently validate external block templates by Sjors)
  • #35600 (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.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36807 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36807.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36807#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | ACK | [maflcko](https://github.com/bitcoin/bitcoin/pull/36807#issuecomment-6794495415), [sedited](https://github.com/bitcoin/bitcoin/pull/36807#pullrequestreview-5872496563) | | Stale ACK | [jpk68](https://github.com/bitcoin/bitcoin/pull/36807#issuecomment-6726026974) | 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](https://github.com/bitcoin/bitcoin/pull/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](https://github.com/bitcoin/bitcoin/pull/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](https://github.com/bitcoin/bitcoin/pull/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](https://github.com/bitcoin/bitcoin/pull/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-->
First-time contributor

No verified findings are available from this review.

Review coverage was incomplete.


Reviewed: 541a000542d6 · Review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:7eebed8027c96ac27bcd79eeb7a88e35799cd96eb8fbacf34d3257986a959f64:cdc1bd61213c9363d5bb4c7b7ee073ccfd6fecdafbb2c4c18d9d9e031a6afcf8 --> <!-- ralph-base:9320233a3d589eec0a25695eebe92bd35e0814c4 --> <!-- ralph-head:541a000542d6bafb783e080ba427424e96233c4c --> <!-- ralph-case:67b8683f718374f46284dcda18fb6cb953108d539f74a914dd783030a2ec15c1 --> No verified findings are available from this review. Review coverage was incomplete. <!-- Review tier: standard --> --- Reviewed: [`541a000542d6`](<https://git.fish.foo/bitcoin/bitcoin/commit/541a000542d6bafb783e080ba427424e96233c4c>) · [Review report](<https://review.fish.foo/report/36807-541a000542d6bafb783e080ba427424e96233c4c-2483-6.html>) · [Previous reports](<https://review.fish.foo/traces/36807/>) [permalink](<https://review.fish.foo/report/36807-541a000542d6bafb783e080ba427424e96233c4c-2483-6.html>)
jpk68 commented 2026-11-08 19:27:12 +00:00 (Migrated from github.com)
ACK 144b4abf6a877d0ddab54fef823b4119aede7969
hebasto commented 2026-11-10 16:42:40 +00:00 (Migrated from github.com)

Rebased.

Rebased.
maflcko (Migrated from github.com) reviewed 2026-11-10 16:57:51 +00:00
maflcko (Migrated from github.com) commented 2026-11-10 16:57:52 +00:00

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.

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 (Migrated from github.com) reviewed 2026-11-10 19:18:58 +00:00
hebasto (Migrated from github.com) commented 2026-11-10 19:18:58 +00:00

Thanks! Reworked.

Thanks! Reworked.
maflcko commented 2026-11-11 11:23:09 +00:00 (Migrated from github.com)

review ACK 541a000542 🍨

Show signature

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==
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>
sedited (Migrated from github.com) approved these changes 2026-11-12 10:02:12 +00:00
sedited (Migrated from github.com) left a comment
ACK 541a000542d6bafb783e080ba427424e96233c4c
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!36807
No description provided.