@Override
  public Optional<BlockHeader> getOrSyncHeadByHash(final Hash headHash, final Hash finalizedHash) {
    final var chain = protocolContext.getBlockchain();
    final var maybeHeadHeader = chain.getBlockHeader(headHash);

    if (maybeHeadHeader.isPresent()) {
      LOG.atDebug()
          .setMessage("BlockHeader {} is already present in blockchain")
          .addArgument(maybeHeadHeader.get()::toLogString)
          .log();
    } else {
      backwardSyncContext.maybeUpdateTargetHeight(headHash);
      backwardSyncContext
          .syncBackwardsUntil(headHash)
          .thenRun(() -> updateFinalized(finalizedHash));
    }
    return maybeHeadHeader;
  }
Instantiates a new Merge coordinator.

@param protocolContext the protocol context
@param protocolSchedule the protocol schedule
@param ethScheduler the block builder executor
@param miningParams the mining params
@param backwardSyncContext the backward sync context
@param mergeBlockCreatorFactory the merge block creator factory
consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinator.java