private static MiningBeneficiaryCalculator miningBeneficiaryCalculator(
      final Address localAddress, final ProtocolSchedule protocolSchedule) {
    return (blockTimestamp, pendingHeader) -> {
      BlockHeader newBlockHeader =
          BlockHeaderBuilder.createDefault()
              .coinbase(pendingHeader.getCoinbase())
              .buildBlockHeader();
      ProtocolSpec protocolSpec =
          ((BftProtocolSchedule) protocolSchedule)
              .getByBlockNumberOrTimestamp(pendingHeader.getNumber(), blockTimestamp);
      Address beneficiaryAddress =
          protocolSpec.getMiningBeneficiaryCalculator().calculateBeneficiary(newBlockHeader);
      return !beneficiaryAddress.isZero() ? beneficiaryAddress : localAddress;
    };
  }
Instantiates a new Bft block creator.

@param miningConfiguration the mining parameters
@param forksSchedule the forks schedule
@param localAddress the local address
@param extraDataCalculator the extra data calculator
@param transactionPool the pending transactions
@param protocolContext the protocol context
@param protocolSchedule the protocol schedule
@param bftExtraDataCodec the bft extra data codec
@param ethScheduler the scheduler for asynchronous block creation tasks
consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/blockcreation/BftBlockCreator.java