@Override
  public int compareTo(final @NotNull EthPeer ethPeer) {
    final int repCompare = this.reputation.compareTo(ethPeer.reputation);
    if (repCompare != 0) return repCompare;

    final int headStateCompare =
        Long.compare(
            this.chainHeadState.getBestBlock().getNumber(),
            ethPeer.chainHeadState.getBestBlock().getNumber());
    if (headStateCompare != 0) return headStateCompare;

    return getConnection().getPeerInfo().compareTo(ethPeer.getConnection().getPeerInfo());
  }
Return A read-only snapshot of this peer's current {@code chainState}

@return A read-only snapshot of this peer's current {@code chainState}
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeer.java