private void handleContestedPivotBlock(final long contestedBlockNumber) {
    if (pivotBlockNumber.compareAndSet(
        contestedBlockNumber, contestedBlockNumber - pivotBlockNumberResetDelta)) {
      LOG.info("Received conflicting pivot blocks for {}.", contestedBlockNumber);

      final int retryCount = confirmationTasks.size();

      if ((retryCount % SUSPICIOUS_NUMBER_OF_RETRIES) == 0) {
        LOG.warn("{} attempts have failed to find a fast sync pivot block", retryCount);
      }

      if (retryCount > maxPivotBlockResets
          || pivotBlockNumber.get() <= BlockHeader.GENESIS_BLOCK_NUMBER) {
        LOG.info("Max retries reached, cancel pivot block download.");
        // Pivot block selection has failed
        result.completeExceptionally(new SyncException(SyncError.PIVOT_BLOCK_HEADER_MISMATCH));
        return;
      } else {
        LOG.info("Move pivot block back to {} and retry.", pivotBlockNumber);
      }

      confirmBlock(pivotBlockNumber.get());
    }
  }
This task attempts to find a non-controversial pivot block by confirming the pivot block number
with a minimum number of peers. If a particular pivot block cannot be confirmed, the pivot block
number is pushed back and the confirmation process repeats. If a maximum number of retries is
reached, the task fails with a {@code FastSyncException} containing {@code
FastSyncError.PIVOT_BLOCK_HEADER_MISMATCH}.
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/PivotBlockRetriever.java