@VisibleForTesting
  CompletableFuture<Block> importOrSavePendingBlock(final Block block, final Bytes nodeId) {
    // Synchronize to avoid race condition where block import event fires after the
    // blockchain.contains() check and before the block is registered, causing onBlockAdded() to be
    // invoked for the parent of this block before we are able to register it.
    LOG.atTrace()
        .setMessage("Import or save pending block {}")
        .addArgument(block::toLogString)
        .log();

    if (!protocolContext.getBlockchain().contains(block.getHeader().getParentHash())) {
      // Block isn't connected to local chain, save it to pending blocks collection
      if (savePendingBlock(block, nodeId)) {
        // if block is saved as pending, try to resolve it
        maybeProcessPendingBlocks(block);
      }
      return CompletableFuture.completedFuture(block);
    }

    if (!processingBlocksManager.addImportingBlock(block.getHash())) {
      LOG.atTrace()
          .setMessage("We're already importing this block {}")
          .addArgument(block::toLogString)
          .log();
      return CompletableFuture.completedFuture(block);
    }

    if (protocolContext.getBlockchain().contains(block.getHash())) {
      LOG.atTrace()
          .setMessage("We've already imported this block {}")
          .addArgument(block::toLogString)
          .log();
      processingBlocksManager.registerBlockImportDone(block.getHash());
      return CompletableFuture.completedFuture(block);
    }

    final BlockHeader parent =
        protocolContext
            .getBlockchain()
            .getBlockHeader(block.getHeader().getParentHash())
            .orElseThrow(
                () ->
                    new IllegalArgumentException(
                        "Incapable of retrieving header from non-existent parent of "
                            + block.toLogString()));
    final ProtocolSpec protocolSpec = protocolSchedule.getByBlockHeader(block.getHeader());
    final BlockHeaderValidator blockHeaderValidator = protocolSpec.getBlockHeaderValidator();
    final BadBlockManager badBlockManager = protocolContext.getBadBlockManager();
    return ethContext
        .getScheduler()
        .scheduleSyncWorkerTask(
            () ->
                validateAndProcessPendingBlock(
                    blockHeaderValidator, block, parent, badBlockManager));
  }
Process pending Children if any

@param block the block to process the children
@return true if block has any pending child
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/BlockPropagationManager.java