class CheckpointStateTask implements CacheableTask<Checkpoint, BeaconState> {

  @Override
  public Stream<Checkpoint> streamIntermediateSteps() {
    if (checkpoint.getEpoch().equals(UInt64.ZERO)) {
      return Stream.empty();
    }
    return Stream.iterate(
            checkpoint.getEpoch().minus(1),
            current ->
                current != null
                    && current.isGreaterThanOrEqualTo(UInt64.ZERO)
                    && current
                        .plus(INTERIM_EPOCHS_TO_SEARCH)
                        .isGreaterThanOrEqualTo(checkpoint.getEpoch()),
            current -> current.equals(UInt64.ZERO) ? null : current.minus(1))
        .map(epoch -> new Checkpoint(epoch, checkpoint.getRoot()));
  }

  public  CheckpointStateTask(final Checkpoint checkpoint, final AsyncStateProvider stateProvider);
  private  CheckpointStateTask(
      final Checkpoint checkpoint,
      final AsyncStateProvider stateProvider,
      final BeaconState baseState);

}