Change progress bar from block-based to time-based #2294

pull laanwj wants to merge 3 commits into bitcoin:master from laanwj:2013_01_progress changing 7 files +109 −58
  1. laanwj commented at 6:06 PM on February 10, 2013: member

    This is less confusing to most people, and doesn't rely on estimates of the total number of blocks received from other nodes.

    Like in the Android app, in the progress bar label now shows the time that the node is behind instead of the number of blocks left.

  2. BitcoinPullTester commented at 6:35 PM on February 10, 2013: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/ab823efbf0a51e0f8dab1ea3d1f27552fea12332 for binaries and test log.

  3. Diapolo commented at 6:42 PM on February 10, 2013: none

    This change seems to require some small re-translations, is this intended for 0.8 or for 0.8.x? As translators need time, we should be sure when to pull this. I don't want to argue over the pull itself ^^, didn't yet try it anyway.

    I would also feel better, if the testnet todo could be fixed before pulling it.

  4. schildbach commented at 7:14 PM on February 10, 2013: contributor

    @laanwj If you want to mimic the behaviour of Bitcoin Wallet, you should have a look at https://code.google.com/p/bitcoin-wallet/source/browse/wallet/src/de/schildbach/wallet/ui/BlockchainStateFragment.java (lines 145-169).

    First of all, it does not show seconds or minutes. It starts with "1 hour behind."

    1-48 hours: x hours behind 2-14 days: x days behind 2-xx weeks: x weeks behind

    I'm thinking of even allowing months.

  5. gmaxwell commented at 8:04 PM on February 10, 2013: contributor

    It starts with "1 hour behind."

    It's important to not start reporting as soon as an hour. Otherwise users start freaking out and corrupting their installs whenever there is a 1 hour block gap (plus the timestamps can pretty easily be an hour behind).

  6. laanwj commented at 8:05 PM on February 10, 2013: member

    Diapolo: At first I simply re-used the "XXX ago" messages, but I think it was a bit confusing and "behind" indicates better what is the case. Yeah it will cause some translations.

    I'm not sure about testnet. I suppose it's not really that important what date is used there for the genesis block.

    Schildbach: I don't really like to use weeks or months, it's very hard to see progress that way. Seconds are never shown, as it starts showing the progress bar at 90 minutes behind. It may be that showing only whole hours is better though, showing minutes pretends to be too precise.

  7. schildbach commented at 8:11 PM on February 10, 2013: contributor

    @gmaxwell I had these thoughts as well about 18 months ago. Back then I was seeing max 45 minutes gap, and I thought timestamps are not off more than 15 minutes. Note that I have a separate warning for when your system clock is off.

    So how many minutes of threshold would you suggest?

  8. schildbach commented at 8:12 PM on February 10, 2013: contributor

    @laanwj Its probably shed-painting, but people start to think in weeks, months or even years if you have larger timespans. Nobody has got a feel of how much 1237 days actually are.

  9. laanwj commented at 11:08 AM on February 11, 2013: member

    Ok but apart from small details, perfect being the enemy of good and such, is this a step forward compared to the current implementation?

  10. sipa commented at 11:14 AM on February 11, 2013: member

    I agree with @schildbach that when numbers get too large, they become hard to interpret. I wonder if using more decimals just to show progress would be useful. For example: X hours (2-48 hours), X.X days (2-14 days), X.XX weeks (14-60 days), X.XXX months (>60 days). Certainly the decimals don't really convey any actual information anymore, but as a whole it's easy to interpret and does show progress.

  11. laanwj commented at 11:59 AM on February 11, 2013: member

    Decimals imo have the same problems as large numbers, it's still a garble of numbers you're just adding a point somewhere in the middle.

    Another option would be to convey "liveness" in another way than global progress so that it doesn't matter that large time units are used.

    For example a lowtech way would be to add/remove a dot to the label for every N blocks that comes in, or an icon that animates one step,etc...

  12. sipa commented at 12:35 PM on February 11, 2013: member

    @laanwj Yeah, just brainstorming - I'm not convinced about the many decimals idea either. Adding dots sounds like an easy and useful way to convey progress as well.

  13. laanwj commented at 1:00 PM on February 11, 2013: member

    I'll give that a try...

  14. laanwj commented at 5:38 AM on February 12, 2013: member

    Ok I changed the time units to @schildbach's, and for the first time in history the spinner does something useful: it spins a frame every time setNumberOfBlocks is called with a changed number of blocks. So both liveness and progress is covered again.

  15. BitcoinPullTester commented at 5:50 AM on February 12, 2013: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/3683d71a8535c2e2505799baf2e7a1f7a1aaf3aa for binaries and test log.

  16. BitcoinPullTester commented at 6:20 AM on February 12, 2013: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/75124792ad76204a93c0b2e97c054dda618163bc for binaries and test log.

  17. BitcoinPullTester commented at 7:21 AM on February 12, 2013: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/876fa2cbae0cb990d79bc981ccbabccdc55f9ee1 for binaries and test log.

  18. in src/qt/clientmodel.cpp:None in 876fa2cbae outdated
      56 |  }
      57 |  
      58 | +QDateTime ClientModel::getGenesisBlockDate() const
      59 | +{
      60 | +    /// TODO testnet
      61 | +    return QDateTime::fromTime_t(1231006505); // Genesis block's time
    


    sipa commented at 3:57 PM on February 12, 2013:

    I think this constant belongs either in either main or checkpoints - the distinction between mainnet and testnet could also happen there automatically.


    laanwj commented at 4:02 PM on February 12, 2013:

    Agreed, that would be a better place.

  19. sipa commented at 9:35 AM on February 13, 2013: member

    Here is a commit that changes the progressbar logic to use (projected & corrected) transaction counts for progress: https://github.com/sipa/bitcoin/commit/e1882ae47afe2e05e627f34af885a910c1303fc2

  20. laanwj commented at 10:00 AM on February 13, 2013: member

    Cool, so I understand that makes the progressbar better match the part of total time spent acquiring the block chain?

  21. sipa commented at 10:02 AM on February 13, 2013: member

    @laanwj Yes, it actually seems to speed up a bit, as the very early blocks have almost no transactions in them, but still require a per-block processing time.

    Only disadvantage is that it requires 4 measured/guessed control parameters. Guessing them wrong doesn't result in worse behaviour than we already have, but it does require some extra work when adding a checkpoint.

  22. laanwj commented at 10:09 AM on February 13, 2013: member

    With the current code in the pull request, usig secs, it looks like the first half-ish goes really fast, and after that it almost grinds to a halt (but that was the same when still using blocks).

  23. sipa commented at 10:10 AM on February 13, 2013: member

    Yes, this fixes that very nicely. I mean this almost reverts it: it seems the very first "blocks" go very slowly, and it speeds up slightly along the way. Try it :)

  24. laanwj commented at 10:12 AM on February 13, 2013: member

    I will once I get home :) was just trying to get the gist of it

  25. sipa commented at 10:20 PM on February 13, 2013: member

    Added a commit to improve testnet support: https://github.com/sipa/bitcoin/commits/progressbar

  26. sipa commented at 7:48 PM on February 14, 2013: member

    Here's a graph of block-based progress vs my branch's code during a reindex on my VPS: http://bitcoin.sipa.be/progress.png

    The last checkpoint is at 0.299252 progress, so slightly before the strange 2-minute gap (i have no clue what happened there, perhaps an I/O hiccup at the hosting provider).

  27. Change progress bar from block-based to time-based
    This is less confusing to most people, and doesn't rely on estimates
    of the total number of blocks received from other nodes.
    fa28f0ee8a
  28. Transactions-based verification progress 097d13f137
  29. Refactor testnet checkpoints 100d0c570f
  30. laanwj commented at 8:16 PM on February 14, 2013: member

    Looks good! I've just merged your changes into this pull.

  31. sipa commented at 8:21 PM on February 14, 2013: member

    @gavinandresen In the added refactor commit, I've added some comments.

  32. BitcoinPullTester commented at 8:45 PM on February 14, 2013: none

    Automatic sanity-testing: FAILED BUILD/TEST, see http://jenkins.bluematt.me/pull-tester/100d0c570f2c07c8c8b0993f5c5f69ae1e528270 for binaries and test log.

    This could happen for one of several reasons:

    1. It chanages paths in makefile.linux-mingw or otherwise changes build scripts in a way that made them incompatible with the automated testing scripts
    2. It does not build on either Linux i386 or Win32 (via MinGW cross compile)
    3. The test suite fails on either Linux i386 or Win32
    4. The block test-cases failed (lookup the first bNN identifier which failed in https://github.com/TheBlueMatt/test-scripts/blob/master/FullBlockTestGenerator.java)

    If you believe this to be in error, please ping BlueMatt on freenode or TheBlueMatt here.

  33. sipa commented at 8:48 PM on February 14, 2013: member

    Anyone an idea why pulltester fails to compile?

  34. sipa commented at 8:56 PM on February 14, 2013: member

    Here's another graph, on a fast 6-core machine. The slowdown factor of 15.0 in the current code is clearly way too much here... http://bitcoin.sipa.be/progress-6core.png

  35. laanwj commented at 9:11 PM on February 14, 2013: member

    I don't understand the pulltester failure either, it gives a warning then bails out.

  36. sipa commented at 9:12 PM on February 14, 2013: member

    Scroll up: checkpoints.cpp:45: error: too many initializers for 'const Checkpoints::CCheckpointData' checkpoints.cpp:53: error: too many initializers for 'const Checkpoints::CCheckpointData'

  37. in src/checkpoints.cpp:None in 100d0c570f
      13 | @@ -14,14 +14,21 @@
      14 |  {
      15 |      typedef std::map<int, uint256> MapCheckpoints;
      16 |  
      17 | -    //
      18 | +    static const double fSigcheckVerificationFactor = 15.0;
    


    Diapolo commented at 9:12 PM on February 14, 2013:

    I would like to see a comment for this :).


    sipa commented at 9:14 PM on February 14, 2013:

    It's how many times transactions after the checkpoint are expected to be slower than those before. Source: me randomly pressing some keys.

  38. in src/checkpoints.h:None in 100d0c570f
      21 | @@ -22,6 +22,8 @@
      22 |  
      23 |      // Returns last CBlockIndex* in mapBlockIndex that is a checkpoint
      24 |      CBlockIndex* GetLastCheckpoint(const std::map<uint256, CBlockIndex*>& mapBlockIndex);
      25 | +
      26 | +    double GuessVerificationProgress(CBlockIndex *pindex);
    


    Diapolo commented at 9:12 PM on February 14, 2013:

    ...and this :)?


    sipa commented at 9:14 PM on February 14, 2013:

    Would: // Guess verification progress do?

  39. in src/qt/guiconstants.h:None in 100d0c570f
       1 | @@ -2,7 +2,7 @@
       2 |  #define GUICONSTANTS_H
       3 |  
       4 |  /* Milliseconds between model updates */
       5 | -static const int MODEL_UPDATE_DELAY = 500;
       6 | +static const int MODEL_UPDATE_DELAY = 250;
    


    Diapolo commented at 9:13 PM on February 14, 2013:

    Does this lead to a noticeable higher CPU usage?


    laanwj commented at 9:17 PM on February 14, 2013:

    No (bitcoin spends its time in block verification, drawing 4 times a second instead of 2 really doesn't matter, maybe it did in the times of commodore 64? :-)

  40. sipa commented at 9:17 PM on February 14, 2013: member

    @Diapolo More seriously: I'll add some comments :)

  41. laanwj closed this on Feb 17, 2013

  42. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me