init,log: Unify block index log line #31616

pull l0rinc wants to merge 1 commits into bitcoin:master from l0rinc:l0rinc/block-index changing 1 files +1 −2
  1. l0rinc commented at 2:52 pm on January 7, 2025: contributor

    The line has been present since the beginning.

    Removed redundant duration as well since it can be recovered from the timestamps.

    Example logs before the change:

    02025-01-07T11:58:33Z Verification progress: 99%
    12025-01-07T11:58:33Z Verification: No coin database inconsistencies in last 6 blocks (18905 transactions)
    22025-01-07T11:58:33Z  block index           31892ms
    32025-01-07T11:58:33Z Setting NODE_NETWORK on non-prune mode
    
  2. DrahtBot commented at 2:52 pm on January 7, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31616.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK maflcko, TheCharlatan, danielabrozzoni, BrandonOdiwuor
    Stale ACK theuni

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #31061 (refactor: Check translatable format strings at compile-time by maflcko)
    • #29641 (scripted-diff: Use LogInfo over LogPrintf [WIP, NOMERGE, DRAFT] by maflcko)
    • #26022 (Add util::ResultPtr class by ryanofsky)
    • #25665 (refactor: Add util::Result failure values, multiple error and warning messages by ryanofsky)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  3. in src/init.cpp:1266 in 2ee82dfdeb outdated
    1262@@ -1263,7 +1263,7 @@ static ChainstateLoadResult InitAndLoadChainstate(
    1263         }
    1264         std::tie(status, error) = catch_exceptions([&] { return VerifyLoadedChainstate(chainman, options); });
    1265         if (status == node::ChainstateLoadStatus::SUCCESS) {
    1266-            LogPrintf(" block index %15dms\n", Ticks<std::chrono::milliseconds>(SteadyClock::now() - load_block_index_start_time));
    1267+            LogInfo("Block index %15dms\n", Ticks<std::chrono::milliseconds>(SteadyClock::now() - load_block_index_start_time));
    


    TheCharlatan commented at 4:13 pm on January 7, 2025:
    I keep on forgetting that we can drop the newline now too -_-. All these log lines here after (and including) "Loading block index..." are just kind of bad to be honest. We are definitely doing more here than loading the block index. I’m not even sure if the measured time here provides anything useful given that it varies quite a bit form run to run and we already log timestamps by default. Maybe this should rather just say "Loaded block index and chainstate"?

    l0rinc commented at 5:21 pm on January 7, 2025:
    Good idea, done - also removed the weird looking %15d, curious what other reviewers think
  4. l0rinc force-pushed on Jan 7, 2025
  5. theuni approved
  6. theuni commented at 4:08 pm on January 8, 2025: member
    utACK 60b7bbd3709519c6f2f8023a23ee0a194a5f0eb4
  7. maflcko commented at 4:19 pm on January 8, 2025: member
    Is there any value in the redundant duration, which can be recovered from the timestamps? Seems better to remove it, as per #31616 (review)
  8. l0rinc commented at 10:01 am on January 9, 2025: contributor
    @maflcko do you mean removing these logs in the first place since they’re redundant?
  9. maflcko commented at 11:25 am on January 9, 2025: member
    Just the duration, edited my comment.
  10. init,log: Unify block index and chainstate loading log line
    Example logs before the change:
    ```
    2025-01-07T11:58:33Z Verification progress: 99%
    2025-01-07T11:58:33Z Verification: No coin database inconsistencies in last 6 blocks (18905 transactions)
    2025-01-07T11:58:33Z  block index           31892ms
    2025-01-07T11:58:33Z Setting NODE_NETWORK on non-prune mode
    2025-01-07T11:58:33Z block tree size = 878086
    2025-01-07T11:58:33Z nBestHeight = 878085
    ```
    
    Removed redundant duration as well since it can be recovered from the timestamps.
    
    Co-authored-by: TheCharlatan <seb.kung@gmail.com>
    Co-authored-by: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>
    e04be3731f
  11. l0rinc force-pushed on Jan 9, 2025
  12. maflcko commented at 1:32 pm on January 9, 2025: member
    lgtm ACK e04be3731f4921cd51d25b1d6210eace7600fea4
  13. DrahtBot requested review from theuni on Jan 9, 2025
  14. TheCharlatan approved
  15. TheCharlatan commented at 9:01 am on January 10, 2025: contributor
    ACK e04be3731f4921cd51d25b1d6210eace7600fea4
  16. danielabrozzoni approved
  17. danielabrozzoni commented at 10:52 am on January 10, 2025: contributor
    tACK e04be3731f4921cd51d25b1d6210eace7600fea4
  18. BrandonOdiwuor approved
  19. BrandonOdiwuor commented at 11:23 am on January 10, 2025: contributor
    Code Review ACK e04be3731f4921cd51d25b1d6210eace7600fea4
  20. fanquake merged this on Jan 10, 2025
  21. fanquake closed this on Jan 10, 2025


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: 2025-01-21 03:12 UTC

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