|
|
|
@ -314,7 +314,8 @@ public class EthProtocolManager implements ProtocolManager, MinedBlockObserver { |
|
|
|
|
.setMessage("Post-merge disconnect: peer still gossiping blocks {}") |
|
|
|
|
.addArgument(ethPeer::toString) |
|
|
|
|
.log(); |
|
|
|
|
handleDisconnect(ethPeer.getConnection(), DisconnectReason.SUBPROTOCOL_TRIGGERED, false); |
|
|
|
|
handleDisconnect( |
|
|
|
|
ethPeer.getConnection(), DisconnectReason.SUBPROTOCOL_TRIGGERED_POW_BLOCKS, false); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -441,7 +442,7 @@ public class EthProtocolManager implements ProtocolManager, MinedBlockObserver { |
|
|
|
|
.addArgument(status::networkId) |
|
|
|
|
.addArgument(() -> getPeerOrPeerId(peer)) |
|
|
|
|
.log(); |
|
|
|
|
peer.disconnect(DisconnectReason.SUBPROTOCOL_TRIGGERED); |
|
|
|
|
peer.disconnect(DisconnectReason.SUBPROTOCOL_TRIGGERED_MISMATCHED_NETWORK); |
|
|
|
|
} else if (!forkIdManager.peerCheck(forkId) && status.protocolVersion() > 63) { |
|
|
|
|
LOG.atDebug() |
|
|
|
|
.setMessage("{} has matching network id ({}), but non-matching fork id: {}") |
|
|
|
@ -449,7 +450,7 @@ public class EthProtocolManager implements ProtocolManager, MinedBlockObserver { |
|
|
|
|
.addArgument(networkId::toString) |
|
|
|
|
.addArgument(forkId) |
|
|
|
|
.log(); |
|
|
|
|
peer.disconnect(DisconnectReason.SUBPROTOCOL_TRIGGERED); |
|
|
|
|
peer.disconnect(DisconnectReason.SUBPROTOCOL_TRIGGERED_MISMATCHED_FORKID); |
|
|
|
|
} else if (forkIdManager.peerCheck(status.genesisHash())) { |
|
|
|
|
LOG.atDebug() |
|
|
|
|
.setMessage("{} has matching network id ({}), but non-matching genesis hash: {}") |
|
|
|
@ -457,14 +458,15 @@ public class EthProtocolManager implements ProtocolManager, MinedBlockObserver { |
|
|
|
|
.addArgument(networkId::toString) |
|
|
|
|
.addArgument(status::genesisHash) |
|
|
|
|
.log(); |
|
|
|
|
peer.disconnect(DisconnectReason.SUBPROTOCOL_TRIGGERED); |
|
|
|
|
peer.disconnect(DisconnectReason.SUBPROTOCOL_TRIGGERED_MISMATCHED_GENESIS_HASH); |
|
|
|
|
} else if (mergePeerFilter.isPresent() |
|
|
|
|
&& mergePeerFilter.get().disconnectIfPoW(status, peer)) { |
|
|
|
|
LOG.atDebug() |
|
|
|
|
.setMessage("Post-merge disconnect: peer still PoW {}") |
|
|
|
|
.addArgument(() -> getPeerOrPeerId(peer)) |
|
|
|
|
.log(); |
|
|
|
|
handleDisconnect(peer.getConnection(), DisconnectReason.SUBPROTOCOL_TRIGGERED, false); |
|
|
|
|
handleDisconnect( |
|
|
|
|
peer.getConnection(), DisconnectReason.SUBPROTOCOL_TRIGGERED_POW_DIFFICULTY, false); |
|
|
|
|
} else { |
|
|
|
|
LOG.atDebug() |
|
|
|
|
.setMessage("Received status message from {}: {} with connection {}") |
|
|
|
@ -486,7 +488,7 @@ public class EthProtocolManager implements ProtocolManager, MinedBlockObserver { |
|
|
|
|
.log(); |
|
|
|
|
// Parsing errors can happen when clients broadcast network ids outside the int range,
|
|
|
|
|
// So just disconnect with "subprotocol" error rather than "breach of protocol".
|
|
|
|
|
peer.disconnect(DisconnectReason.SUBPROTOCOL_TRIGGERED); |
|
|
|
|
peer.disconnect(DisconnectReason.SUBPROTOCOL_TRIGGERED_UNPARSABLE_STATUS); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|