Skip to content

[32.x] Backports - #36727

Merged
fanquake merged 14 commits into
bitcoin:32.xfrom
fanquake:more_32_backports
Nov 19, 2026
Merged

fanquake merged 14 commits into
bitcoin:32.xfrom
fanquake:more_32_backports

Conversation

@fanquake fanquake added this to the 32.2 milestone Nov 2, 2026
@DrahtBot

DrahtBot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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 instagibbs, willcl-ark

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

Ferdinando Ametrano added 2 commits November 5, 2026 11:11
PeerTxRelayer.assert_never_requested compares the hash of every request
received, an int, with its argument, and test_orphan_inherit_rejection
passed it hex strings. An int never equals a str, so these checks passed
whatever the node requested. Pass ints instead.

Two more changes let the checks see the requests they are about:

- Relay the parent from peer2 rather than peer1. Relaying it made the
  node request it from peer1, so the check that peer1 never requested
  the parent fails once it compares ints.
- Bump mocktime by TXREQUEST_TIME_SKIP before the peer1 and peer2
  checks. The node requests an orphan's missing parent after a delay,
  so without the bump the request has not been sent when they run.

Also correct the comment on why the parent is rejected: it exceeds the
maximum standard weight, and the node rejects it with tx-size.

To check each assertion can fail, the scenario was mutated in a scratch
copy so that the node does request the hash, and each call site was
evaluated with both the old and the new argument. The old one passed
every time, and the new one failed:
- parent not relayed: peer1 is asked for the parent, peer2 for the
  child's txid;
- child not relayed: peer2 is asked for the child's txid;
- child relayed from peer2: peer2 is asked for the child's wtxid;
- neither child nor grandchild relayed: peer3 is asked for the child's
  txid.
Without the mocktime bumps, the first two mutations pass with ints too.

Github-Pull: bitcoin#36406
Rebased-From: a3c4ad1
The requests it checks carry int hashes, so any other type never
matches and the check passes whatever the node requested.

Github-Pull: bitcoin#36406
Rebased-From: 5f22014
The connection that checks a transaction submitted over RPC is not
announced to a block-relay-only peer uses P2PTxInvStore, which negotiates
wtxidrelay. The node would therefore announce the transaction by its
wtxid, and the assertion looked for the txid, which cannot be in the
store for a transaction carrying a witness: it passed whether or not the
transaction was announced.

Assert on the wtxid instead. With the connection opened as
outbound-full-relay rather than block-relay-only, the old assertion still
passes and the new one fails.

Also open an outbound-full-relay connection and assert that the wtxid
was announced on it. The two assertions differ only by `not`, so if the
announcement or its id changes, the test fails instead of the absence
check passing silently.

Github-Pull: bitcoin#36405
Rebased-From: 22535b4
PSBTv2 is not very interesting for current GUI users, and defaulting to
it causes issues for existing users. To make this change minimal and
avoid touching strings, this commit, only changes the default back
instead of making the version configurable.

The external signer PSBT will still be version 2, and I've added an
explicit argument here to show that. This will break users who are using
HWI versions < 2.1.0.
(https://github.com/bitcoin-core/HWI/releases/tag/2.1.0)

Github-Pull: bitcoin#36539
Rebased-From: 23dcb03
The `stl_tree_node`, `list_node` and `unordered_node` class templates
only mimic the layout of the standard library's container nodes, so
that `sizeof` yields an estimate of the memory they use. Their fields
are never accessed.

Since llvm/llvm-project#237374, Clang 24 diagnoses these fields with
`-Wunused-private-field`.

This change drops the `private:` access specifiers. It does not affect
the size or alignment of the structs, as all their fields keep the same
access control, and it is consistent with `stl_shared_counter`.

Github-Pull: bitcoin#36869
Rebased-From: b9a6b0c
@fanquake

Copy link
Copy Markdown
Member Author

cc @instagibbs

Crypt-iQ and others added 5 commits November 18, 2026 16:25
MaybeDiscourageAndDisconnect calls DisconnectNode which creates a
CSubNet containing only the CNode's address. This will disconnect
every CNode with the same IP address. This is normally not a problem,
except for clearnet-over-tor. If a node has an honest clearnet-over-tor
inbound connection, the IP of the inbound peer will be the exit node's
IP address. If an attacker connects to the node through the same exit
node and sends an invalid message, they can cause every inbound peer
sharing the exit node's IP to get disconnect. Fix this by only
disconnecting the misbehaving CNode rather than every CNode sharing
the IP.

Github-Pull: bitcoin#36894
Rebased-From: d63068c
Otherwise, `ipc/stub.cpp` is compiled without the project-wide
build flags.

Github-Pull: bitcoin#36889
Rebased-From: 4ef05d6
Use of non-target directives is not recommended. As of CMake 4.5.0, it
triggers `-Wnon-target-directive` warnings.

Github-Pull: bitcoin#36889
Rebased-From: 460f877
The module is superseded by CMake's `-Wnon-target-directive` warnings,
which are enabled when using the "dev-mode" preset.

Github-Pull: bitcoin#36889
Rebased-From: 435d5b2
@instagibbs

Copy link
Copy Markdown
Member

clACK a34fe8f

@willcl-ark

Copy link
Copy Markdown
Member

I think #36848 can be dropped from the description now.

@fanquake
fanquake marked this pull request as ready for review November 18, 2026 16:33

@willcl-ark willcl-ark left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK a34fe8f

LGTM now.

@fanquake
fanquake merged commit 8c09122 into bitcoin:32.x Nov 19, 2026
57 of 58 checks passed
@fanquake
fanquake deleted the more_32_backports branch November 19, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants