Skip to content

Conversation

@jonasschnelli
Copy link
Contributor

@jonasschnelli jonasschnelli commented Jan 10, 2017

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.

bildschirmfoto 2017-01-10 um 18 34 09

@paveljanik
Copy link
Contributor

Isn't network toggle button usable in this case? If it is not, let's fix it instead...

@jonasschnelli
Copy link
Contributor Author

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)...

@luke-jr
Copy link
Member

luke-jr commented Jan 10, 2017

IMO it would be too confusing to be worth it without "SPV" mode, but probably should go in after the latter is.

@maflcko
Copy link
Member

maflcko commented Jan 10, 2017 via email

@luke-jr
Copy link
Member

luke-jr commented Jan 10, 2017

The "Pause" button won't be visible in normal cases.

@jonasschnelli
Copy link
Contributor Author

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?

Yes. These are internally two completely different features. Expose to the users, these have similar effects.

The "Pause" button won't be visible in normal cases.

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.

Copy link
Contributor

@kallewoof kallewoof left a comment

Choose a reason for hiding this comment

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

utACK abf0941

Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: usefull (one L)

Copy link
Contributor

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.

@laanwj laanwj added this to the 0.15.0 milestone Mar 14, 2017
@laanwj
Copy link
Member

laanwj commented Mar 14, 2017

Added 0.15 milestone

@jonasschnelli
Copy link
Contributor Author

Rebased.

@jonasschnelli jonasschnelli force-pushed the 2017/01/autodownload branch 2 times, most recently from dd9f365 to e2e86ec Compare March 17, 2017 14:54

/** 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;
Copy link
Member

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()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree. Will change...

return GUIUtil::boostPathToQString(GetDataDir());
}

bool ClientModel::isAutorequestBlocks() const
Copy link
Member

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?

@laanwj
Copy link
Member

laanwj commented Apr 19, 2017

When re-enabling AutoRequestBlocks, what 'kicks off' the block requesting process again? Setting the flag will make it request blocks the next time FindNextBlocksToDownload is called; is that good enough? I suppose it is, because SendMessages is called periodically (every 100 ms?).

@jonasschnelli
Copy link
Contributor Author

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 Wait to finish current downloads.

@paveljanik
Copy link
Contributor

Well, I have to change my previous opinion. I think this can be useful.

Concept ACK

Will test soon.

@paveljanik
Copy link
Contributor

Needs rebase.

@ryanofsky
Copy link
Contributor

ACK e952b67d294043d9758b37bf2be57a982b41c051

Code looks good. On the UI feature, two minor comments:

  • Pausing the download throws off "Estimated time left till synced." It would be better pausing didn't affect estimated time.
  • Pause/Resume button really sticks out where it's currently placed. Maybe it would make more sense next to the progress bar or near the hide button.

@sipa
Copy link
Member

sipa commented May 1, 2017

Needs rebase.

@jonasschnelli jonasschnelli force-pushed the 2017/01/autodownload branch from e952b67 to fc84323 Compare May 11, 2017 13:26
@jonasschnelli
Copy link
Contributor Author

Rebased.

@paveljanik
Copy link
Contributor

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...

@laanwj
Copy link
Member

laanwj commented May 24, 2017

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.

@paveljanik
Copy link
Contributor

@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.

@jonasschnelli
Copy link
Contributor Author

jonasschnelli commented May 24, 2017

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...

There are four ways how the modal-overlay can be opened:
-> auto-opens when in IBD/sync
-> Click on the warning icons next to the balance
-> Click on the progress bar during IBD/sync
-> Click on the sync icon in the status bar

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.

@laanwj
Copy link
Member

laanwj commented May 24, 2017

@paveljanik Oh, though it also worked with the checkmark that takes its place.

@DrahtBot
Copy link
Contributor

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.

@DrahtBot DrahtBot closed this Jul 22, 2018
@DrahtBot DrahtBot reopened this Jul 22, 2018
Copy link
Member

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?

@laanwj laanwj modified the milestones: 0.17.0, 0.18.0 Jul 23, 2018
@DrahtBot
Copy link
Contributor

Needs rebase

@jonasschnelli
Copy link
Contributor Author

Rebased.


// 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);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Redundant parentheses :-)

@laanwj laanwj removed this from the 0.18.0 milestone Feb 6, 2019
@fanquake
Copy link
Member

Discussion has dragged on and died out here. Going to label "Up for grabs" and close for now.

@fanquake fanquake closed this Jun 17, 2019
MarkLTZ added a commit to litecoinz-core/litecoinz that referenced this pull request Nov 17, 2019
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.