Update Sepolia bootnode, peer logging (#3034)

* log additional details for dropped and blacklisted peers
* update sepolia boot-node from Martin

Signed-off-by: garyschulte <garyschulte@gmail.com>
pull/3035/head
garyschulte 3 years ago committed by GitHub
parent 4f44863694
commit 3888a962c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/config/DiscoveryConfiguration.java
  2. 4
      ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/network/PeerReputationManager.java
  3. 2
      ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/RlpxAgent.java
  4. 7
      ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/connections/netty/DeFramer.java

@ -102,7 +102,7 @@ public class DiscoveryConfiguration {
public static final List<EnodeURL> SEPOLIA_BOOTSTRAP_NODES =
Collections.unmodifiableList(
Stream.of(
"enode://7c9740e4d64674801fe62b76798d46778a038c49caebb15843d8c0f2b2f80d7ceba2585b4be366e6161988f81ddcfcd6fca98b5da52ae9a6f22c1b2a84b24a04@18.130.169.73:30303")
"enode://9246d00bc8fd1742e5ad2428b80fc4dc45d786283e05ef6edbd9002cbc335d40998444732fbe921cb88e1d2c73d1b1de53bae6a2237996e9bfe14f871baf7066@18.168.182.86:3030")
.map(EnodeURLImpl::fromString)
.collect(toList()));

@ -22,8 +22,11 @@ import org.hyperledger.besu.ethereum.p2p.rlpx.wire.messages.DisconnectMessage.Di
import java.util.Set;
import com.google.common.collect.ImmutableSet;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class PeerReputationManager implements DisconnectCallback {
private static final Logger LOG = LogManager.getLogger();
private static final Set<DisconnectReason> locallyTriggeredDisconnectReasons =
ImmutableSet.of(
DisconnectReason.BREACH_OF_PROTOCOL, DisconnectReason.INCOMPATIBLE_P2P_PROTOCOL_VERSION);
@ -43,6 +46,7 @@ public class PeerReputationManager implements DisconnectCallback {
final DisconnectReason reason,
final boolean initiatedByPeer) {
if (shouldBlock(reason, initiatedByPeer)) {
LOG.trace("blacklisted peer {} for reason {}", connection, reason.name());
blacklist.add(connection.getPeer());
}
}

@ -315,7 +315,7 @@ public class RlpxAgent {
connection.getPeer(), connection.initiatedRemotely())) {
LOG.debug(
"Disconnecting from peer that is not permitted to maintain ongoing connection: {}",
connection);
connection.getPeerConnection());
connection.disconnect(DisconnectReason.REQUESTED);
}
});

@ -168,14 +168,17 @@ final class DeFramer extends ByteToMessageDecoder {
} else if (message.getCode() == WireMessageCodes.DISCONNECT) {
DisconnectMessage disconnectMessage = DisconnectMessage.readFrom(message);
LOG.debug(
"Peer disconnected before sending HELLO. Reason: " + disconnectMessage.getReason());
"Peer {} disconnected before sending HELLO. Reason: {}",
expectedPeer.map(Peer::getEnodeURLString).orElse("unknown"),
disconnectMessage.getReason());
ctx.close();
connectFuture.completeExceptionally(
new PeerDisconnectedException(disconnectMessage.getReason()));
} else {
// Unexpected message - disconnect
LOG.debug(
"Message received before HELLO's exchanged, disconnecting. Code: {}, Data: {}",
"Message received before HELLO's exchanged, disconnecting. Peer: {}, Code: {}, Data: {}",
expectedPeer.map(Peer::getEnodeURLString).orElse("unknown"),
message.getCode(),
message.getData().toString());
ctx.writeAndFlush(

Loading…
Cancel
Save