class Store implements UpdatableStore {

  @Override
  public SafeFuture<CheckpointState> retrieveFinalizedCheckpointAndState() {
    final Checkpoint finalizedCheckpoint;
    final SignedBlockAndState finalizedBlockAndState;

    readLock.lock();
    try {
      finalizedCheckpoint = this.finalized_checkpoint;
      finalizedBlockAndState = this.finalizedBlockAndState;
    } finally {
      readLock.unlock();
    }

    return checkpointStates
        .perform(
            new CheckpointStateTask(finalizedCheckpoint, fromBlockAndState(finalizedBlockAndState)))
        .thenApply(
            maybeState ->
                new CheckpointState(
                    finalizedCheckpoint,
                    finalizedBlockAndState.getBlock(),
                    maybeState.orElseThrow()));
  }

  private  Store(
      final MetricsSystem metricsSystem,
      int hotStatePersistenceFrequencyInEpochs,
      final BlockProvider blockProvider,
      final StateAndBlockProvider stateAndBlockProvider,
      final CachingTaskQueue<Bytes32, SignedBlockAndState> states,
      final UInt64 time,
      final UInt64 genesis_time,
      final Checkpoint justified_checkpoint,
      final Checkpoint finalized_checkpoint,
      final Checkpoint best_justified_checkpoint,
      final BlockTree blockTree,
      final SignedBlockAndState finalizedBlockAndState,
      final Map<UInt64, VoteTracker> votes,
      final Map<Bytes32, SignedBeaconBlock> blocks,
      final CachingTaskQueue<Checkpoint, BeaconState> checkpointStates);

}