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

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

  39. fanquake closed this on Oct 10, 2016

  40. MarcoFalke 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-22 18:15 UTC

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