private long resolveBlockNumber(final BlockParameter param) {
    if (param.getNumber().isPresent()) {
      return param.getNumber().get();
    } else if (param.isEarliest()) {
      return BlockHeader.GENESIS_BLOCK_NUMBER;
    } else if (param.isLatest() || param.isPending()) {
      return blockchainQueries.headBlockNumber();
    } else {
      throw new IllegalStateException("Unknown block parameter type.");
    }
  }
Response.

@param requestContext the request context
@return the json rpc response
consensus/common/src/main/java/org/hyperledger/besu/consensus/common/jsonrpc/AbstractGetSignerMetricsMethod.java