@Test public void regenerateAllStates_failOnMissingBlocks() { testGeneratorWithMissingBlock( (generator, missingBlock) -> { SafeFuture<Void> result = generator.regenerateAllStates(StateHandler.NOOP); assertThatThrownBy(result::get) .hasCauseInstanceOf(IllegalStateException.class) .hasMessageContaining( "Failed to retrieve required block " + missingBlock.getRoot() + ". Last processed block was at slot 0."); }); }
public SafeFuture<Void> regenerateAllStates(final StateHandler stateHandler) { LOG.debug( "Regenerate all states for block tree of size {} rooted at block {}", blockTree.size(), blockTree.getRootHash()); return regenerateAllStatesInternal(stateHandler).thenAccept(__ -> stateCache.clear()); }
StateGenerator { public SafeFuture<Void> regenerateAllStates(final StateHandler stateHandler) { LOG.debug( "Regenerate all states for block tree of size {} rooted at block {}", blockTree.size(), blockTree.getRootHash()); return regenerateAllStatesInternal(stateHandler).thenAccept(__ -> stateCache.clear()); } }
StateGenerator { public SafeFuture<Void> regenerateAllStates(final StateHandler stateHandler) { LOG.debug( "Regenerate all states for block tree of size {} rooted at block {}", blockTree.size(), blockTree.getRootHash()); return regenerateAllStatesInternal(stateHandler).thenAccept(__ -> stateCache.clear()); } private  StateGenerator(
      final HashTree blockTree,
      final BlockProvider blockProvider,
      final AsyncChainStateGenerator chainStateGenerator,
      final StateCache stateCache,
      final int blockBatchSize); }
StateGenerator { public SafeFuture<Void> regenerateAllStates(final StateHandler stateHandler) { LOG.debug( "Regenerate all states for block tree of size {} rooted at block {}", blockTree.size(), blockTree.getRootHash()); return regenerateAllStatesInternal(stateHandler).thenAccept(__ -> stateCache.clear()); } private  StateGenerator(
      final HashTree blockTree,
      final BlockProvider blockProvider,
      final AsyncChainStateGenerator chainStateGenerator,
      final StateCache stateCache,
      final int blockBatchSize); static StateGenerator create(
      final HashTree blockTree,
      final SignedBlockAndState rootBlockAndState,
      final BlockProvider blockProvider); static StateGenerator create(
      final HashTree blockTree,
      final SignedBlockAndState rootBlockAndState,
      final BlockProvider blockProvider,
      final Map<Bytes32, BeaconState> knownStates); static StateGenerator create(
      final HashTree blockTree,
      final SignedBlockAndState rootBlockAndState,
      final BlockProvider blockProvider,
      final Map<Bytes32, BeaconState> knownStates,
      final int blockBatchSize,
      final int stateCacheSize); SafeFuture<SignedBlockAndState> regenerateStateForBlock(final Bytes32 blockRoot); SafeFuture<Void> regenerateAllStates(final StateHandler stateHandler); }
StateGenerator { public SafeFuture<Void> regenerateAllStates(final StateHandler stateHandler) { LOG.debug( "Regenerate all states for block tree of size {} rooted at block {}", blockTree.size(), blockTree.getRootHash()); return regenerateAllStatesInternal(stateHandler).thenAccept(__ -> stateCache.clear()); } private  StateGenerator(
      final HashTree blockTree,
      final BlockProvider blockProvider,
      final AsyncChainStateGenerator chainStateGenerator,
      final StateCache stateCache,
      final int blockBatchSize); static StateGenerator create(
      final HashTree blockTree,
      final SignedBlockAndState rootBlockAndState,
      final BlockProvider blockProvider); static StateGenerator create(
      final HashTree blockTree,
      final SignedBlockAndState rootBlockAndState,
      final BlockProvider blockProvider,
      final Map<Bytes32, BeaconState> knownStates); static StateGenerator create(
      final HashTree blockTree,
      final SignedBlockAndState rootBlockAndState,
      final BlockProvider blockProvider,
      final Map<Bytes32, BeaconState> knownStates,
      final int blockBatchSize,
      final int stateCacheSize); SafeFuture<SignedBlockAndState> regenerateStateForBlock(final Bytes32 blockRoot); SafeFuture<Void> regenerateAllStates(final StateHandler stateHandler); static final int DEFAULT_STATE_CACHE_SIZE; }