We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
From the code:
godwoken/crates/rpc-server/src/server.rs
Line 51 in 2d8ad35
Seems godwoken also has a similar issue with ckb, nervosnetwork/ckb#3880
godwoken
ckb
I didn't verify it on godwoken, but from the code the rpc does not has a limit for a request, you can verify it with curl:
rpc
curl
curl --location 'http://127.0.0.1:3000/rpc' \ -H 'content-length: 100' \ --header 'Content-Type: application/json' \ --data-raw ' { "id": 42, "jsonrpc": "2.0", "method": "@ping", "params": [ ] }'
An possible fix is to add a timeout middleware: https://github.com/chenyukang/jsonrpc-utils/blob/810f6a36eec3ce5be8673c11311bf1dcc506c3f9/examples/server-timeout.rs#L39
timeout
The text was updated successfully, but these errors were encountered:
Godwoken rpc is usually proxied by web3 / nginx etc., not exposed directly.
But adding a client body size limit / timeout is pretty easy, so I will add it just in case.
Sorry, something went wrong.
@chenyukang Just use TimeoutLayer from tower-http, no need for ServiceBuilder and HandleErrorLayer.
ServiceBuilder
HandleErrorLayer
Got it, thanks.
blckngm
Successfully merging a pull request may close this issue.
From the code:
godwoken/crates/rpc-server/src/server.rs
Line 51 in 2d8ad35
Seems
godwoken
also has a similar issue withckb
, nervosnetwork/ckb#3880I didn't verify it on
godwoken
, but from the code therpc
does not has a limit for a request, you can verify it withcurl
:An possible fix is to add a
timeout
middleware: https://github.com/chenyukang/jsonrpc-utils/blob/810f6a36eec3ce5be8673c11311bf1dcc506c3f9/examples/server-timeout.rs#L39The text was updated successfully, but these errors were encountered: