mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 20:11:09 +00:00
Make it possible to override maximum payload of RPC (#9019)
* Make it possible to override maximum payload of RPC * Finish it. * remove todo. * Update client/cli/src/commands/run_cmd.rs * Apply suggestions from code review Co-authored-by: David <dvdplm@gmail.com> * Apply suggestions from code review Co-authored-by: David <dvdplm@gmail.com> * Incorporate suggestions * Thread rpc_max_payload from configuration to trace_block * Try obey line gitlab/check_line_width.sh * update state rpc tests * Improve readbility * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com> Co-authored-by: David <dvdplm@gmail.com>
This commit is contained in:
@@ -804,6 +804,7 @@ fn gen_handler<TBl, TBackend, TExPool, TRpc, TCl>(
|
||||
client.clone(),
|
||||
subscriptions.clone(),
|
||||
deny_unsafe,
|
||||
config.rpc_max_payload,
|
||||
);
|
||||
(chain, state, child_state)
|
||||
};
|
||||
|
||||
@@ -95,6 +95,8 @@ pub struct Configuration {
|
||||
pub rpc_cors: Option<Vec<String>>,
|
||||
/// RPC methods to expose (by default only a safe subset or all of them).
|
||||
pub rpc_methods: RpcMethods,
|
||||
/// Maximum payload of rpc request/responses.
|
||||
pub rpc_max_payload: Option<usize>,
|
||||
/// Prometheus endpoint configuration. `None` if disabled.
|
||||
pub prometheus_config: Option<PrometheusConfig>,
|
||||
/// Telemetry service URL. `None` if disabled.
|
||||
|
||||
@@ -387,6 +387,7 @@ fn start_rpc_servers<
|
||||
deny_unsafe(&address, &config.rpc_methods),
|
||||
sc_rpc_server::RpcMiddleware::new(rpc_metrics.clone(), "http")
|
||||
),
|
||||
config.rpc_max_payload
|
||||
),
|
||||
)?.map(|s| waiting::HttpServer(Some(s))),
|
||||
maybe_start_server(
|
||||
@@ -399,6 +400,7 @@ fn start_rpc_servers<
|
||||
deny_unsafe(&address, &config.rpc_methods),
|
||||
sc_rpc_server::RpcMiddleware::new(rpc_metrics.clone(), "ws")
|
||||
),
|
||||
config.rpc_max_payload
|
||||
),
|
||||
)?.map(|s| waiting::WsServer(Some(s))),
|
||||
)))
|
||||
|
||||
Reference in New Issue
Block a user