getblockchaininfo verificationprogress never reaches 1.0 #31127

issue casey openend this issue on October 22, 2024
  1. casey commented at 0:30 am on October 22, 2024: contributor

    In the output of bitcoin-cli getblockchaininfo, verificationprogress sometimes never reaches 1.0, and fluctuates around 0.99999.

    0{
    1  ...
    2  "verificationprogress": 0.9999945316157191,
    3  ...
    4}
    

    This was reported in #26433, and closed because verificationprogress is only an estimate. I would have commented in that issue, but it’s locked. The rationale for closing the issue was because the OP in the issue wanted to use verificationprogress to check if the chain is synced, and the field is only an estimate, and shouldn’t be relied on as exact.

    This makes sense, however, however, I think it still should be fixed so that, at the chain tip, verificationprogress is 1.0, just for UX reasons. Many a time I’ve looked at the output of getblockchaininfo and been confused because it isn’t at 1.0.

  2. jonatack commented at 1:03 am on October 22, 2024: member
    Maybe for UX purposes verificationprogress in RPCs getblockchaininfo and getchainstates (and CLI -getinfo) could return 1 instead of the estimate, when blocks equals headers or validated is true.
  3. sipa commented at 1:11 am on October 22, 2024: member

    The verification progress estimate is computed by first determining an estimate on the total number of transactions to date (based on the current time, and a known growth rate), and then dividing the actual number of transactions in the chain by that.

    If we want something that looks nicer, it’s possible to instead of using the current time, use the timestamp of the best known block header. This will give wildly inaccurate results while headers are still syncing, though.

  4. laanwj added the label RPC/REST/ZMQ on Oct 22, 2024
  5. laanwj commented at 7:25 am on October 22, 2024: member
    Looks like a duplicate of #26433.
  6. jonatack commented at 3:20 pm on October 22, 2024: member

    Maybe for UX purposes verificationprogress in RPCs getblockchaininfo and getchainstates (and CLI -getinfo) could return 1 instead of the estimate, when blocks equals headers or validated is true.

    Proposed in #31135.


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: 2024-12-21 18:12 UTC

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