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 = public static final List<EnodeURL> SEPOLIA_BOOTSTRAP_NODES =
Collections.unmodifiableList( Collections.unmodifiableList(
Stream.of( Stream.of(
"enode://7c9740e4d64674801fe62b76798d46778a038c49caebb15843d8c0f2b2f80d7ceba2585b4be366e6161988f81ddcfcd6fca98b5da52ae9a6f22c1b2a84b24a04@18.130.169.73:30303") "enode://9246d00bc8fd1742e5ad2428b80fc4dc45d786283e05ef6edbd9002cbc335d40998444732fbe921cb88e1d2c73d1b1de53bae6a2237996e9bfe14f871baf7066@18.168.182.86:3030")
.map(EnodeURLImpl::fromString) .map(EnodeURLImpl::fromString)
.collect(toList())); .collect(toList()));

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

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

@ -168,14 +168,17 @@ final class DeFramer extends ByteToMessageDecoder {
} else if (message.getCode() == WireMessageCodes.DISCONNECT) { } else if (message.getCode() == WireMessageCodes.DISCONNECT) {
DisconnectMessage disconnectMessage = DisconnectMessage.readFrom(message); DisconnectMessage disconnectMessage = DisconnectMessage.readFrom(message);
LOG.debug( 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(); ctx.close();
connectFuture.completeExceptionally( connectFuture.completeExceptionally(
new PeerDisconnectedException(disconnectMessage.getReason())); new PeerDisconnectedException(disconnectMessage.getReason()));
} else { } else {
// Unexpected message - disconnect // Unexpected message - disconnect
LOG.debug( 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.getCode(),
message.getData().toString()); message.getData().toString());
ctx.writeAndFlush( ctx.writeAndFlush(

Loading…
Cancel
Save