Skip to content

Conversation

@fanquake fanquake added this to the 25.1 milestone Sep 15, 2023
@DrahtBot
Copy link
Contributor

DrahtBot commented Sep 15, 2023

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

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK hebasto, dergoegge, willcl-ark

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@maflcko
Copy link
Member

maflcko commented Sep 21, 2023

unrelated: Looks like tsan seems to be starting to fail some time within the last two weeks.

sipa and others added 8 commits October 2, 2023 13:09
The legacy wallet allowed to import any raw script, without checking if
it was valid or not. Appending it to the watch-only set.

This causes a crash in the migration process because we are only
expecting to find valid scripts inside the legacy spkm.

These stored scripts internally map to `ISMINE_NO` (same as if they
weren't stored at all..).

So we need to check for these special case, and take into account that
the legacy spkm could be storing invalid not watched scripts.

Which, in code words, means IsMineInner() returning IsMineResult::INVALID
for them.

Github-Pull: bitcoin#28125
Rebased-From: 1de8a23
The migration process must skip any invalid script inside the legacy
spkm and all the addressbook records linked to them.

These scripts are not being watched by the current wallet, nor should
be watched by the migrated one.

IsMine() returns ISMINE_NO for them.

Github-Pull: bitcoin#28125
Rebased-From: 8e7e3e6
This reduces chances of having old estimates in fee_estimates.dat.

Github-Pull: bitcoin#27622
Rebased-From: 5b886f2
Old fee estimates could cause transactions to become stuck in the
mempool. This commit prevents the node from using stale estimates
from an old file.

Github-Pull: bitcoin#27622
Rebased-From: 3eb241a
If -acceptstalefeeestimates option is passed stale fee estimates can now
be read when operating in regtest environments.

Additionally, this commit updates all declarations of the CBlockPolicyEstimator
class to include a the second constructor variable.

Github-Pull: bitcoin#27622
Rebased-From: cf219f2
This commit adds tests to ensure that old fee_estimates.dat files
are not read and that fee_estimates are periodically flushed to the
fee_estimates.dat file.

Additionaly it tests the -regtestonly option -acceptstalefeeestimates.

Github-Pull: bitcoin#27622
Rebased-From: d2b39e0
MarkConflicted calculates conflict confirmations incorrectly when both
the last block processed height and the conflicting height are negative
(i.e. uninitialized). If either are negative, we should not be marking
conflicts and should exit early.

Github-Pull: bitcoin#28542
Rebased-From: 4660fc8
Loading a wallet with conflicts without a chain (e.g. wallet tool and
migration) would previously result in an assertion due to -1 being both
a valid number of conflict confirmations, and the indicator that that
member has not been set yet.

Github-Pull: bitcoin#28542
Rebased-From: 782701c
@fanquake
Copy link
Member Author

fanquake commented Oct 2, 2023

Added #28542. Slight diff in the tests to account for changes to send().

@fanquake fanquake marked this pull request as ready for review October 2, 2023 16:06
@fanquake
Copy link
Member Author

fanquake commented Oct 2, 2023

This will hopefully have 1 or 2 additional changes added (see milestone/labels), but marking as ready for review.

Copy link
Member

@dergoegge dergoegge left a comment

Choose a reason for hiding this comment

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

ACK a668394

Copy link
Member

@willcl-ark willcl-ark left a comment

Choose a reason for hiding this comment

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

ACK a668394

Verified the diffs between each patch and its Rebased-From patch

@hebasto
Copy link
Member

hebasto commented Oct 3, 2023

Suggesting to add bitcoin-core/gui#751

furszy added 2 commits October 3, 2023 15:58
As the 'QMenuBar' is created without a parent window in MacOS, the
app crashes when the user presses the shutdown button and, right
after it, triggers any action in the menu bar.

This happens because the QMenuBar is manually deleted in the
BitcoinGUI destructor but the events attached to it children
actions are not disconnected, so QActions events such us the
'QMenu::aboutToShow' could try to access null pointers.

Instead of guarding every single QAction pointer inside the
QMenu::aboutToShow slot, or manually disconnecting all
registered events in the destructor, we can check if a
shutdown was requested and discard the event.

The 'node' field is a ref whose memory is held by the
main application class, so it is safe to use here. Events
are disconnected prior destructing the main application object.

Furthermore, the 'MacDockIconHandler::dockIconClicked' signal
can make the app crash during shutdown for the very same
reason. The 'show()' call triggers the 'QApplication::focusWindowChanged'
event, which is connected to the 'minimize_action' QAction,
which is also part of the app menu bar, which could no longer exist.

Github-Pull: gui#751
Rebased-From: e14cc8f
By moving the appMenuBar destruction responsibility to the QT
framework, we ensure the disconnection of the submenus signals
prior to the destruction of the main app window.

The standalone menu bar may have served a purpose in earlier
versions when it didn't contain actions that directly open
specific screens within the main application window. However,
at present, all the actions within the appMenuBar lead to the
opening of screens within the main app window. So, the absence
of a main app window makes these actions essentially pointless.

Github-Pull: gui#751
Rebased-From: bae209e
@fanquake
Copy link
Member Author

fanquake commented Oct 3, 2023

Suggesting to add bitcoin-core/gui#751

ok

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

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

When backporting #28452 locally, I've got the following diff with this PR:

--- a/src/net.cpp
+++ b/src/net.cpp
@@ -35,6 +35,7 @@
 #include <util/threadinterrupt.h>
 #include <util/trace.h>
 #include <util/translation.h>
+#include <util/vector.h>
 
 #ifdef WIN32
 #include <string.h>

@fanquake
Copy link
Member Author

fanquake commented Oct 3, 2023

I've got the following diff with this PR:

Yea, because it's not used in that file in this branch.

fanquake added a commit to bitcoin-core/gui that referenced this pull request Oct 3, 2023
fac054d ci: Print Linux kernel info (MarcoFalke)

Pull request description:

  Required to debug issues like bitcoin/bitcoin#28487 (comment). For example:

  ```
  FATAL: ThreadSanitizer: unexpected memory mapping 0x57cf8f031000-0x57cf8f173000

ACKs for top commit:
  hebasto:
    ACK fac054d

Tree-SHA512: 7eb158e52daffe5cbcdfa3ed1efb45e1930b80a2672558fe400c8d72ce59a8cbeb02296dfc2032721d511410885a1f057672fe8086ba1c72a494aef541bf7eb4
Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

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

ACK f31899d, I've applied all backports locally and got a zero diff with this PR branch.

Introduces and uses a HTTPRequestTracker class to keep track of
how many HTTP requests are currently active, so we don't stop the
server before they're all handled.

This has two purposes:
1. In a next commit, allows us to untrack all requests associated
with a connection without running into lifetime issues of the
connection living longer than the request
(see bitcoin#27909 (comment))

2. Improve encapsulation by making the mutex and cv internal members,
and exposing just the WaitUntilEmpty() method that can be safely
used.

Github-Pull: bitcoin#28551
Rebased-From: 41f9027
There is no significant benefit in logging the request count instead
of the connection count. Reduces amount of code and computational
complexity.

Github-Pull: bitcoin#28551
Rebased-From: 084d037
It is possible that the client disconnects before the request is
handled. In those cases, evhttp_request_set_on_complete_cb is never
called, which means that on shutdown the server we'll keep waiting
endlessly.

By adding evhttp_connection_set_closecb, libevent automatically
cleans up those dead connections at latest when we shutdown, and
depending on the libevent version already at the moment of remote
client disconnect. In both cases, the bug is fixed.

Github-Pull: bitcoin#28551
Rebased-From: 68f23f5
@fanquake
Copy link
Member Author

fanquake commented Oct 4, 2023

This is ready for final review.

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

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

re-ACK 45a5fcb, only #28551 has been backported with since my recent review.

Copy link
Member

@dergoegge dergoegge left a comment

Choose a reason for hiding this comment

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

reACK 45a5fcb

Copy link
Member

@willcl-ark willcl-ark left a comment

Choose a reason for hiding this comment

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

reACK 45a5fcb

build info
Key Value
Hostname ubuntu
Arch x86_64
Kernel 6.2.0-32-generic
System Linux
CC Ubuntu clang version 16.0.6
CXX Ubuntu clang version 16.0.6
Configure ./configure --with-incompatible-bdb --without-miniupnpc --without-natpmp --disable-bench --without-gui --enable-debug CXX=/usr/lib/ccache/clang++ CC=/usr/lib/ccache/clang --disable-shared --with-pic --enable-benchmark=no --enable-module-recovery --disable-module-ecdh --no-create --no-recursion ./config.status ./config.status src/config/bitcoin-config.h

@fanquake fanquake merged commit 9f8d501 into bitcoin:25.x Oct 4, 2023
@fanquake fanquake deleted the backport_28452 branch October 4, 2023 10:23
@bitcoin bitcoin locked and limited conversation to collaborators Oct 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.