Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Suppress p2p logs #1875
The next large message in p2p log is
which followed with a JSON dump of a whole block due to the capture and re-throw of
The reason why this message appears in a normal node's log file, is when a normal node has a peer whose system clock is behind, the "stale" node may repeatedly reject / disconnect to the normal node and re-connect, the exception message with the whole block will be sent to the normal node when disconnecting. One stale node can generate 200+ such messages in normal nodes' log files every hour, which is 2-3 MB with recent blocks (depends on size of blocks). The more stale nodes connected, the more the messages, thus the larger the log files.
On the other hand, the message could be helpful for nodes whose system clock is ahead.
I'm not sure what's the best way to deal with this. My gut says we'd better send shorter message when disconnecting due to this reason, E.G. only includes the block header but not the whole block.
New log messages about "timestamp-in-the-future" blocks look like this:
Average size of such messages reduced from around 12KB (data of 2019-07-29) to 800 bytes.