-
Notifications
You must be signed in to change notification settings - Fork 20.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rpc: increase max request content length #22012
rpc: increase max request content length #22012
Conversation
In the ropsten network, there are multiple blocks with size over 3MB (height 599275 - 3.35MB, 599281 - 6.52MB). The current limit of 5MB does not allow to fetch these blocks using the eth_getBlock API call. With the overhead of the hex encoding in the rpc protocol, the maximum block size possible to be fetched is about 2.5MB.
@@ -32,7 +32,7 @@ import ( | |||
) | |||
|
|||
const ( | |||
maxRequestContentLength = 1024 * 1024 * 5 | |||
maxRequestContentLength = 1024 * 1024 * 20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps maxRequestContentLength
size should not only be increased, but also be made to be configurable like parity-ethereum. As to what concrete value should it increase to, maybe DDOS attack also needs to be considered.
I don't understand why we need to increase the maximum request length to allow for very large responses. I just tested this with the client available in package rpc and it seems to have no problem dealing with large responses sent by the server:
|
@martinboehm can you provide more information about your issue? It would be nice to know under which circumstances you are hitting this limit. Which client library are you using to access ropsten blocks? |
@fjl Hi, we are using websocket connection, not HTTP. The issue is happening in the blockchain indexer and simple explorer https://github.com/trezor/blockbook on initial indexing of the blockchain. |
Thanks! So it looks like the issue is with this line: https://github.com/ethereum/go-ethereum/blob/master/rpc/websocket.go#L242. I'm OK with increasing this limit independently of the HTTP request body limit, will look into it. |
Replaced by #22385 |
In the ropsten network, there are multiple blocks with the size over 3MB (height 599275 - 3.35MB, 599281 - 6.52MB). The current max request content length limit of 5MB does not allow to fetch these blocks using the
eth_getBlock
API call. With the overhead of the hex encoding in the rpc protocol, the maximum block size possible to be fetched is only about 2.5MB.Fixed by extending the max request content length size to 20MB - with some buffer room, as the working limit would be about 14-15MB.