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