handshake-org / handshake-org/hsd

Node RPC getnames Response Exceeds Limit

Open
#447 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.1k
Forks
306
PR merge metrics
No merged PRs in 30d

Description

The JSON response from the RPC `getnames` has gotten too large and will no longer return. This is a problem because there are currently applications that exist that are using it. It was a known issue that this would become a denial of service issue over time as the number of names registered grew.

```bash
$ ./bin/hsd-cli rpc getnames
Error: Response exceeded limit.
at Request.handleResponse (/home/tynes/Projects/github.com/handshake-org/hsd/node_modules/brq/lib/request.js:508:19)
at ClientRequest.emit (events.js:198:13)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:565:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:111:17)
at Socket.socketOnData (_http_client.js:451:20)
at Socket.emit (events.js:198:13)
at addChunk (_stream_readable.js:288:12)
at readableAddChunk (_stream_readable.js:269:11)
at Socket.Readable.push (_stream_readable.js:224:10)
at TCP.onStreamRead (internal/stream_base_commons.js:94:17)
```

A short term solution is to use https://github.com/handshake-org/hs-client/pull/27 and pass in a much larger limit parameter with the `--limit` flag.

A longer term solution would be to update this RPC such that it allows for pagination. It may also make sense to add an HTTP endpoint that works with pagination and/or deprecate the RPC itself.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.