Skip to content

Commit

Permalink
Showing 4 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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()));

Original file line number Diff line number Diff line change
@@ -22,8 +22,11 @@
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 void onDisconnect(
final DisconnectReason reason,
final boolean initiatedByPeer) {
if (shouldBlock(reason, initiatedByPeer)) {
LOG.trace("blacklisted peer {} for reason {}", connection, reason.name());
blacklist.add(connection.getPeer());
}
}
Original file line number Diff line number Diff line change
@@ -315,7 +315,7 @@ private void handlePermissionsUpdate(
connection.getPeer(), connection.initiatedRemotely())) {
LOG.debug(
"Disconnecting from peer that is not permitted to maintain ongoing connection: {}",
connection);
connection.getPeerConnection());
connection.disconnect(DisconnectReason.REQUESTED);
}
});
Original file line number Diff line number Diff line change
@@ -168,14 +168,17 @@ protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final L
} 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(

0 comments on commit 3888a96

Please sign in to comment.