-
Notifications
You must be signed in to change notification settings - Fork 38.7k
[Qt] Add option to pause/resume block downloads #9502
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
Conversation
42882c6 to
abf0941
Compare
|
Isn't network toggle button usable in this case? If it is not, let's fix it instead... |
|
I extracted this from my SPV branch. Especially there, it is very useful to pause IBD and continue with SPV during a time where you don't want to use all available resources on verification. But also without SPV, I think this can be useful (pause IBD and not loose broadcast capabilities, fetch headers but not the blocks)... |
|
IMO it would be too confusing to be worth it without "SPV" mode, but probably should go in after the latter is. |
|
Isn't network toggle button usable in this case? If it is not, let's fix it instead...
Imo those are different features, but I agree that the GUI should not
"diverge" in regard to presenting features. The toggle network
functionality should be removed from the network icon and a proper
button should be put beside the new "Pause" button?
|
|
The "Pause" button won't be visible in normal cases. |
Yes. These are internally two completely different features. Expose to the users, these have similar effects.
Yes. The modal overlay is currently only accessible during IBD. Though, we could extend it to support a state where the chain is in-sync and show it when someone click on the network statusbar icon. |
kallewoof
left a comment
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.
utACK abf0941
src/net_processing.h
Outdated
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.
Typo: usefull (one L)
src/qt/clientmodel.h
Outdated
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: isAutorequestingBlocks (add ing). The setAutorequestBlocks below is fine as is, though.
|
Added 0.15 milestone |
|
Rebased. |
dd9f365 to
e2e86ec
Compare
src/net_processing.h
Outdated
|
|
||
| /** if disabled, blocks will not be requested automatically, usefull for low-resources-available mode */ | ||
| static const bool DEFAULT_AUTOMATIC_BLOCK_REQUESTS = true; | ||
| extern std::atomic<bool> fAutoRequestBlocks; |
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.
Instead of exporting this variable (whose definition is an implementation detail) from net_processing.h I'd prefer a setter/getter, e.g. SetAutoRequestBlocks(bool) GetAutoRequestBlocks()
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.
Agree. Will change...
src/qt/clientmodel.cpp
Outdated
| return GUIUtil::boostPathToQString(GetDataDir()); | ||
| } | ||
|
|
||
| bool ClientModel::isAutorequestBlocks() 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.
isAutorequestBlocks is a bit of a strange name; isAutoRequestingBlocks maybe?
|
When re-enabling AutoRequestBlocks, what 'kicks off' the block requesting process again? Setting the flag will make it request blocks the next time |
e2e86ec to
e952b67
Compare
|
Overhauled the PR and addresses @laanwj points. Also, I added the info "Blocks requested from peers" (blocks in flight). This may be important because pause will not result in disconnecting peers. Already requested blocks will be downloaded (and verified) in the "pause" state. If blocks are in flight and the pause has been triggered, there is now a special info label |
|
Well, I have to change my previous opinion. I think this can be useful. Concept ACK Will test soon. |
|
Needs rebase. |
|
ACK e952b67d294043d9758b37bf2be57a982b41c051 Code looks good. On the UI feature, two minor comments:
|
|
Needs rebase. |
e952b67 to
fc84323
Compare
|
Rebased. |
|
Testing this again. ACK fc84323 I think this could be even more usable if it can be called once fully in sync with the network. But I can't display the overlay then... |
Hm I vaguely remember I added that functionality once, you should be able to bring up the overlay by the secret trick of clicking on the sync icon. |
|
@laanwj But the sync icon (you mean the triangle with an exclamation mark inside?) is not displayed when you are "in sync" with the network. |
There are four ways how the modal-overlay can be opened: Though I agree with you, there is no option how to open it once you are in sync... which could be useful, but independent to this PR. |
|
@paveljanik Oh, though it also worked with the checkmark that takes its place. |
| The last travis run for this pull request was 95 days ago and is thus outdated. To trigger a fresh travis build, this pull request should be closed and re-opened. |
src/qt/bitcoingui.cpp
Outdated
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 use the new connect syntax, so it wouldn't have to be changed again in the future?
| Needs rebase |
|
Rebased. |
2079551 to
318ad29
Compare
318ad29 to
718ceef
Compare
|
|
||
| // disable pause button when we can fetch directly | ||
| // avoid using the core-layer's existing CanFetchDirectly() | ||
| bool canFetchDirectly = (blockDate.toTime_t() > GetAdjustedTime() - Params().GetConsensus().nPowTargetSpacing * 20); |
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: Redundant parentheses :-)
|
Discussion has dragged on and died out here. Going to label "Up for grabs" and close for now. |
This, almost UI only change, will add a Pause/Resume button to the modal overlay to pause/resume block downloads during IBD.
This is an effective way to pause/resume IBD during a time when the computers resources are required somewhere else.