mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 13:27:57 +00:00
rpc server: make possible to disable/enable batch requests (#3364)
The rationale behind this, is that it may be useful for some users actually disable RPC batch requests or limit them by length instead of the total size bytes of the batch. This PR adds two new CLI options: ``` --rpc-disable-batch-requests - disable batch requests on the server --rpc-max-batch-request-len <LEN> - limit batches to LEN on the server. ```
This commit is contained in:
@@ -28,7 +28,7 @@ use sc_consensus::{
|
||||
use sc_service::{
|
||||
config::{
|
||||
BlocksPruning, DatabaseSource, KeystoreConfig, NetworkConfiguration, OffchainWorkerConfig,
|
||||
PruningMode, WasmExecutionMethod, WasmtimeInstantiationStrategy,
|
||||
PruningMode, RpcBatchRequestConfig, WasmExecutionMethod, WasmtimeInstantiationStrategy,
|
||||
},
|
||||
BasePath, Configuration, Role,
|
||||
};
|
||||
@@ -84,6 +84,7 @@ fn new_node(tokio_handle: Handle) -> node_cli::service::NewFullBase {
|
||||
rpc_max_subs_per_conn: Default::default(),
|
||||
rpc_port: 9944,
|
||||
rpc_message_buffer_capacity: Default::default(),
|
||||
rpc_batch_config: RpcBatchRequestConfig::Unlimited,
|
||||
rpc_rate_limit: None,
|
||||
prometheus_config: None,
|
||||
telemetry_endpoints: None,
|
||||
|
||||
@@ -26,7 +26,7 @@ use node_primitives::AccountId;
|
||||
use sc_service::{
|
||||
config::{
|
||||
BlocksPruning, DatabaseSource, KeystoreConfig, NetworkConfiguration, OffchainWorkerConfig,
|
||||
PruningMode, TransactionPoolOptions,
|
||||
PruningMode, RpcBatchRequestConfig, TransactionPoolOptions,
|
||||
},
|
||||
BasePath, Configuration, Role,
|
||||
};
|
||||
@@ -80,6 +80,7 @@ fn new_node(tokio_handle: Handle) -> node_cli::service::NewFullBase {
|
||||
rpc_max_subs_per_conn: Default::default(),
|
||||
rpc_port: 9944,
|
||||
rpc_message_buffer_capacity: Default::default(),
|
||||
rpc_batch_config: RpcBatchRequestConfig::Unlimited,
|
||||
rpc_rate_limit: None,
|
||||
prometheus_config: None,
|
||||
telemetry_endpoints: None,
|
||||
|
||||
Reference in New Issue
Block a user