2004 reduce logging bigints (#2406)

* seems like a reasonable use for TRACE level instead of DEBUG
* hint to user they should adjust logging if they really want to see the body of the corrupt HELLO
* include actual nodeId length in error message
Signed-off-by: Justin Florentine <jflorentine@gmail.com>

Co-authored-by: Justin Florentine <jflorentine@gmail.com>
Co-authored-by: matkt <karim.t2am@gmail.com>
Co-authored-by: garyschulte <garyschulte@gmail.com>
pull/2433/head
Justin Florentine 3 years ago committed by GitHub
parent fd74cbfb74
commit e94c526692
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/peers/EnodeURLImpl.java
  2. 4
      ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/connections/netty/DeFramer.java

@ -54,7 +54,8 @@ public class EnodeURLImpl implements EnodeURL {
final Optional<Integer> listeningPort,
final Optional<Integer> discoveryPort) {
checkArgument(
nodeId.size() == NODE_ID_SIZE, "Invalid node id. Expected id of length: 64 bytes.");
nodeId.size() == NODE_ID_SIZE,
"Invalid node id of length " + nodeId.size() + ". Expected id of length: 64 bytes.");
listeningPort.ifPresent(port -> NetworkUtility.checkPort(port, "listening"));
discoveryPort.ifPresent(port -> NetworkUtility.checkPort(port, "discovery"));

@ -109,12 +109,12 @@ final class DeFramer extends ByteToMessageDecoder {
try {
peerInfo = HelloMessage.readFrom(message).getPeerInfo();
} catch (final RLPException e) {
LOG.debug("Received invalid HELLO message", e);
LOG.warn("Received invalid HELLO message, set log level to TRACE for message body", e);
connectFuture.completeExceptionally(e);
ctx.close();
return;
}
LOG.debug("Received HELLO message: {}", peerInfo);
LOG.trace("Received HELLO message: {}", peerInfo);
if (peerInfo.getVersion() >= 5) {
LOG.trace("Enable compression for p2pVersion: {}", peerInfo.getVersion());
framer.enableCompression();

Loading…
Cancel
Save