private void validateBlock(
      final ProtocolSpec protocolSpec,
      final ProtocolContext context,
      final BlockHeader previousHeader,
      final BlockHeader header,
      final boolean skipPowValidation) {
    final BlockHeaderValidator blockHeaderValidator = protocolSpec.getBlockHeaderValidator();
    final boolean validHeader =
        blockHeaderValidator.validateHeader(
            header,
            previousHeader,
            context,
            skipPowValidation
                ? HeaderValidationMode.LIGHT_DETACHED_ONLY
                : HeaderValidationMode.DETACHED_ONLY);
    if (!validHeader) {
      throw new IllegalStateException("Invalid header at block number " + header.getNumber() + ".");
    }
  }
Import blockchain.

@param blocks the blocks
@param besuController the besu controller
@param skipPowValidation the skip pow validation
@param startBlock the start block
@param endBlock the end block
@return the rlp block importer - import result
@throws IOException the io exception
app/src/main/java/org/hyperledger/besu/chainimport/RlpBlockImporter.java