More granular debug [WIP] #8733

pull rebroad wants to merge 24 commits into bitcoin:master from rebroad:MoreGranularDebug.wip changing 7 files +199 −142
  1. rebroad commented at 6:59 PM on September 14, 2016: contributor

    This is the full version with all debug added. It should help to make debug.log more concise and enable certain areas of interest to be {,de}activated.

    This should help developers who need to enable debugging to determine what is happening allowing block and tx to be debugged individually.

    It also could be of value to non-developers who simply want to get a better idea of what their full-node is doing - there have been a number of posts by non-developers wanting to see the "parts moving" so to speak, and I think this pull request can help with this.

    Hopefully this is not an ego-commit, and I am not the only one who likes to see this stuff. It's made granular so that it can be configured via bitcoin.conf to hopefully suit most people. Some people like to see historical block download/upload, some only the propagation of blocks, some like to see how the code for tx handling is working, etc. I think it's rare that people want to see all of this at once - which was the only option available with debug=net.

  2. rebroad force-pushed on Sep 14, 2016
  3. MarcoFalke cross-referenced this on Sep 14, 2016 from issue Debug headers received ("block" for new block announcement, "block2" … by rebroad
  4. in src/init.cpp:None in f22a9d3837 outdated
     422 | @@ -423,7 +423,7 @@ std::string HelpMessage(HelpMessageMode mode)
     423 |          strUsage += HelpMessageOpt("-limitdescendantsize=<n>", strprintf("Do not accept transactions if any ancestor would have more than <n> kilobytes of in-mempool descendants (default: %u).", DEFAULT_DESCENDANT_SIZE_LIMIT));
     424 |          strUsage += HelpMessageOpt("-bip9params=deployment:start:end", "Use given start/end times for specified BIP9 deployment (regtest-only)");
     425 |      }
     426 | -    string debugCategories = "addrman, alert, bench, coindb, db, http, libevent, lock, mempool, mempoolrej, net, proxy, prune, rand, reindex, rpc, selectcoins, tor, zmq"; // Don't translate these and qt below
     427 | +    string debugCategories = "addrman, alert, bench, block{,2}, coindb, db, estimatefee{,2}, http, libevent, lock, mempool{,rej,2}, net{,2}, proxy, prune, rand, reindex, rpc, selectcoins, tx{,2}, tor, zmq"; // Don't translate these and qt below
    


    paveljanik commented at 7:59 PM on September 14, 2016:

    I do not like shellishms like block{,2}.


    rebroad commented at 6:41 AM on September 15, 2016:

    what other options are there? I think this is going to be a situation where it'll be impossible to please everyone but I'm happy to modify it to go with the majority.


    paveljanik commented at 6:46 AM on September 15, 2016:

    I think that for debugging, one category is enough...


    rebroad commented at 8:16 AM on September 15, 2016:

    @paveljanik Thanks for the feedback. I can certainly merge block2 and block together, if this is what most people want. In an older version I had historical block upload logged, and this generated a lot of output, so block2 was created mostly for this. Currently that logging is disabled entirely which makes block2 less necessary, so perhaps it can be gone already. I'll review the code now, but I think yes block2 debug can be disabled - although I do prefer to give people options, hence leaving it in. If people don't want it, they don't need to enable it.

    In an earlier version I would show timings, i.e. how long the delay between requesting headers/blocks and them being received was - this was useful to refining timeout code and identifying when download was stalled to a far better degree than the current code. i.e. it would determine within 10 seconds with high reliably when a node had stalled rather than the current 2 minutes. (it did this by monitoring the partial download and actively keeping track of typical delay times).


    rebroad commented at 8:24 AM on September 15, 2016:

    @paveljanik Thinking about your suggestion further, I think block does need to have at least two subsets, as the logging of block invs received for old blocks would be too verbose for most people, and yet I suspect some people would want to enable this. (after all, it was enabled with "net" before this pull). People might also ask for the debug of block uploads, but since this wasn't in the code before this pull I felt it was reasonable to leave it still out (and find a better way to log it more concisely for a future pull request).

  5. rebroad force-pushed on Sep 15, 2016
  6. rebroad force-pushed on Sep 15, 2016
  7. paveljanik cross-referenced this on Sep 15, 2016 from issue More granular debug by rebroad
  8. rebroad force-pushed on Sep 15, 2016
  9. rebroad force-pushed on Sep 15, 2016
  10. rebroad force-pushed on Sep 15, 2016
  11. rebroad force-pushed on Sep 15, 2016
  12. rebroad force-pushed on Sep 15, 2016
  13. rebroad force-pushed on Sep 16, 2016
  14. Make net debug more granular (move some into net2, block, tx) f780aa47d4
  15. Split debug for estimatefee into {estimatefee,2} 3365bd0f37
  16. Move a bunch of fairly verbose debug messages from mempool to mempool2 569cbc0a3c
  17. Move logic for TX INVs together 9756a297fa
  18. rebroad force-pushed on Sep 17, 2016
  19. Improve conformity in debug messages 1683c7905f
  20. Split logging of invs into debug: tx2, block{,2}
    block2 is used for older block invs where nodes are in IBD, so it can be quite verbose.
    The debug message is now sent after calling UpdateBlockAvailability() and therefore can include the block height if we have received the header.
    236b264a68
  21. Debug headers received ("block" for new block announcement, "block2" for expected). f39be4f407
  22. Log height of block messages, if known, when received 4b35ba847c
  23. Additional logging of block download and correct order of events. 7f7bed6b9d
  24. More granular logging of received getdata requests. 32e14e98b2
  25. Make logging of getblocks and getheaders requests more informative yet concise. 0176da1b7c
  26. Debug sending of recent blocks and compact blocks de77c25acc
  27. Show additional info when advertising our addresses 7e6be0bc4f
  28. More detailed logging of version messages bce545dea0
  29. Move version debug to before other debug messages for later events are shown. ad25948302
  30. Show whether connection is Inbound or Outbound when adding connection
    and remove one debug line that appears immediately before this line.
    88104e4312
  31. Show lastseen as days instead of hours 82d74f410b
  32. Report NodeId in misbehaving debug bad92e3c7e
  33. Shrink debug line for new best block 845d2d940b
  34. Log heights rather than hashes of headers being sent. 917a0eeed3
  35. Move debug message to before Misbehavior message da064bb369
  36. Log size of blocks received and distinguish between blocks received and blocks made. c428016ed6
  37. Log sizes of compact block messages (and txs in violation of protocol) 770b26cf39
  38. Show when we choose to disconnect. 67cddfa992
  39. rebroad force-pushed on Sep 17, 2016
  40. fanquake commented at 10:06 AM on October 10, 2016: member

    Closing this for now, as it doesn't seem to have gathered much interest.

  41. fanquake closed this on Oct 10, 2016

  42. bitcoin 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-05-20 06:55 UTC