-
Notifications
You must be signed in to change notification settings - Fork 645
jsonrpc: add a batch size limit for RPC requests #2867
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
Comments
This solution was adopted in a fork, using a hard-coded batch size limit: |
I'm very supportive of doing this w/ a config option! |
I'll look into this and try to push a PR in the next couple of days |
andynog
added a commit
that referenced
this issue
Apr 25, 2024
andynog
added a commit
that referenced
this issue
Apr 25, 2024
andynog
added a commit
that referenced
this issue
Apr 25, 2024
andynog
added a commit
that referenced
this issue
Apr 26, 2024
andynog
added a commit
that referenced
this issue
Apr 29, 2024
4 tasks
andynog
added a commit
that referenced
this issue
Apr 30, 2024
andynog
added a commit
that referenced
this issue
Apr 30, 2024
andynog
added a commit
that referenced
this issue
Apr 30, 2024
andynog
added a commit
that referenced
this issue
Apr 30, 2024
andynog
added a commit
that referenced
this issue
May 1, 2024
andynog
added a commit
that referenced
this issue
May 1, 2024
andynog
added a commit
that referenced
this issue
May 1, 2024
github-merge-queue bot
pushed a commit
that referenced
this issue
May 2, 2024
close: #2867 Adds middleware for the JSONRPC server to enforce a configurable maximum batch size for RPC requests. --- #### PR checklist - [ ] Tests written/updated - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [X] Updated relevant documentation (`docs/` or `spec/`) and code comments - [X] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec
mergify bot
pushed a commit
that referenced
this issue
May 2, 2024
close: #2867 Adds middleware for the JSONRPC server to enforce a configurable maximum batch size for RPC requests. --- #### PR checklist - [ ] Tests written/updated - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [X] Updated relevant documentation (`docs/` or `spec/`) and code comments - [X] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec (cherry picked from commit aa1caba)
mergify bot
pushed a commit
that referenced
this issue
May 2, 2024
close: #2867 Adds middleware for the JSONRPC server to enforce a configurable maximum batch size for RPC requests. --- #### PR checklist - [ ] Tests written/updated - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [X] Updated relevant documentation (`docs/` or `spec/`) and code comments - [X] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec (cherry picked from commit aa1caba) # Conflicts: # docs/references/config/config.toml.md
4 tasks
4 tasks
andynog
added a commit
that referenced
this issue
May 3, 2024
…#2939) (#2980) close: #2867 Adds middleware for the JSONRPC server to enforce a configurable maximum batch size for RPC requests. --- #### PR checklist - [ ] Tests written/updated - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [X] Updated relevant documentation (`docs/` or `spec/`) and code comments - [X] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec <hr>This is an automatic backport of pull request #2939 done by [Mergify](https://mergify.com). --------- Co-authored-by: Andy Nogueira <me@andynogueira.dev> Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
andynog
added a commit
that referenced
this issue
May 3, 2024
4 tasks
github-merge-queue bot
pushed a commit
that referenced
this issue
May 6, 2024
Related to #2867 Quick fix for a comment in the code added about a default value for a config parameter. During backport to `v0.38.x`, @melekes made a suggestion that the default value in a comment was inaccurate. Instead of updating the default value in the comment, I've decided to remove the comment about the default value. In my opinion, we should not have default value for config parameters in comments if it's clear specified in the configuration docs what are the default and possible values. Realized that having the default values in comments is not beneficial and updating in the comment might be a not as straightforward as changing it in code/config. #### PR checklist - [ ] ~~Tests written/updated~~ - [ ] ~~Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog)~~ - [X] Updated relevant documentation (`docs/` or `spec/`) and code comments - [X] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec
mergify bot
pushed a commit
that referenced
this issue
May 6, 2024
Related to #2867 Quick fix for a comment in the code added about a default value for a config parameter. During backport to `v0.38.x`, @melekes made a suggestion that the default value in a comment was inaccurate. Instead of updating the default value in the comment, I've decided to remove the comment about the default value. In my opinion, we should not have default value for config parameters in comments if it's clear specified in the configuration docs what are the default and possible values. Realized that having the default values in comments is not beneficial and updating in the comment might be a not as straightforward as changing it in code/config. #### PR checklist - [ ] ~~Tests written/updated~~ - [ ] ~~Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog)~~ - [X] Updated relevant documentation (`docs/` or `spec/`) and code comments - [X] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec (cherry picked from commit cac1fd8)
mergify bot
pushed a commit
that referenced
this issue
May 6, 2024
Related to #2867 Quick fix for a comment in the code added about a default value for a config parameter. During backport to `v0.38.x`, @melekes made a suggestion that the default value in a comment was inaccurate. Instead of updating the default value in the comment, I've decided to remove the comment about the default value. In my opinion, we should not have default value for config parameters in comments if it's clear specified in the configuration docs what are the default and possible values. Realized that having the default values in comments is not beneficial and updating in the comment might be a not as straightforward as changing it in code/config. #### PR checklist - [ ] ~~Tests written/updated~~ - [ ] ~~Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog)~~ - [X] Updated relevant documentation (`docs/` or `spec/`) and code comments - [X] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec (cherry picked from commit cac1fd8) # Conflicts: # rpc/jsonrpc/server/http_server.go
This was referenced May 6, 2024
melekes
added a commit
that referenced
this issue
May 6, 2024
Related to #2867 Quick fix for a comment in the code added about a default value for a config parameter. During backport to `v0.38.x`, @melekes made a suggestion that the default value in a comment was inaccurate. Instead of updating the default value in the comment, I've decided to remove the comment about the default value. In my opinion, we should not have default value for config parameters in comments if it's clear specified in the configuration docs what are the default and possible values. Realized that having the default values in comments is not beneficial and updating in the comment might be a not as straightforward as changing it in code/config. #### PR checklist - [ ] ~~Tests written/updated~~ - [ ] ~~Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog)~~ - [X] Updated relevant documentation (`docs/` or `spec/`) and code comments - [X] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec <hr>This is an automatic backport of pull request #3000 done by [Mergify](https://mergify.com). --------- Co-authored-by: Andy Nogueira <me@andynogueira.dev> Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
melekes
added a commit
that referenced
this issue
May 6, 2024
Related to #2867 Quick fix for a comment in the code added about a default value for a config parameter. During backport to `v0.38.x`, @melekes made a suggestion that the default value in a comment was inaccurate. Instead of updating the default value in the comment, I've decided to remove the comment about the default value. In my opinion, we should not have default value for config parameters in comments if it's clear specified in the configuration docs what are the default and possible values. Realized that having the default values in comments is not beneficial and updating in the comment might be a not as straightforward as changing it in code/config. #### PR checklist - [ ] ~~Tests written/updated~~ - [ ] ~~Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog)~~ - [X] Updated relevant documentation (`docs/` or `spec/`) and code comments - [X] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec <hr>This is an automatic backport of pull request #3000 done by [Mergify](https://mergify.com). Co-authored-by: Andy Nogueira <me@andynogueira.dev> Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Our homemade RPC implementation,
jsonrpc
, allows users to invoke multiple RCP methods using a single request, using batching. While this is not a problem, it may constitute a form of attack vector.By investigating the code, batching is implemented by this method:
cometbft/rpc/jsonrpc/server/http_json_handler.go
Line 41 in 6da2cf3
Not sure if this is the only method implementing batched requests, but this one was identified by running a test client.
We should consider adding a configuration parameter to limit the size/length of batched RPC requests submitted to Comet. To preserve backwards compatibility, the default value for this parameter can be
0
, meaning no limit.The text was updated successfully, but these errors were encountered: