class CheckpointHeaderFetcher {

  public boolean nextCheckpointEndsAtChainHead(
      final EthPeer peer, final BlockHeader previousCheckpointHeader) {
    if (finalCheckpointHeader.isPresent()) {
      return false;
    }
    final int skip = syncConfig.getDownloaderChainSegmentSize() - 1;
    final long peerEstimatedHeight = peer.chainState().getEstimatedHeight();
    final long previousCheckpointNumber = previousCheckpointHeader.getNumber();
    return previousCheckpointNumber + skip >= peerEstimatedHeight;
  }

  public  CheckpointHeaderFetcher(
      final SynchronizerConfiguration syncConfig,
      final ProtocolSchedule protocolSchedule,
      final EthContext ethContext,
      final Optional<BlockHeader> finalCheckpointHeader,
      final MetricsSystem metricsSystem);

}