Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
src/validation.cpp
Outdated
There was a problem hiding this comment.
| LogPrint(BCLog::VALIDATION, "%s: added new block header %s\n", __func__, hash.ToString()); | |
| LogPrint(BCLog::VALIDATION, "added new block header %s\n", hash.ToString()); |
We have an option for logging source locations -logsourcelocations.
a6f9809 to
c8d044e
Compare
|
Beat me to it! I was just about to open this PR :). For what it's worth, I think that the right approach here is to make this message |
|
I opened #27277 to make (just pushed another commit there to move |
|
cc @0xB10C |
src/validation.cpp
Outdated
There was a problem hiding this comment.
LogPrint is being migrated to LogPrintLevel -- you can use that when adding logging. Or LogPrintfCategory if you decide to make this logged unconditionally, but the former with a level of, say, info, may suffice; example below.
| LogPrint(BCLog::VALIDATION, "added new block header %s\n", hash.ToString()); | |
| LogPrintLevel(BCLog::VALIDATION, BCLog::Level::Info, "added new block header %s\n", hash.ToString()); |
Knowing when a header was first seen may help distinguish between a regular reorg and a selfish mining or eclipse attack.
c8d044e to
3d32b7d
Compare
|
At this point I prefer #27278, but I'll leave this open in case that PR doesn't make it. This one is (slightly) easier to review. |
|
Closing in favour of #27278. |
2c3a90f log: on new valid header (James O'Beirne) e5ce857 log: net: new header over cmpctblock (James O'Beirne) Pull request description: Alternate to #27276. Devs were [suprised to realize](https://twitter.com/jamesob/status/1637237917201383425) last night that we don't have definitive logging for when a given header was first received. This logs to the main stream when new headers are received outside of IBD, as well as when headers come in over cmpctblocks. The rationale of not hiding these under log categories is that they may be useful to have widely available when debugging strange network activity, and the marginal volume is modest. ACKs for top commit: dergoegge: Code review ACK 2c3a90f achow101: ACK 2c3a90f Sjors: tACK 2c3a90f josibake: ACK 2c3a90f Tree-SHA512: 49fdcbe07799c8adc24143d7e5054a0c93fef120d2e9d5fddbd3b119550d895e2985be6ac10dd1825ea23a6fa5479c1b76d5518c136fbd983fa76c0d39dc354f
2c3a90f log: on new valid header (James O'Beirne) e5ce857 log: net: new header over cmpctblock (James O'Beirne) Pull request description: Alternate to bitcoin#27276. Devs were [suprised to realize](https://twitter.com/jamesob/status/1637237917201383425) last night that we don't have definitive logging for when a given header was first received. This logs to the main stream when new headers are received outside of IBD, as well as when headers come in over cmpctblocks. The rationale of not hiding these under log categories is that they may be useful to have widely available when debugging strange network activity, and the marginal volume is modest. ACKs for top commit: dergoegge: Code review ACK 2c3a90f achow101: ACK 2c3a90f Sjors: tACK 2c3a90f josibake: ACK bitcoin@2c3a90f Tree-SHA512: 49fdcbe07799c8adc24143d7e5054a0c93fef120d2e9d5fddbd3b119550d895e2985be6ac10dd1825ea23a6fa5479c1b76d5518c136fbd983fa76c0d39dc354f
Knowing when a header was first seen may help distinguish between a regular reorg and a selfish mining or eclipse attack.