public long calculateSimulationGasCap(
      final BlockHeader blockHeader, final long simulationCumulativeGasUsed) {
    if (rpcGasCap > 0) {
      long remainingGas = Math.max(rpcGasCap - simulationCumulativeGasUsed, 0);
      return Math.min(remainingGas, blockHeader.getGasLimit());
    }
    return blockHeader.getGasLimit();
  }
Creates a BlockHashLookup for the block simulation. If a BlockHashLookup is provided in the
BlockOverrides, it is used. Otherwise, the default BlockHashLookup is created.

@param blockOverrides The BlockOverrides to use.
@param newProtocolSpec The ProtocolSpec for the block.
@param blockHeader The block header for the simulation.
@param blockHashCache A cache of block hashes.
@return The BlockHashLookup for the block simulation.
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/BlockSimulator.java