class AbstractPeerBlockValidator implements PeerValidator {

  @Override
  public CompletableFuture<Boolean> validatePeer(
      final EthContext ethContext, final EthPeer ethPeer) {
    final AbstractPeerTask<List<BlockHeader>> getHeaderTask =
        GetHeadersFromPeerByNumberTask.forSingleNumber(
                protocolSchedule, ethContext, blockNumber, metricsSystem)
            .setTimeout(Duration.ofSeconds(20))
            .assignPeer(ethPeer);
    return getHeaderTask
        .run()
        .handle(
            (res, err) -> {
              if (err != null) {
                // Mark peer as invalid on error
                LOG.debug(
                    "Peer {} is invalid because required block block ({}) is unavailable: {}",
                    ethPeer,
                    blockNumber,
                    err.toString());
                return false;
              }
              final List<BlockHeader> headers = res.getResult();
              if (headers.size() == 0) {
                // If no headers are returned, fail
                LOG.debug(
                    "Peer {} is invalid because required block ({}) is unavailable.",
                    ethPeer,
                    blockNumber);
                return false;
              }
              final BlockHeader header = headers.get(0);
              return validateBlockHeader(ethPeer, header);
            });
  }

    AbstractPeerBlockValidator(
      final ProtocolSchedule protocolSchedule,
      final MetricsSystem metricsSystem,
      final long blockNumber,
      final long chainHeightEstimationBuffer);
  protected  AbstractPeerBlockValidator(
      final ProtocolSchedule protocolSchedule,
      final MetricsSystem metricsSystem,
      final long blockNumber);

}