private static BigInteger calculateThawedDifficulty(
      final long time, final BlockHeader parent, final long fakeBlockOffset) {
    final BigInteger parentDifficulty = difficulty(parent.getDifficulty());
    final boolean hasOmmers = !parent.getOmmersHash().equals(Hash.EMPTY_LIST_HASH);
    final BigInteger difficulty =
        ensureMinimumDifficulty(
            BigInteger.valueOf(byzantiumX(time, parent.getTimestamp(), hasOmmers))
                .multiply(parentDifficulty.divide(DIFFICULTY_BOUND_DIVISOR))
                .add(parentDifficulty));
    final long periodCount =
        fakeBlockNum(parent.getNumber(), fakeBlockOffset) / EXPONENTIAL_DIFF_PERIOD;
    return periodCount > 1 ? adjustForPeriod(periodCount, difficulty) : difficulty;
  }
Provides the various difficultly calculates used on mainnet hard forks.
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetDifficultyCalculators.java