private long getEndBlockNumber(final Optional<BlockParameter> endBlockParameter) {
    final long headBlockNumber = blockchainQueries.headBlockNumber();
    return endBlockParameter
        .map(this::resolveBlockNumber)
        .filter(blockNumber -> blockNumber <= headBlockNumber)
        .orElse(headBlockNumber);
  }
Response.

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