public Optional<Wei> getNextBlockBaseFee() {
    final var chainHeadHeader = blockchain.getChainHeadHeader();
    final var nextBlockProtocolSpec =
        protocolSchedule.getForNextBlockHeader(chainHeadHeader, System.currentTimeMillis());
    final var nextBlockFeeMarket = nextBlockProtocolSpec.getFeeMarket();
    return nextBlockFeeMarket.implementsBaseFee()
        ? Optional.of(getNextBlockBaseFee(chainHeadHeader, (BaseFeeMarket) nextBlockFeeMarket))
        : Optional.empty();
  }
Calculate and return the value of the base fee for the next block, if the network has a base
fee market, otherwise return empty.

@return the optional base fee
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/BlockchainQueries.java