Skip to content
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

Introduce Config Parameters to Control RPC Batch Requests #2431

Merged
merged 4 commits into from
Aug 22, 2023

Conversation

Psykepro
Copy link
Contributor

@Psykepro Psykepro commented Aug 21, 2023

Closes #2307.

What does this PR do?

Changes

  1. Control Over Batch Requests:
    • Introduce a new config parameter RPC.BatchRequestsEnabled, with a default value of false, which will allow enabling or disabling batch requests via HTTP.
    • Introduce a new config parameter RPC.BatchRequestsLimit, with a default value of 20, which will limit the number of requests that can be incorporated into each batch request. If this parameter is set to zero, there will be no limit on the number of requests in a batch.
   [RPC]
   # ....
   BatchRequestsEnabled = false
   BatchRequestsLimit = 20
   # ...

Reviewers

Main reviewers:

…ng/disabling (disabled by default) and max requests count limit.

Signed-off-by: Nikolay Nedkov <nikolai_nedkov@yahoo.com>
Copy link
Contributor

@tclemos tclemos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've extended the jsonrpc/client to be able to do BatchCalls and added tests to check the new validations.

I've also refactored the code, reviewing the way we were returning the errors and how we were logging it, to avoid false positive errors and have better metrics between invalid requests and requests with errors.

Signed-off-by: Nikolay Nedkov <nikolai_nedkov@yahoo.com>
@Psykepro Psykepro merged commit 659b082 into develop Aug 22, 2023
18 checks passed
@Psykepro Psykepro deleted the improve/rpc-limit-batch-requests branch August 22, 2023 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Upper Limit on RPC Batch Requests
2 participants