private BesuControllerBuilder createConsensusScheduleBesuControllerBuilder(
        final GenesisConfig genesisConfig) {
      final Map<Long, BesuControllerBuilder> besuControllerBuilderSchedule = new HashMap<>();
      final var configOptions = genesisConfig.getConfigOptions();

      final BesuControllerBuilder originalControllerBuilder;
      if (configOptions.isIbft2()) {
        originalControllerBuilder = new IbftBesuControllerBuilder();
      } else if (configOptions.isIbftLegacy()) {
        originalControllerBuilder = new IbftLegacyBesuControllerBuilder();
      } else {
        throw new IllegalStateException(
            "Invalid genesis migration config. Migration is supported from IBFT (legacy) or IBFT2 to QBFT)");
      }
      besuControllerBuilderSchedule.put(0L, originalControllerBuilder);

      final QbftConfigOptions qbftConfigOptions = configOptions.getQbftConfigOptions();
      final Long qbftBlock = readQbftStartBlockConfig(qbftConfigOptions);
      besuControllerBuilderSchedule.put(qbftBlock, new QbftBesuControllerBuilder());

      return new ConsensusScheduleBesuControllerBuilder(besuControllerBuilderSchedule)
          .genesisConfig(genesisConfig);
    }
From genesis config besu controller builder.

@param genesisConfig the genesis config file
@param syncMode the sync mode
@return the besu controller builder
app/src/main/java/org/hyperledger/besu/controller/BesuController.java