-
Notifications
You must be signed in to change notification settings - Fork 275
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
Enable changing the autoprune block space size in intro dialog #125
Conversation
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.
Concept ACK.
@@ -17,6 +17,7 @@ | |||
|
|||
#include <interfaces/node.h> | |||
#include <util/system.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.
It's unfortunate to include this just because of MIN_DISK_SPACE_FOR_BLOCK_FILES
.
Testing ACK 7e37329 on Windows 10.0.18363 Build 18363. Articulating how exactly the pruned storage works is a great UX move. Many users seem to think pruning only stores data relevant to them, not that its only storing a recent history of blocks. Can be quite a shock importing an old wallet that you believe has coins only to get a zero balance displayed. Just some minor nits that could be fixed along with this PR: "The wallet will also be stored in this directory" should be changed to "Wallets will also be stored in this directory" in the top dialogue. Users can / may have multiple wallets. Blockchain size is around ~350GB now, may want to update the 320GB text in the second last paragraph. |
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 7d40a48
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.
Tested ACK 7d40a48.
Could fix the following when setting an invalid prune target (big number or empty string):
Concept ACK |
@Bosch-0 Does rescanning a wallet with a pruned node that misses relevant blocks result in an incorrect balance? That sounds like a bug - it should just abort with missing blocks or so. |
Usually, we are trying to keep PRs focused :)
This number update is a part of the release process, e.g., bitcoin/bitcoin#20263. |
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.
Addressed @hebasto's comments. Ping @promag @ryanofsky @Bosch-0 for re-ACKing |
I haven't actually tested this but I don't think it does - will test this today. The only time an incorrect balance may be shown is when importing a wallet post-prune that has tx history older than the block history stored as far as I'm concerned. |
ACK ea79265, looks good. |
Which commit did you mean? |
I just re-tested the changes made since my first ACK, I did not review the code |
Is an update supposed to be pushed? My review was requested but there haven't been any changes since my last review #125 (review) |
7d40a48
to
28ec1b2
Compare
Ah, that's the problem: Forgot we have to push to a different repo to get PRs in /gui to update :/ Should be ready now |
28ec1b2
to
415fb2e
Compare
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 415fb2e. Changes since last review: mb/gib suffixes, constexpr QOverload expected_backup_days tweaks, new moveonly layout commit
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.
Tested ACK 415fb2e.
Stress-tested on Ubuntu 20.10 and Arch Linux. Synced a node on each machine with no issues. Ubuntu machine set to 6gb prune target, Arch machine set to 9gb prune target.
QOverload doesn't work in Qt 5.5 ... reverted that change |
415fb2e
to
a479be9
Compare
a479be9
to
415fb2e
Compare
master is bumped to Qt 5.9, so went back to QOverload... |
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.
tACK 415fb2e, tested on Debian Sid with Qt 5.15.2.
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.
@@ -508,9 +506,9 @@ int GuiMain(int argc, char* argv[]) | |||
/// 5. Now that settings and translations are available, ask user for data directory | |||
// User language is set up: pick a data directory | |||
bool did_show_intro = false; | |||
bool prune = false; // Intro dialog prune check box | |||
int64_t prune_MiB = 0; // Intro dialog prune configuration |
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.
style piconit: clang-format-diff.py
suggests
int64_t prune_MiB = 0; // Intro dialog prune configuration | |
int64_t prune_MiB = 0; // Intro dialog prune configuration |
<property name="text"> | ||
<string>Limit block chain storage to</string> | ||
</property> | ||
<property name="toolTip"> | ||
<string>Reverting this setting requires re-downloading the entire blockchain. It is faster to download the full chain first and prune it later. Disables some advanced features.</string> | ||
</property> |
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.
Qt Designer insists on changing properties order:
<property name="text"> | |
<string>Limit block chain storage to</string> | |
</property> | |
<property name="toolTip"> | |
<string>Reverting this setting requires re-downloading the entire blockchain. It is faster to download the full chain first and prune it later. Disables some advanced features.</string> | |
</property> | |
<property name="toolTip"> | |
<string>Reverting this setting requires re-downloading the entire blockchain. It is faster to download the full chain first and prune it later. Disables some advanced features.</string> | |
</property> | |
<property name="text"> | |
<string>Limit block chain storage to</string> | |
</property> |
@@ -139,17 +140,26 @@ Intro::Intro(QWidget *parent, int64_t blockchain_size_gb, int64_t chain_state_si | |||
); | |||
ui->lblExplanation2->setText(ui->lblExplanation2->text().arg(PACKAGE_NAME)); | |||
|
|||
const int min_prune_target_GB = std::ceil(MIN_DISK_SPACE_FOR_BLOCK_FILES / 1e9); |
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: why here and after not use
Lines 52 to 53 in fa2a5b8
/* One gigabyte (GB) in bytes */ | |
static constexpr uint64_t GB_BYTES{1000000000}; |
?
UpdatePruneLabels(ui->prune->isChecked()); | ||
|
||
connect(ui->prune, &QCheckBox::toggled, [this](bool prune_checked) { | ||
UpdatePruneLabels(prune_checked); | ||
UpdateFreeSpaceLabel(); | ||
}); | ||
connect(ui->pruneGB, QOverload<int>::of(&QSpinBox::valueChanged), [this](int prune_GB) { |
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.
The QOverload
helper class is required for C++11 code. Having C++17, the qOverload
should be used.
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.
IIRC qOverload function template does not work with Visual Studio 2017 due to implementation limitations, and I see that compiler mentioned in https://github.com/bitcoin-core/gui/blob/master/build_msvc/README.md .
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.
IIRC qOverload function template does not work with Visual Studio 2017 due to implementation limitations
Oh, I was not aware of it. I'd like to know more about this pitfall. Any proof/link/test is appreciated :)
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.
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.
Thanks! Since bitcoin/bitcoin#21811 is merged, it isn't a problem, is it?
Btw, could you look at #257?
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.
It seem so, yes. Maybe I should try building on some older GCC to make sure other compiler does not have similar limitations (though I doubt it).
I will take a look at 257 at some time.
case Qt::Unchecked: default: | ||
return 0; |
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.
case Qt::Unchecked: default: | |
return 0; | |
case Qt::Unchecked: | |
[[fallthrough]]; | |
default: | |
return 0; |
static constexpr uint64_t nPowTargetSpacing = 10 * 60; // from chainparams, which we don't have at this stage | ||
static constexpr uint32_t expected_block_data_size = 2250000; // includes undo data |
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.
style piconit: clang-format-diff.py
suggests
static constexpr uint64_t nPowTargetSpacing = 10 * 60; // from chainparams, which we don't have at this stage | |
static constexpr uint32_t expected_block_data_size = 2250000; // includes undo data | |
static constexpr uint64_t nPowTargetSpacing = 10 * 60; // from chainparams, which we don't have at this stage | |
static constexpr uint32_t expected_block_data_size = 2250000; // includes undo data |
@@ -36,6 +36,7 @@ class Intro : public QDialog | |||
|
|||
QString getDataDirectory(); | |||
void setDataDirectory(const QString &dataDir); | |||
int64_t getPruneMiB() const; |
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.
Could be private?
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 415fb2e, my unresolved comments are not blockers, and they could be resolved in follow ups.
…… … size in intro dialog
Post-merge tACK. Great improvement! |
8b77133 qt: Replace disambiguation strings with translator comments (Hennadii Stepanov) Pull request description: Since bitcoin/bitcoin#21694 is merged, translator comments is the right way to pass context to translators. This PR fixes changes were made: - in #220 before bitcoin/bitcoin#21694 - in bitcoin/bitcoin#21694 on testing purpose - in #125 Closes #288. ACKs for top commit: jarolrod: ACK 8b77133 Tree-SHA512: 466ade35f4969a41fbf3196780b1ae9fa810bab5d2f09077f8631604636cc63b24a901c719f6b5797366d2aa307993d0aa419ce35200c8d0a741a3d81cad3e6b
See IRC discussion:
|
Moved from bitcoin/bitcoin#18728