-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relax GUI freezes during IBD (when using wallets) #97
Conversation
I can't reproduce GUI freezes in the Send dialog during IBD (macOS 10.15.6, fresh data dir and fresh empty wallet on mainnet), but the change looks reasonable to me. |
@Sjors: I think you need to be at a height where blocks require more CPU cycles to verify. |
I see, in that case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review ACK 0d9d2a1. Clever fix. Didn't test but I remember I could reproduce the startup issue easily before by putting a sleep in estimateSmartFee.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review ACK 0d9d2a1.
@@ -134,7 +136,7 @@ void SendCoinsDialog::setClientModel(ClientModel *_clientModel) | |||
this->clientModel = _clientModel; | |||
|
|||
if (_clientModel) { | |||
connect(_clientModel, &ClientModel::numBlocksChanged, this, &SendCoinsDialog::updateSmartFeeLabel); | |||
connect(_clientModel, &ClientModel::numBlocksChanged, this, &SendCoinsDialog::updateNumberOfBlocks); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, could connect to lambda to avoid changes in header file:
connect(_clientModel, &ClientModel::numBlocksChanged, [this](int, const QDateTime&, double, bool, SynchronizationState sync_state) {
if (sync_state == SynchronizationState::POST_INIT) {
updateSmartFeeLabel();
}
});
Concept ACK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 0d9d2a1, tested on Linux Mint 20 (x86_64) with QT_FATAL_WARNINGS=1
and -debug=qt
.
@@ -28,6 +28,8 @@ | |||
#include <wallet/fees.h> | |||
#include <wallet/wallet.h> | |||
|
|||
#include <validation.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: No reasons to create a separate group of headers.
@@ -98,6 +99,7 @@ private Q_SLOTS: | |||
void coinControlClipboardLowOutput(); | |||
void coinControlClipboardChange(); | |||
void updateFeeSectionControls(); | |||
void updateNumberOfBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, bool headers, SynchronizationState sync_state); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: updateNumberOfBlocks
slot name for an object that knows nothing about "number of blocks" looks a bit weird. But I cannot suggest a better name (
…allets) 0d9d2a1 Only update the updateSmartFeeLabel once in sync (Jonas Schnelli) Pull request description: Calling `updateSmartFeeLabel` and therefore `estimateSmartFee` is pointless during IBD. GUI freezes appear because `estimateSmartFee` competes with `processBlock` for the `m_cs_fee_estimator` lock leading to multiple seconds of blocking the GUI thread in `updateSmartFeeLabel`. ACKs for top commit: ryanofsky: Code review ACK 0d9d2a1. Clever fix. Didn't test but I remember I could reproduce the startup issue easily before by putting a sleep in estimateSmartFee. promag: Code review ACK 0d9d2a1. hebasto: ACK 0d9d2a1, tested on Linux Mint 20 (x86_64) with `QT_FATAL_WARNINGS=1` and `-debug=qt`. Tree-SHA512: 85ec2266f06ddd7b523e24d2a462f10ed965d5b4d479005263056f81b7fe49996e1568dafb84658af406e9202ed3bfa846d59c10bb951e0f97cee230e30fafd5
Summary: > Calling updateSmartFeeLabel and therefore estimateSmartFee is pointless during IBD. > > GUI freezes appear because estimateSmartFee competes with processBlock for the m_cs_fee_estimator lock leading to multiple seconds of blocking the GUI thread in updateSmartFeeLabel. This is a backport of [[bitcoin-core/gui#97 | core-gui#97]] Test Plan: `ninja && src/qt/bitcoin-qt` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D10516
Calling
updateSmartFeeLabel
and thereforeestimateSmartFee
is pointless during IBD.GUI freezes appear because
estimateSmartFee
competes withprocessBlock
for them_cs_fee_estimator
lock leading to multiple seconds of blocking the GUI thread inupdateSmartFeeLabel
.