-
Notifications
You must be signed in to change notification settings - Fork 860
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
Add a new CLI option to limit the number of requests in a single RPC batch request #4965
Add a new CLI option to limit the number of requests in a single RPC batch request #4965
Conversation
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
@@ -86,6 +86,8 @@ public interface DefaultCommandValues { | |||
int DEFAULT_P2P_PEER_LOWER_BOUND = 25; | |||
/** The constant DEFAULT_HTTP_MAX_CONNECTIONS. */ | |||
int DEFAULT_HTTP_MAX_CONNECTIONS = 80; | |||
/** The constant DEFAULT_HTTP_MAX_BATCH_SIZE. */ | |||
int DEFAULT_HTTP_MAX_BATCH_SIZE = 50; |
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.
Should mirror Geth and other clients at 1 IMO - users that leave this exposed by default will not want such a large batch size and those that need the functionality can track down this CLI option in the docs.
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.
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.
Done!
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
return JsonRpcExecutorHandler.handler(jsonRpcExecutor, tracer); | ||
final JsonRpcExecutor jsonRpcExecutor, | ||
final Tracer tracer, | ||
final JsonRpcConfiguration configuration) { |
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.
nit: suggestion of variable name to follow the same pattern -> jsonRpcConfiguration
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.
done
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.
LGTM
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
…batch request (hyperledger#4965) * Add option to limit requests in a single batch Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com> * Change changelog Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com> * Set default max batch size to one Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com> * Update changelog Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com> * Fix max rpc batch size for unit tests Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com> * Change variable name Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com> Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
…batch request (hyperledger#4965) * Add option to limit requests in a single batch Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com> * Change changelog Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com> * Set default max batch size to one Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com> * Update changelog Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com> * Fix max rpc batch size for unit tests Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com> * Change variable name Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com> Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
PR description
Adds a
--rpc-http-max-batch-size
CLI option to restrict the maximum number of requests in a single RPC batch request.Default
50
When
-1
: unlimited - the current configuration.When number of requests in batch >
--rpc-http-max-batch-size
:INVALID_PARAM
and messageNumber of requests in batch exceeds --rpc-http-max-batch-size.
Fixed Issue(s)
fixes #4951
Documentation
doc-change-required
label to this PR ifupdates are required.
Changelog