Backports:
- #29855
- #30357
- #30394 (modified test commit)
- https://github.com/bitcoin/bitcoin/pull/30435
Backports:
A common issue that our fuzzers keep finding is that outpoints don't
exist in the non witness utxos. Instead of trying to track this down and
checking in various individual places, do the check early during
deserialization.
Github-Pull: #29855
Rebased-From: 9e13ccc50eec9d2efe0f472e6d50dc822df70d84
Initiating an outbound network connection currently involves the
following steps after the socket connection is established (see
`CConnman::OpenNetworkConnection` method):
1. set up node state
2. queue VERSION message
3. add new node to vector `m_nodes`
If we connect to ourself, it can happen that the sent VERSION message
(step 2) is received and processed locally *before* the node object
is added to the connection manager's `m_nodes` vector (step 3). In this
case, the self-connect remains undiscovered, as the detection doesn't
find the outbound peer in `m_nodes` yet (see `CConnman::CheckIncomingNonce`).
Fix this by swapping the order of 2. and 3., by taking the `PushNodeVersion`
call out of `InitializeNode` and doing that in the `SendMessages` method
instead, which is only called for `CNode` instances in `m_nodes`.
Thanks go to vasild, mzumsande, dergoegge and sipa for suggestions on
how to fix this.
Github-Pull: #30394
Rebased-From: 66673f1c1302c986e344c7f44bb0b352213d5dc8
Now that the queueing of the VERSION messages has been moved out of
`InitializeNode`, there is no need to pass a mutable `CNode` reference any
more. With a const reference, trying to send messages in this method would
lead to a compile-time error, e.g.:
----------------------------------------------------------------------------------------------------------------------------------
...
net_processing.cpp: In member function ‘virtual void {anonymous}::PeerManagerImpl::InitializeNode(const CNode&, ServiceFlags)’:
net_processing.cpp:1683:21: error: binding reference of type ‘CNode&’ to ‘const CNode’ discards qualifiers
1683 | PushNodeVersion(node, *peer);
...
----------------------------------------------------------------------------------------------------------------------------------
Github-Pull: #30394
Rebased-From: 0dbcd4c14855fe2cba15a32245572b693dc18c4e
This reverts commit 9ec2c53701a391629b55aeb2804e8060d2c453a4 with
a tiny change included (identation of the wait_until call).
Github-Pull: #30394
Rebased-From: 16bd283b3ad05daa41259a062aee0fc05b463fa6
This avoids situations during a reindex in which shutdown
doesn't finish since SyncWithValidationInterfaceQueue is
called by the load block thread when the scheduler is already stopped.
Github-Pull: #30435
Rebased-From: 5fd48360198d2ac49e43b24cc1469557b03567b8
Fix cases of calls to `FillPSBT` returning `complete=true` when it's not
the case.
This can happen when some inputs have been signed but the transaction is
subsequently modified, e.g. in the context of PayJoins.
Also fixes a related bug where a finalized hex string is attempted to be
added during `walletprocesspsbt` but a CHECK_NONFATAL causes an abort.
Reported in #30077.
Github-Pull: #30357
Rebased-From: 39cea21ec51b9838669c38fefa14f25c36ae7096
This test checks that we can successfully process PSBTs and opt out of
finalization.
Previously trying to call `walletprocesspsbt` would attempt to
auto-finalize (as a convenience), and would not permit opt-out of
finalization, instead aborting via `CHECK_NONFATAL`.
Github-Pull: #30357
Rebased-From: 7e36dca657c66bc70b04d5b850e5a335aecfb902
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For detailed information about the code coverage, see the test coverage report.
See the guideline for information on the review process.
Type | Reviewers |
---|---|
ACK | stickies-v, willcl-ark |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
ACK 885c4b7bc65c294b4b2fac91392d23a37a1f6485 but #29855 is missing from release-notes.md
I verified that all backport commits are clean, except:
ACK 4f23c8636498f7e5adbe0264a0dc66a566c4b1b9
Checked all commits were backported cleanly and had a release note for their original PR.
I agree with stickies that carving out the relevant portion of the test for https://github.com/bitcoin/bitcoin/commit/ab422066527992d53c92bb482c6b993f089b2999 makes best sense for a backport.